Booking API endpoint
Returns Booking.com flight-search location suggestions (airports and cities) for `query`, which is required. `type` is `to` (default) or `from`; `origin` and `origin_type` bias results by proximity. Each result has `name`, `code`, `type`, `country`, `country_name` and `region_name`. Combine `code` and `type` as `{code}.{TYPE}` for `booking-flights-search`.
/booking-flights/autocompletequery (required): city or airport name/code to search, for example Chengdu.type: location role. Allowed values: to, from. Defaults to to.origin: optional origin location code, biases results by proximity, for example SGN.origin_type: origin location type, for example AIRPORT or CITY.Each data.results[].type + .code concatenate directly into booking-flights-search's from/to composite location id ({code}.{TYPE}, upper-cased type).
| Field | Filled in, of 3 checked | Values in the sample |
|---|---|---|
| type | 3 | “CITY” and 1 other value |
| name | 3 | “Chengdu” and 2 other values |
| code | 3 | |
| region_name | 3 | “Sichuan” |
| country | 3 | “CN” |
| country_name | 3 | “China” |
| photo_url | 3 | q-xx.bstatic.com |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| query | string | Yes | City or airport name/code to search | Chengdu | |
| type | string | No | Location role, default to Allowed values: to, from. | ||
| origin | string | No | Optional origin location code, biases results by proximity | SGN | |
| origin_type | string | No | Origin location type | AIRPORT | |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/booking-flights/autocomplete?query=Chengdu&type=to" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"query": "Chengdu",
"results": [
{
"type": "city",
"name": "Chengdu",
"code": "CTU",
"country": "cn",
"country_name": "China"
}
]
}
}Request schema
No body schema
Response schema
#/definitions/booking.bookingFlightAutocompleteResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | booking.FlightAutocompleteResponse | No | ||||
| data.query | string | No | ||||
| data.results | array | No | ||||
| data.results[].code | string | No | ||||
| data.results[].country | string | No | ||||
| data.results[].country_name | string | No | ||||
| data.results[].name | string | No | ||||
| data.results[].photo_url | string | No | ||||
| data.results[].region_name | string | No | ||||
| data.results[].type | string | No | ||||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Bad Request | #/definitions/app.Response |
| 404 | Not Found | #/definitions/app.Response |
| 429 | Too Many Requests | #/definitions/app.Response |
| 503 | Service Unavailable | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/booking-flights/autocomplete?query=Chengdu&type=to" \
-H "x-api-key: $CRAWLORA_API_KEY"