UtahRealEstate.com

Data Services

Log In

Photos

Photos

Getting photos with $expand

The easiest way to get the photos for each listing is to use the $expand query option to append all Media resources that match with each property.

For example, to get all images for each returned property.

http://resoapi.utahrealestate.com/reso/odata/Property?$expand=Media

GET /reso/odata/Property?$expand=Media HTTP/1.1
Host: http://resoapi.utahrealestate.com
Authorization: YourBearerToken

Response:

{
    "@odata.context": "$metadata#Property",
    value": [
        {
            "ListingKeyNumeric": 1631541,
            "AssociationFee": 0,
            "RoomsTotal": 18,
            ..........
            "Media": [
                {
                    "MediaKeyNumeric": 2147483647,
                    "ImageHeight": 480,
                    "ImageWidth": 640,
                    "MediaURL": "https://.....jpg",
                       ..........

Getting photos directly

The Media resource can be queried directly. Each Media resource record is relataed to a Property resource through the ResourceRecordID.

For example, to get all images for a listing with a ListingKey of 1611952:

http://resoapi.utahrealestate.com/reso/odata/Media?$filter=ResourceRecordID eq 1611952&$select=MediaURL

GET /reso/odata/Media?$filter=ResourceRecordID%20eq%201611952&$select=MediaURL&$select=MediaURL HTTP/1.1
Host: http://resoapi.utahrealestate.com
Authorization: YourBearerToken

Response:

{
    "@odata.context": "$metadata#Media(Order,MediaURL)",
    "value": [
        {
            "@odata.id": "Media(1611952_050774e9ef920b479d8e37ff459daf14_2880536.jpg)",
            "Order": 1,
            "MediaURL": "https://assets.utahrealestate.com/photos/640x480/1611952_050774e9ef920b479d8e37ff459daf14_2880536.jpg"
        },
        {
            "@odata.id": "Media(1611952_07fcb738e3bc6496ebeef1e03bce600c_2749934.jpg)",
            "Order": 2,
            "MediaURL": "https://assets.utahrealestate.com/photos/640x480/1611952_07fcb738e3bc6496ebeef1e03bce600c_2749934.jpg"
        },
        {
            "@odata.id": "Media(1611952_0d95fd7d205ec4674bc42b70d96011d9_2414957.jpg)",
            "Order": 3,
            "MediaURL": "https://assets.utahrealestate.com/photos/640x480/1611952_0d95fd7d205ec4674bc42b70d96011d9_2414957.jpg"
        }
        ..........
.utahrealestate.com