Get full property by zpid
Goal: given a zpid, get the full property detail plus photos and price history, without burning extra units.
const api = "https://api.zillapi.com";const headers = { authorization: `Bearer ${process.env.ZILLOW_API_KEY}` };
async function getFullProperty(zpid) { // Four parallel calls — one detail + three sub-resources. const [detail, photos, priceHistory, schools] = await Promise.all([ fetch(`${api}/v1/properties/${zpid}`, { headers }).then(r => r.json()), fetch(`${api}/v1/properties/${zpid}/photos`, { headers }).then(r => r.json()), fetch(`${api}/v1/properties/${zpid}/price-history`, { headers }).then(r => r.json()), fetch(`${api}/v1/properties/${zpid}/schools`, { headers }).then(r => r.json()), ]);
return { ...detail.data, photos: photos.data, priceHistory: priceHistory.data, schools: schools.data, };}The four calls run in parallel. Each successful response is one billable unit, so the four calls together cost 4 credits.
Reducing payload
The detail response is large. If you only need a handful of fields:
const r = await fetch( `${api}/v1/properties/${zpid}?fields=zpid,address.streetAddress,price,zestimate,bedrooms,bathrooms`, { headers }).then(r => r.json());See Field projection.