GET/api/v4/locations/{locationId}/photos

Get photos for a location

Returns all media files attached to a single location, including starred and unstarred photos.

Requires an API key. See Authentication for header format and key rotation.

Parameters

Path

NameTypeRequiredDescription
locationIdstringrequiredThe location's Base64-encoded Relay ID (for example `TG9jYXRpb246MTgwMDI4OQ==`). The raw numeric database ID (`1800289`) is also accepted, and so is a percent-encoded value such as `...%3D%3D`.

Responses

200Array of media files for the location. Returns an empty array when the location has no photos.
Response
{  "data": {    "mediaFilesOfLocation": [      {        "id": "TWVkaWFGaWxlOjU4Nzg5MzE=",        "url": "https://sy-media-store.s3-us-west-2.amazonaws.com/f868bb3f/59c670a3/f47d62a6.jpg",        "thumbnailUrl": "https://sy-media-store.s3-us-west-2.amazonaws.com/f868bb3f/59c670a3/thumbnail_f47d62a6.jpg",        "categoryName": "Logo",        "categoryId": "4",        "fileType": "image",        "starred": false,        "viewsCount": 0      },      {        "id": "TWVkaWFGaWxlOjU4Nzg5MzI=",        "url": "https://sy-media-store.s3-us-west-2.amazonaws.com/f868bb3f/59c670a3/ef4ffb12.jpg",        "thumbnailUrl": "https://sy-media-store.s3-us-west-2.amazonaws.com/f868bb3f/59c670a3/thumbnail_ef4ffb12.jpg",        "categoryName": "Additional",        "categoryId": "12",        "fileType": "image",        "starred": true,        "viewsCount": 143      }    ]  }}
401Unauthenticated, missing or invalid API key.
429Rate limit exceeded. Retry after the `Retry-After` header value.

Returns every media file attached to a location: logo, cover, and additional images, with each file's public url, thumbnailUrl, category, whether it is starred, and a lifetime viewsCount.

Use case: render a location's photo gallery. Fetch the media list to display the images a business already has live, using thumbnailUrl for the grid and url for the full-size view. starred tells you which additional photos are pinned for priority placement on supported publishers.

Use case: audit media coverage before an upload. Call this endpoint first to see whether a location is missing a Logo or Cover category image, then only upload what is absent. The returned id values are exactly what you pass to the star and remove endpoints.

Gotchas.

  • Either id form works in the path: 1800289, TG9jYXRpb246MTgwMDI4OQ==, and TG9jYXRpb246MTgwMDI4OQ%3D%3D all resolve to the same location. A value that is neither returns HTTP 200 with an errors array containing SY90002: Invalid Id and a null payload.
  • A location with no media returns { "data": { "mediaFilesOfLocation": [] } }, this is the live response for a freshly created location such as "Jenny Home", not an error.
Request
curl -X GET 'https://listingsapi.com/api/v4/locations/<locationId>/photos' \  -H "Authorization: API $LISTINGSAPI_KEY"