beds and baths

beds is the number of bedrooms and baths the number of bathrooms, as the home's Zillow page lists them.

FieldType
data.bedsnumber or null
data.bathsnumber or null

What it means

Both are plain numbers. beds of zero is a studio: a recorded apartment rental came back with zero bedrooms and one bathroom, and that zero is a real value.

baths is one total as Zillow shows it. The API has no separate count of full and half bathrooms, so don't try to split it.

For an apartment building link, beds and baths describe the same unit as price: the building's lowest-priced unit available at lookup time. Other units of the building aren't returned yet.

Both counts are what the page lists, usually supplied by the listing agent or public records, so a basement bedroom or a converted den may or may not be counted. When the description mentions a different count, the structured field is still what the page lists; show the field and keep the text as the seller's words.

Recorded example

Recorded lookup of a home for sale
{
  "homeType": "SINGLE_FAMILY",
  "beds": 3,
  "baths": 2
}
Recorded lookup of a rental
{
  "homeType": "APARTMENT",
  "beds": 0,
  "baths": 1
}
Recorded lookup of a home for sale
{
  "homeType": "LOT",
  "beds": null,
  "baths": 0
}

Values are copied from recorded lookups of public Zillow pages, with the other fields of data left out. They show the shape and typical values, not today's data for these homes.

When it is null

  • The page doesn't list the fact. Recorded land listings came back without bedrooms, and one lot came back with baths of zero, so check homeType before trusting either number on land.
  • Null means the page didn't say. It never stands for zero bedrooms; a studio is zero, not null.

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 and jq
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 | {beds, baths}'
Python
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"]
beds, baths = home["beds"], home["baths"]
label = "studio" if beds == 0 else (f"{beds:g} bd" if beds is not None else "beds n/a")
print(label, "|", f"{baths:g} ba" if baths is not None else "baths n/a")
JavaScript (Node)
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 { beds, baths } = home;
const bedLabel = beds === 0 ? "studio" : beds != null ? `${beds} bd` : "beds n/a";
console.log(bedLabel, baths != null ? `${baths} ba` : "baths n/a");

Common mistakes

  • Treating beds of zero as missing. Use a null check, not a falsy check, in JavaScript and Python.
  • Showing baths of zero on a LOT listing as a home without a bathroom. For land, hide both fields.
  • Mixing units of a building. beds and baths always describe the same unit as price; don't combine them with another unit's rent.

Zillow is a trademark of Zillow, Inc. PropertiesAPI is an independent service and is not affiliated with, endorsed by or sponsored by Zillow.

beds and baths questions

How is a studio shown?+

beds is zero. That is a real value, not a missing one.

Are half bathrooms counted separately?+

No. baths is one total, as Zillow shows it.

What do beds and baths mean for an apartment building?+

They describe the building's lowest-priced unit available at lookup time, the same unit as price.