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 Go
go mod init example
Call Search Booking.com properties API from Go
GET /v1/booking/search. Save this as main.go and run go run main.go. It reads the items in properties and prints name and price.amount for each.
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"net/url"
"os"
"time"
)
// The fields this program reads, as the recorded response has them.
type Page struct {
Properties []struct {
Name string `json:"name"`
Price struct {
Amount float64 `json:"amount"`
} `json:"price"`
} `json:"properties"`
Pagination struct {
NextCursor string `json:"next_cursor"`
} `json:"pagination"`
}
var client = &http.Client{Timeout: 60 * time.Second}
func fetch(q url.Values) (*Page, error) {
req, err := http.NewRequest("GET", "https://api.groundsocial.dev/v1/booking/search"+"?"+q.Encode(), nil)
if err != nil {
return nil, err
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("GROUNDSOCIAL_API_KEY"))
res, err := client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if res.StatusCode != http.StatusOK {
var e struct {
Error struct {
Code string `json:"code"`
Hint string `json:"hint"`
Retryable bool `json:"retryable"`
} `json:"error"`
}
json.NewDecoder(res.Body).Decode(&e)
return nil, fmt.Errorf("%s: %s", e.Error.Code, e.Error.Hint)
}
var page Page
if err := json.NewDecoder(res.Body).Decode(&page); err != nil {
return nil, err
}
return &page, nil
}
func main() {
q := url.Values{}
q.Set("location", "Paris")
q.Set("check_in", "2027-03-10")
q.Set("check_out", "2027-03-12")
q.Set("adults", "2")
page, err := fetch(q)
if err != nil {
log.Fatal(err)
}
for _, item := range page.Properties {
fmt.Println(item.Name, item.Price.Amount)
}
}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. It replaces main in the program above and reuses its Page and fetch.
func main() {
q := url.Values{}
q.Set("location", "Paris")
q.Set("check_in", "2027-03-10")
q.Set("check_out", "2027-03-12")
q.Set("adults", "2")
for i := 0; i < 5; i++ { // each page is one call
page, err := fetch(q)
if err != nil {
log.Fatal(err)
}
for _, item := range page.Properties {
fmt.Println(item.Name, item.Price.Amount)
}
if page.Pagination.NextCursor == "" {
break
}
q.Set("after", page.Pagination.NextCursor)
}
}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.
// fetch returns the API error as "code: hint". To retry the retryable ones
// (rate_limited, upstream_timeout), wait for Retry-After and call again:
for attempt := 0; attempt < 3; attempt++ {
page, err = fetch(q)
if err == nil {
break
}
time.Sleep(2 * time.Second)
}| 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, JavaScript, TypeScript, PHP, cURL.
- Search Booking.com properties API reference: every field and status code.
- Booking.com tutorials and all Go tutorials.
- Booking.com API: every endpoint and price.
- How to get a Booking.com property with Go: One Booking.com property: address, stars, review score, facilities, rooms and photos.
- How to scrape reviews of a Booking.com property with Go: 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 Go: 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.