Skip to content

Field projection

Every detail and search response supports field projection via the fields query parameter. Pass a comma-separated list of dot-paths from the canonical Stay shape.

Quick example

Terminal window
# Just id, title, and the per-night price
curl "https://api.stayingapi.com/v1/stays/1135700964697993602?fields=id,title,pricing.price" \
-H "Authorization: Bearer sk_live_..."
{
"data": {
"id": "1135700964697993602",
"title": "Beachfront flat in Estoril",
"pricing": { "price": 184 }
}
}

How projection works

  • Each entry can be a top-level field (id) or a dot-path (pricing.price).
  • Wildcards are not supported β€” list every leaf you want.
  • Order of fields in the response is not guaranteed (JSON objects are unordered).

Supported root fields

The canonical Stay shape has these top-level keys:

id, url, title, description, property_type, room_type, person_capacity, star_rating, location, host, pricing, reviews_count, rating_breakdown, photos, reviews, amenities, availability.

See the Stays endpoint for the full schema.

Search projection

The same parameter works on search results β€” it’s applied per-row.

Terminal window
curl -X POST https://api.stayingapi.com/v1/search?fields=id,title,location.city \
-H "Authorization: Bearer sk_live_..." \
-H "content-type: application/json" \
-d '{"location":"Austin, TX"}'

Next