photos, imgSrc, photoCount and virtualTourUrl
photos is the list of the listing's image URLs, imgSrc the main photo, photoCount how many photos there are, and virtualTourUrl a link to a virtual tour when the listing has one.
| Field | Type |
|---|---|
data.photos | array of strings (URLs) |
data.imgSrc | string or null |
data.photoCount | integer or null |
data.virtualTourUrl | string or null |
What it means
PropertiesAPI returns photos as the original image URLs on Zillow's image host. It never downloads, stores or re-hosts the images. Each URL in photos is a large version of one photo, in the order the listing shows them.
imgSrc is the main photo, and it can be a different size from the first entry of photos even when it is the same picture. Use imgSrc for a thumbnail or card, and photos for a gallery.
photoCount is the number of photos. In our recorded lookups it matched the length of photos. virtualTourUrl is the third-party tour link from the listing, as given; it can be a plain http link.
Recorded example
{
"imgSrc": "https://photos.zillowstatic.com/fp/43506e4f21a47fe72d72e57c9f9c5b5a-p_f.jpg",
"photos": [
"https://photos.zillowstatic.com/fp/43506e4f21a47fe72d72e57c9f9c5b5a-uncropped_scaled_within_1536_1152.jpg",
"https://photos.zillowstatic.com/fp/318bd6a5d58790cdc6d3449a99c7466c-uncropped_scaled_within_1536_1152.jpg"
],
"photoCount": 37,
"virtualTourUrl": "http://www.1704shelbourne.com/mls/232163496"
}Values are copied from recorded lookups of public Zillow pages, with the other fields of data left out; long lists are cut to their first entries and long text to its opening words. They show the shape and typical values, not today's data for these homes.
When it is null
- photos is empty, never null, when the listing has no images.
- virtualTourUrl is null for most homes: only a few recorded listings had one.
- imgSrc is null only when no image could be found at all.
Read it in code
Send a Zillow link, a zpid or an address to GET /v1/zillow/property with your key in the x-api-key header, then read the field from data:
curl -sG "https://api.propertiesapi.com/v1/zillow/property" \
-H "x-api-key: $PROPERTIESAPI_KEY" \
--data-urlencode "url=https://www.zillow.com/homedetails/1704-Shelbourne-Dr-Austin-TX-78752/29412761_zpid/" \
| jq '.data | {photos, imgSrc, photoCount, virtualTourUrl}'import os
import requests
r = requests.get(
"https://api.propertiesapi.com/v1/zillow/property",
params={"url": "https://www.zillow.com/homedetails/1704-Shelbourne-Dr-Austin-TX-78752/29412761_zpid/"},
headers={"x-api-key": os.environ["PROPERTIESAPI_KEY"]},
timeout=120,
)
r.raise_for_status()
home = r.json()["data"]
print("main photo:", home["imgSrc"])
for url in home["photos"][:5]:
print(url)
print(home["photoCount"], "photos | tour:", home["virtualTourUrl"])const url = "https://www.zillow.com/homedetails/1704-Shelbourne-Dr-Austin-TX-78752/29412761_zpid/";
const res = await fetch(
`https://api.propertiesapi.com/v1/zillow/property?url=${encodeURIComponent(url)}`,
{ headers: { "x-api-key": process.env.PROPERTIESAPI_KEY } },
);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const { data: home } = await res.json();
const gallery = home.photos.slice(0, 5);
console.log(home.imgSrc, gallery, home.photoCount, home.virtualTourUrl);Common mistakes
- Copying the images to your own storage. They belong to their owners; check the terms that apply to your use before you display or keep them.
- Embedding an http virtual tour link on an https page, which browsers block as mixed content. Open it in a new tab instead.
- Assuming photo URLs never change. Listings change their photos; look the home up again before relying on an old URL.
Related
- description
- Listing agent, broker and MLS
- homeType and yearBuilt
- Every field of the property endpoint
- Guide: Zillow API photos: display image URLs responsibly
- All response fields
Zillow is a trademark of Zillow, Inc. PropertiesAPI is an independent service and is not affiliated with, endorsed by or sponsored by Zillow.
photos, imgSrc, photoCount and virtualTourUrl questions
Does PropertiesAPI host the photos?+
No. It returns the original image URLs only and never re-hosts them.
How many photos come back?+
All the photos the listing shows, as URLs in photos; photoCount says how many.
Is there a virtual tour link?+
When the listing has one, in virtualTourUrl. Most homes don't.