Skip to content
ajar.Book a demo

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 an API key from Settings with Booking.com read access. Set AJAR_API_URL to https://api.useajar.com and AJAR_API_KEY to your key in your terminal environment. 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 API key, scope, and permission. 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.