Piloterr

Despegar Flight Search

GET
/v2/despegar/flight/search

Route fares from Despegar. query is BUE-MAD, Buenos Aires - Madrid, or a flights URL such as https://www.despegar.com.ar/vuelos/bue/mad/. Dates are checked but do not change the route page. A URL in query is fetched as-is.

Credit cost: 2 credits per call

Authorization

ApiKeyAuth
headerx-api-key<token>

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

Query Parameters

query*string

IATA pair, city pair, or a Despegar flights URL. The value sent is the code or the page URL.

BUE-MAD
Buenos Aires - Madrid
https://www.despegar.com.ar/vuelos/bue/mad/
depart?string

Optional. YYYY-MM-DD, today or later. Checked only. The fares still come from the route page. A past date returns 400.

2026-12-15
return_date?string

Optional. Send it only together with depart. It must be after depart. It does not switch the page to a dated shop search.

2026-12-18
adults?number

Optional. Must be at least 1. The route page does not filter by passenger count.

language?string

Optional. Default es-AR. Aliases: es, en, pt, ar.

es-AR
currency?string

Optional. Three letters. Used when a fare card does not show a currency. Fallback USD.

country?string

Optional. Two-letter site code. The value sent is the code, for example ar. It does not change the proxy. It selects the site and sends the x-locale header. If language is set, language wins for the locale. A full URL in query is left unchanged. Any other code returns 400.

ar
mx

ar despegar.com.ar, mx despegar.com.mx, co despegar.com.co, cl despegar.cl, pe despegar.com.pe, uy despegar.com.uy, br decolar.com, us despegar.com.

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

Response Body

Successful response

application/json
  1. response
results?array<>
pagination?
Example Request
curl -X GET 'https://api.piloterr.com/v2/despegar/flight/search?query=string'
Example Response
{  "results": [    {      "url": "https://www.despegar.com.ar/shop/flights/results/roundtrip/BUE/MAD/",      "price": 893,      "route": "AEP - MAD",      "airline": "Avianca",      "currency": "USD",      "price_display": "US$ 893"    }  ],  "pagination": {    "next": null,    "page": 1,    "per_page": 21,    "total_pages": null,    "total_results": null  }}