Before you start
- Get an API keySign up for 100 free credits, no card. Keys start with
gs_live_. - Put it in the environmentEvery example reads it from
GROUNDSOCIAL_API_KEY:export GROUNDSOCIAL_API_KEY=gs_live_… - Set up JavaScript
node --version # 18 or newer: fetch is built in, nothing to install
Call Search Booking.com properties API from JavaScript
GET /v1/booking/search. Save this as main.mjs and run node main.mjs. It reads the items in properties and prints name and price.amount for each.
// main.mjs: Node.js 18+, no dependencies
const url = new URL('https://api.groundsocial.dev/v1/booking/search')
url.searchParams.set('location', 'Paris')
url.searchParams.set('check_in', '2027-03-10')
url.searchParams.set('check_out', '2027-03-12')
url.searchParams.set('adults', '2')
const res = await fetch(url, {
headers: {
Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}`,
},
signal: AbortSignal.timeout(60_000),
})
if (!res.ok) {
const { error } = await res.json()
throw new Error(`${error.code}: ${error.hint ?? error.message}`)
}
const data = await res.json()
for (const item of data.properties) {
console.log(item.name, item.price?.amount)
}
console.log('credits charged:', res.headers.get('x-credits-charged'))The response
A real Booking.com response to this call, recorded from the live API on 27 Nov 2026 and shortened for display: arrays keep their first items and … marks every cut. The recorded page had 25 items in properties. Live calls return current data in the same shape.
{
"destination": {
"dest_id": "-1456928",
"dest_type": "CITY",
"label": "Paris, Ile de France, France",
"country_code": "fr",
"latitude": 48.8566818237305,
"longitude": 2.35147643089294
},
"total": 5254,
"properties": [
{
"id": 242392,
"name": "WIT Hotel",
"page_name": "mattle",
"url": "https://www.booking.com/hotel/fr/mattle.html",
"ufi": -1456928,
"accommodation_type_id": 204,
"is_closed": false,
"address": "8, Rue De La Boule Rouge",
"city": "Paris",
"country_code": "fr",
"latitude": 48.8736377339033,
"longitude": 2.34488099813461,
"display_location": "9th arr., Paris",
"distance": "1.2 miles from downtown",
"public_transport": "Grands Boulevards station is within 350 yards",
"star_rating": 3,
"review_score": 7.7,
"review_count": 2829,
"secondary_score": null,
"secondary_score_label": null,
"photo_url": "https://cf.bstatic.com/xdata/images/hotel/square600/888479650.webp?k=b0381b9d9293ba3cac47a14702cfb5c58df99562b62e93c4032…",
"price": {
"amount": 352.145673792407,
"formatted": "$352.15",
"currency": "USD"
},
"price_before_discount": {
"amount": 664.425818431642,
"formatted": "$664.43",
"currency": "USD"
},
"free_cancellation": false,
"…": "3 more fields"
},
{
"id": 59015,
"name": "Ibis Styles Paris Batignolles",
"page_name": "mirific",
"url": "https://www.booking.com/hotel/fr/mirific.html",
"ufi": -1456928,
"accommodation_type_id": 204,
"is_closed": false,
"address": "119 Avenue De Clichy",
"city": "Paris",
"country_code": "fr",
"latitude": 48.8898525712938,
"longitude": 2.32120871538427,
"display_location": "17th arr., Paris",
"distance": "2.7 miles from downtown",
"public_transport": "Brochant station is within 150 yards",
"star_rating": 3,
"review_score": 8.3,
"review_count": 3215,
"secondary_score": null,
"secondary_score_label": null,
"photo_url": "https://cf.bstatic.com/xdata/images/hotel/square600/753148428.webp?k=8696699f6bf6db16fc24748e2213928e96a0a6417f0165c2954…",
"price": {
"amount": 296.786891811592,
"formatted": "$296.79",
"currency": "USD"
},
"price_before_discount": null,
"free_cancellation": false,
"…": "3 more fields"
},
"… 23 more"
],
"pagination": {
"next_cursor": "eyJsb2NhdGlvbiI6IlBhcmlzIiwiY2hlY2tfaW4iOiIyMDI3LTAzLTEwIiwiY2hlY2tfb3V0IjoiMjAyNy0wMy0xMiIsImFkdWx0cyI6MiwiY2hpbGRyZW5f…",
"has_more": true
}
}Top-level fields
| Field | Type | Description |
|---|---|---|
destination | BookingDestination | – |
total | integer | null | – |
properties | BookingSearchProperty[] | – |
pagination | BookingPagination | – |
Parameters
| Name | In | Type | Description |
|---|---|---|---|
location | query | string | Where, as typed on Booking.com. Example: Paris. |
check_in | query | string | Arrival day, YYYY-MM-DD. Example: 2026-12-10. |
check_out | query | string | Departure day, YYYY-MM-DD. Example: 2026-12-10. |
adults | query | integer | Adults (default 2). |
children | query | integer | null | Children; their ages default to 8 unless children_ages is given. |
children_ages | query | string | Comma-separated ages 0-17, one per child. Example: 5,9. |
rooms | query | integer | Rooms (default 1). |
currency | query | string | ISO currency for prices (default USD). Example: EUR. |
language | query | string | Booking.com language for texts (en-us, en-gb, de, fr, …). Example: en-gb. |
after | query | string | Cursor: the previous page’s pagination.next_cursor. |
Pagination
Each page carries the next cursor in pagination.next_cursor; pass it back as after and stop when it is empty. Every page is a separate call at 1 credit per call, so cap the pages you read. Add it to the same file.
// Each page is one call; stop when there is no next cursor.
async function* pages(maxPages = 5) {
const url = new URL('https://api.groundsocial.dev/v1/booking/search')
url.searchParams.set('location', 'Paris')
url.searchParams.set('check_in', '2027-03-10')
url.searchParams.set('check_out', '2027-03-12')
url.searchParams.set('adults', '2')
for (let i = 0; i < maxPages; i++) {
const res = await fetch(url, {
headers: {
Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}`,
},
signal: AbortSignal.timeout(60_000),
})
if (!res.ok) throw new Error((await res.json()).error.hint)
const page = await res.json()
yield page
const cursor = page.pagination?.next_cursor
if (!cursor) return
url.searchParams.set('after', cursor)
}
}
for await (const page of pages()) {
for (const item of page.properties ?? []) {
console.log(item.name, item.price?.amount)
}
}Errors and retries
Every error is JSON with error.code (stable: branch on it), message, hint (what to do next), docs_url and retryable. A failed call is never charged. Retry only when retryable is true, after the Retry-After header.
async function call(url, init = {}, attempt = 0) {
const res = await fetch(url, {
...init,
headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}`, ...init.headers },
signal: AbortSignal.timeout(60_000),
})
if (res.ok) return res.json()
const { error } = await res.json()
// Branch on error.code (stable); error.hint says what to do next.
if (error.retryable && attempt < 2) {
const wait = Number(res.headers.get('retry-after') ?? 2)
await new Promise((r) => setTimeout(r, wait * 1000))
return call(url, init, attempt + 1)
}
throw Object.assign(new Error(error.hint ?? error.message), { code: error.code })
}| Status | Meaning |
|---|---|
200 | A page of properties. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | No Booking.com property or destination by that id, link or name. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Booking.com is temporarily unavailable. Retryable; nothing was charged. |
Every error code and what to do about it.
Pricing
| Cost | |
|---|---|
| Per call | 1 credit per call |
| 1,000 calls | $1.00 on the starter pack, $0.40 at volume |
| No key (MPP or x402) | $0.01 per call |
| Failed call | Refunded, never charged |
Every response has x-credits-charged and x-credits-remaining headers. Credits never expire. Packs and calculator.
From an AI agent (MCP)
The same call is the booking_search_all tool on the hosted MCP server, so Claude, Cursor or any MCP client can make it without code. Add the server once:
claude mcp add --transport http groundsocial https://api.groundsocial.dev/mcpThen ask for it in words (“Search Booking.com properties by place, with dates, guests and rooms (25 a page)”), or call the tool directly:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "booking_search_all",
"arguments": {
"location": "Paris",
"check_in": "2027-03-10",
"check_out": "2027-03-12",
"adults": "2"
}
}
}MCP setup for Claude Desktop, Cursor, VS Code and ChatGPT.
Use Booking.com search all in a pipeline
Properties for a place (location as typed on Booking.com: a city, region, district, landmark, airport or hotel name; destination says what it resolved to), 25 a page in Booking.com’s order, each with address, coordinates, stars, review score and count, distance, photo, free cancellation / no prepayment, and with dates the total price for the stay, the room offer it is for and the unit (beds, bedrooms). Without dates there are no prices.
Keep going
- This call in Python, TypeScript, Go, PHP, cURL.
- Search Booking.com properties API reference: every field and status code.
- Booking.com tutorials and all JavaScript tutorials.
- Booking.com API: every endpoint and price.
- How to get a Booking.com property with JavaScript: One Booking.com property: address, stars, review score, facilities, rooms and photos.
- How to scrape reviews of a Booking.com property with JavaScript: Guest reviews of a Booking.com property, with scores, stay details and replies (up to 25 a page).
- How to scrape rooms and prices of a Booking.com property for a stay with JavaScript: A Booking.com property’s room types for a stay, with the best available price and nightly prices.
Run it on your own data
One key for Booking.com and 76 more platforms, over REST or MCP. Free credits on signup, no card.
Booking.com is a trademark of its owner. We are not affiliated with or endorsed by it.