Property Photos

The advantages of listing photos and how to use the API to manage them.

Overview

Including photos in listings can make them more eye-catching in search results. Hosts can use photos to give potential guests a glimpse of what they can expect from their place, including its inside, outside, and surrounding areas. The listings API allows you to access one or multiple photos, add new photos, and edit or remove existing ones. Guesty provides dedicated APIs for adding and editing a property's photos.

Prerequisites

  1. Your pictures must be accessible in a cloud storage repository for Guesty to import.
  2. Your images should be web-optimized and of high quality. For Guesty's recommendations and requirements, click here.
  3. Only the original should be supplied; Guesty will create the relevant template sizes.

Adding photos to a property


Step 1: Add photos to the property

Use this endpoint to upload high-quality images of your property.


API resource:


Step 2: Order the photos

Use the following resource to alter the order of the existing property photos. All listed photos will be placed first, and the rest will be placed at the end.


API resource


Step 3: Fine-tune the offering

Utilize this endpoint to replace an image or edit its caption without changing the photo order or room assignments.


API resource


Delete a photo

You can completely remove photos from a property using the following endpoint.


API resource


Retrieve Pictures

The listing object contains a property's photos (URLs) and you can use the listings API to retrieve the

Available Endpoints

MethodEndpoint
GET/listings/{id}
GET/listings

Request Example

curl 'https://open-api.guesty.com/v1/listings/{id}?fields=pictures' \
--header 'Authorization: Bearer {accessToken}'
const myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {accessToken}");

const requestOptions = {
  method: "GET",
  headers: myHeaders,
  redirect: "manual"
};

fetch("https://open-api.guesty.com/v1/listings/{id}?fields=pictures", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://open-api.guesty.com/v1/listings/{id}?fields=pictures',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => false,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer {accessToken}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

import http.client

conn = http.client.HTTPSConnection("open-api.guesty.com")
payload = ''
headers = {
  'Authorization': 'Bearer {accessToken}'
}
conn.request("GET", "/v1/listings/66054019764cbb000f37c450?fields=pictures", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Response Example

{
    "_id": "<listingId>",
    "type": "<string>",
    "tags": [
        "<tag>"
    ],
    "pictures": [
        {
            "_id": "<pictureId>",
            "original": "<URL>",
            "thumbnail": "<URL>",
            "height": 1280,
            "width": 1920,
            "size": 180129,
            "caption": "<string>"
        },
        {
            "_id": "<pictureId>",
            "original": "<URL>",
            "thumbnail": "<URL>",
            "height": 1280,
            "width": 1920,
            "size": 180129,
            "caption": "<string>"
        },
        {
            "_id": "<pictureId>",
            "original": "<URL>",
            "thumbnail": "<URL>",
            "height": 1280,
            "width": 1920,
            "size": 180129,
            "caption": "<string>"
        }
    ]
    "accountId": "<accountId>"
}

๐Ÿ“˜

Repository Consolidation

Contact Customer Experience if you wish to migrate to and consolidate your property photos on Guesty's storage repository.


Room Photos (Beta)

Before embarking on this task, ensure that you have configured your property's rooms beforehand. You can assign pictures to a specific room. To learn more, refer to Assign a Photo to a Space.