Piloterr

Booking Flight Search

GET
/v2/booking/flight/search

Flight offers for an IATA pair such as PAR-LON, or a Booking flights URL. On an IATA pair, dates are optional. A flights URL is fetched as-is and dates are not applied.

Credit cost: 3 credits per call

Autorización

ApiKeyAuth
headerx-api-key<token>

Your API key. Include it in the x-api-key header for every request.

Parámetros de consulta

query*string

Required. IATA pair, or a Booking flights URL. The value sent is the code or the page URL, not an API URL.

PAR-LON
https://flights.booking.com/flights/PAR-LON/
depart?string

Optional. YYYY-MM-DD. Omit it: the route page still returns fares. If both dates are set, return_date must be after depart.

return_date?string

Optional. YYYY-MM-DD. Omit it for the route fares or a one-way hint. Must be after depart when both are set.

adults?number

Optional. Default 1.

Default"1"
language?string

Optional. Default en-gb.

currency?string

Optional. Default USD.

page?number

Optional. Default 1.

Default"1"
country?string

Optional. Two-letter market code. The value sent is the code, for example ar. It does not change the proxy. Booking sets the cookie explicit_language_preference and the Accept-Language header. If language is empty, this also sets the page language. A URL in query is not rewritten. Any other code returns 400.

ar
fr

Accepted codes: ar, at, be, br, ca, ch, cl, cn, co, cz, de, dk, es, fi, fr, gb, hu, ie, it, jp, mx, nl, no, pe, pl, pt, ro, se, tw, uk, us, uy.

return_page_source?boolean

Optional. Default false. true returns {"result": html} instead of JSON. A Chrome, Brave, or Internet Explorer proxy error is still HTTP 500, and that error page is not returned.

false
Defaultfalse
fields?string

Comma-separated list of response fields to return, with dot notation for nested fields (e.g. name,location.city).

is_async?boolean

Run the request as a background job: the API answers 202 with a job_id to poll on GET /v1/jobs/{id}.

Defaultfalse
soft_fail?boolean

Return HTTP 200 even when the request fails; the error is in the error field of the body.

Defaultfalse

Cuerpo de la respuesta

Successful response

application/json
  1. response
results?array<>
pagination?
Example Request
curl -X GET 'https://api.piloterr.com/v2/booking/flight/search?query=string'
Example Response
{  "results": [    {      "url": "https://flights.booking.com/flights/PAR-LON/",      "price": 83.84,      "route": "PAR Paris LON London",      "stops": "Aller-retour Classe économique 1 passager",      "airline": null,      "currency": "EUR",      "duration": null,      "arrive_at": null,      "depart_at": "sam. 14 nov. - mer. 18 nov.",      "price_display": "sam. 14 nov. - mer. 18 nov. € 83,84"    },    {      "url": "https://flights.booking.com/flights/PAR-LON/",      "price": 84.74,      "route": "PAR Paris LON London",      "stops": "Aller-retour Classe économique 1 passager",      "airline": null,      "currency": "EUR",      "duration": null,      "arrive_at": null,      "depart_at": "sam. 21 nov. - mer. 25 nov.",      "price_display": "sam. 21 nov. - mer. 25 nov. € 84,74"    }  ],  "pagination": {    "next": null,    "page": 1,    "per_page": 25,    "total_pages": 1,    "total_results": 3  }}