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 Rooms and prices of a Booking.com property for a stay API from Go
GET /v1/booking/hotel/rooms. Save this as main.go and run go run main.go. It reads the items in rooms and prints id 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 {
Rooms []struct {
ID float64 `json:"id"`
} `json:"rooms"`
}
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/hotel/rooms"+"?"+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("id", "280149")
q.Set("check_in", "2027-03-10")
q.Set("check_out", "2027-03-12")
page, err := fetch(q)
if err != nil {
log.Fatal(err)
}
for _, item := range page.Rooms {
fmt.Println(item.ID)
}
}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 15 items in rooms. Live calls return current data in the same shape.
{
"hotel_id": 280149,
"check_in": "2027-03-10",
"check_out": "2027-03-12",
"available": true,
"best_offer": {
"room_id": "28014901",
"occupancy": 2,
"meal_plan_id": 2,
"policy_group_id": "88652304",
"price": 1868.24624593726,
"currency": "USD",
"free_cancellation_until": null,
"room_name": null
},
"price": {
"amount": 1868.24624593726,
"formatted": "$1,868.25",
"currency": "USD"
},
"nights": [
{
"date": "2027-03-10",
"available": true,
"price": 982,
"price_formatted": "$982",
"min_stay": 1
},
{
"date": "2027-03-11",
"available": true,
"price": 982,
"price_formatted": "$982",
"min_stay": 1
}
],
"rooms": [
{
"id": 28014901,
"name": null,
"description": null,
"room_type_id": 9,
"max_persons": 2,
"max_children": 1,
"is_smoking": false,
"beds": [
{
"count": 1,
"type": "LARGE_DOUBLE_BED",
"name": "Queen bed(s)"
}
],
"amenities": [
"safe_deposit_box",
"airconditioning",
"… 34 more"
]
},
{
"id": 28014903,
"name": null,
"description": null,
"room_type_id": 7,
"max_persons": 3,
"max_children": 0,
"is_smoking": false,
"beds": [
{
"count": 1,
"type": "SINGLE_BED",
"name": "Twin bed(s)"
}
],
"amenities": [
"safe_deposit_box",
"airconditioning",
"… 31 more"
]
},
"… 13 more"
]
}Top-level fields
| Field | Type | Description |
|---|---|---|
hotel_id | integer | – |
check_in | string | – |
check_out | string | – |
available | boolean | Booking.com has an offer for this stay and party. |
best_offer | object | The lowest-priced room offer for the stay (what search shows). |
price | object | – |
nights | object[] | – |
rooms | BookingRoom[] | The property’s room types. |
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id | query | string | Booking.com hotel id. Example: 280149. |
url | query | string | A property link, https://www.booking.com/hotel/<cc>/<name>.html. Example: https://www.booking.com/hotel/gb/the-savoy.html. |
check_in | query | string | Arrival day, YYYY-MM-DD (required). Example: 2026-12-10. |
check_out | query | string | Departure day, YYYY-MM-DD (required). 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. |
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 | The stay’s offer and the room types. |
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 | 2 credits per call |
| 1,000 calls | $2.00 on the starter pack, $0.80 at volume |
| No key (MPP or x402) | $0.02 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_hotel_rooms 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 (“A Booking.com property’s room types for a stay, with the best available price and nightly prices”), or call the tool directly:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "booking_hotel_rooms",
"arguments": {
"id": "280149",
"check_in": "2027-03-10",
"check_out": "2027-03-12"
}
}
}MCP setup for Claude Desktop, Cursor, VS Code and ChatGPT.
Use Booking.com hotel rooms in a pipeline
A property for a stay (check_in and check_out required) and party: whether Booking.com has an offer, the best (lowest-priced) offer with its room, meal plan and free-cancellation deadline, the total price, the lowest price night by night with minimum stay, and the property’s room types (name, beds, occupancy, amenities). Logged out, Booking.com’s per-room rate table is only on its challenged hotel page, so other rooms’ prices are not listed.
Keep going
- This call in Python, JavaScript, TypeScript, PHP, cURL.
- Rooms and prices of a Booking.com property for a stay 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 search Booking.com properties with Go: Search Booking.com properties by place, with dates, guests and rooms (25 a page).
- 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).
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.