Skip to content
ajar.Get started

Make your first request

Find Booking.com hotels in New York for two adults this weekend, without a Booking.com account.

Before you start

You need Node.js 22 or newer and your provisioned connector API URL and bearer token. Set AJAR_API_URL and AJAR_CONNECTOR_TOKEN in your terminal environment. These are connector credentials; a dashboard workspace key alone does not authorize connector calls. Request connector access from ajar if you have not received them. The Booking.com guest runtime must be enabled for your endpoint.

What you’ll send

Start a guest session, predict New York City, then search with the returned place_ref. The example searches a Friday check-in and Sunday check-out for two adults in one room, priced in USD. Dates are calculated each time you run it using New York’s time zone. If it is already Friday or later, it chooses the next Friday so check-in stays in the future. Review the printed dates and change them if you want a different stay.

Read the response

A successful search returns HTTP 200 and JSON. The items array contains hotel names, photos, review scores, prices and room summaries. The response also echoes the dates, currency and occupancy, and includes search_ref and the available filter catalog. Results and prices are live; an empty items array means no stays were returned for that search. This is a guest search: it does not reserve a room or take a payment.

If a request fails

HTTP 401 or 403: check your connector credential and access permissions. UpstreamDisabled: ask ajar to enable Booking.com guest access. If the guest session or a place/search reference expires, start the script again to create a fresh session and predict the destination again. Place and search references last 15 minutes and are scoped to the same caller and session.