Call it
curl https://api.peume.com/v1/call/search-flights \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"origin": "your origin",
"destination": "your destination"
}
}'const res = await fetch("https://api.peume.com/v1/call/search-flights", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"origin": "your origin",
"destination": "your destination"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/search-flights",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"origin": "your origin",
"destination": "your destination"
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: search-flights.
Parameters
originstring3-letter IATA city or airport code. See `origin_type` for how an untyped code is read. `origin` and `destination` must differ. A 3-letter code the platform’s location catalog does not recognise is not refused: it is searched as an airport, and if no provider sells it the search answers `result: no_matches`.
destinationstring3-letter IATA city or airport code. See `destination_type` for how an untyped code is read: LAX alone is the Los Angeles CITY; send `destination_type: "airport"` for the airport only. `origin` and `destination` must differ. A 3-letter code the platform’s location catalog does not recognise is not refused: it is searched as an airport, and if no provider sells it the search answers `result: no_matches`.
origin_typestringHow to read the code: `city` searches every airport of the city, `airport` only that one airport. Omit it and the platform applies one rule: a code that names a multi-airport city is searched as the city; every other code is searched as the airport. Untyped NYC, LON or PAR is the city; untyped JFK, LHR or CDG is the airport; and untyped LAX, MIA or LAS — codes a city shares with its main airport — is the CITY, so results can land at any airport of that city. If the user named the airport, send `airport`; if they named the city, omit the field. The provider decides which airports a city holds,
city · airport
destination_typestringHow to read the code: `city` searches every airport of the city, `airport` only that one airport. Omit it and the platform applies one rule: a code that names a multi-airport city is searched as the city; every other code is searched as the airport. Untyped NYC, LON or PAR is the city; untyped JFK, LHR or CDG is the airport; and untyped LAX, MIA or LAS — codes a city shares with its main airport — is the CITY, so results can land at any airport of that city. If the user named the airport, send `airport`; if they named the city, omit the field. The provider decides which airports a city holds,
city · airport
departure_datestringDeparture date, `YYYY-MM-DD`: the local date at `origin`. Required in search mode, with `origin` and `destination`; not allowed beside `offer_token`. A date that does not exist on the calendar (`2026-02-30`) is refused with 422 naming the field.
return_datestringReturn date, `YYYY-MM-DD`, on or after `departure_date` (a same-day return is valid). Sending it makes the search a round trip; see `trip_type`.
trip_typestring`oneway` or `roundtrip`. Omit it and `return_date` decides: present is a round trip, absent a one-way trip. `roundtrip` requires `return_date`, and `oneway` refuses it (422 naming `return_date`).
oneway · roundtrip
cabin_classstringOmit this field or send `null` to let the provider default the search to economy without applying a cabin filter. Send an explicit enum value to require each fare’s representative cabin to equal it. The representative cabin is the cabin on the longest flight segment; shorter connecting segments may use another cabin. One exception: a `business` search also takes `first` fares whose every flight is within the United States, Puerto Rico or the US Virgin Islands, because US airlines sell the premium cabin of a domestic flight as first and have no business cabin there; such fares keep `cabin_class
max_stopsintegerMaximum stops per leg: `0` non-stop (the way to ask for direct flights), `1` one connection, `2` two. Applies to every leg of the trip.
multi_farebooleanBranded fare ladder: several fares per itinerary (upsell options). Defaults to `true` when omitted; send `false` for a single fare per itinerary and a smaller response. An offer carries at most 10 fares, the cheapest fare of each cabin kept first; a provider that sells no fare ladder returns a single fare either way.
max_totalnumberDrop fares whose total price (all passengers) exceeds this cap, in `currency`, major units. A fare priced in another currency is usually converted to `currency` with the platform’s FX rate before the comparison, but not always: a provider whose first priced offer is already in `currency` drops its offers in other currencies as unverifiable instead of converting them. A fare whose currency cannot be converted is not returned.
include_carriersarrayKeep only itineraries marketed by these IATA carriers. Matching means every segment is marketed by a listed carrier (codeshares count by marketing carrier). When nothing matches, the search returns no offers with `result: no_matches`; the platform never widens to other carriers.
exclude_carriersarrayDrop itineraries marketed by these IATA carriers. Must not overlap `include_carriers`.
departure_time_rangeobjectInclusive local time-of-day window, 24-hour "HH:MM". Either bound may be omitted: only `earliest` means "at or after", only `latest` means "at or before".
arrival_time_rangeobjectInclusive local time-of-day window, 24-hour "HH:MM". Either bound may be omitted: only `earliest` means "at or after", only `latest` means "at or before".
return_departure_time_rangeobjectInclusive local time-of-day window, 24-hour "HH:MM". Either bound may be omitted: only `earliest` means "at or after", only `latest` means "at or before".
return_arrival_time_rangeobjectInclusive local time-of-day window, 24-hour "HH:MM". Either bound may be omitted: only `earliest` means "at or after", only `latest` means "at or before".
connection_time_min_minutesintegerShortest acceptable layover, in minutes, applied to every connection of every leg. Must not exceed `connection_time_max_minutes`. Conservative, like `refundable_only`: an itinerary with a connection whose times are unknown cannot be checked and is dropped.
connection_time_max_minutesintegerLongest acceptable layover, in minutes, applied to every connection of every leg. Conservative in the same way as `connection_time_min_minutes`: a connection whose times are unknown drops the itinerary.
max_total_duration_minutesintegerCap each leg’s door-to-door elapsed travel time, in minutes.
refundable_onlybooleanKeep only fares that can be cancelled before departure (with or without a fee). Conservative: a fare whose rules the platform cannot verify is DROPPED, so carriers that publish no rule data disappear under this filter. The filter reads the before-departure cancellation rules only; `is_refundable` on a returned fare is a wider reading of the same rules (it is `true` on a fare whose only decided rule allows cancellation after departure), so the flag is not this filter.
changeable_onlybooleanKeep only fares that allow a voluntary change. Conservative in the same way as `refundable_only`: unverifiable fares are dropped. The filter reads the before-departure change rules only; `is_changeable` on a returned fare is the wider reading `refundable_only` describes.
checked_bag_includedbooleanKeep only fares whose price already includes a checked bag on EVERY segment. Conservative, like `refundable_only`: a segment that states no allowance makes the fare unverifiable and it is dropped. The response flag of the same name is read from the first segment that states an allowance, not from every segment, so without this filter a fare flagged `checked_bag_included: true` can still lack a free bag on a later segment.
single_carrier_onlybooleanKeep only itineraries marketed end-to-end by one carrier.
via_airportsarrayRestrict connections to these airports: an itinerary qualifies only when EVERY connection is one of them. Non-stop itineraries have no connection to check and are kept. Some providers are asked for at most the first 9 listed airports per leg; the whole list is still applied to what they return.
exclude_via_airportsarrayBan connections at these airports. Must not overlap `via_airports`.
aircraft_typesarrayKeep only itineraries whose every segment flies one of these IATA equipment codes. Conservative, like `refundable_only`: a segment whose equipment is unknown makes the itinerary unverifiable and it is dropped, so a provider that reports no equipment (see `aircraft` on the segment) disappears under this filter entirely.
origin_alternate_airportsarrayADDITIONAL departure airports searched alongside `origin`. Widening only — the anchor in `origin` is always searched, so this can add results but never remove any. THE ANCHOR DECIDES RANKING AND TRUNCATION, which makes the two airports NOT interchangeable: measured on one route, anchor `JFK` with alternate `EWR` returned 15 JFK / 35 EWR, while anchor `EWR` with alternate `JFK` returned 2 JFK / 48 EWR — 13 itineraries differed between the two. Put the airport that matters most in `origin`. Works with an airport or a city anchor: `origin` NYC with `["BOS"]` searches New York's airports and Bosto
destination_alternate_airportsarrayADDITIONAL arrival airports searched alongside `destination`. Widening only — the anchor in `destination` is always searched, so this can add results but never remove any. THE ANCHOR DECIDES RANKING AND TRUNCATION, which makes the two airports NOT interchangeable the same way `origin_alternate_airports` describes: put the airport that matters most in `destination`. Works with an airport or a city anchor, as `origin_alternate_airports` describes. On a round trip the platform mirrors the list onto the return leg, so it also covers where the return departs from. Some providers search only the anc
nearby_airportsbooleanAlso search the alternate airports around each leg’s origin and destination. Widening: more results, not fewer.
same_connection_airport_onlybooleanKeep only itineraries whose connections leave from the same airport they arrived at (no cross-town transfer).
same_origin_airport_onlybooleanKeep only round trips that return to the airport the trip departed from. Round trip only: on a one-way search it is accepted and has no effect.
same_turnaround_airport_onlybooleanKeep only round trips whose return departs from the airport the outbound arrived at. Round trip only: on a one-way search it is accepted and has no effect.
limitintegerTOTAL number of flights to return (1–300), not a per-page size: `limit: 5` returns at most five flights. Search mode only. Omit to let the platform choose: the cheapest flight plus up to 100 alternatives, so up to 101 flights. Applied after the cross-provider merge and sort, so it only trims the returned set — the providers still bound the real count.
max_wait_secondsintegerSearch mode only. The longest the search waits for results, in seconds (5–55). When set, the search stops waiting this many seconds after the request reaches and answers with the offers found by then, which may be fewer than a search without it returns. When none had been found, `offers` is empty, `result` is `timed_out` and `instruction` says how to search again. Omit it to wait for every result.
adultsintegerAdult travelers (12+). At most 9 travellers who need a seat: `adults + children` ≤ 9. Lap infants are not counted.
childrenintegerChild travelers (2–11). At most 9 travellers who need a seat: `adults + children` ≤ 9. Lap infants are not counted.
infantsintegerInfant travelers (under 2), traveling on an adult’s lap. Seated infants (own seat) are not supported.
currencystringISO 4217 currency code, case-insensitive (`eur` is `EUR`): prices come back with the upper-case code and a `display`. Defaults to USD. A currency the platform cannot price in is refused with 400.
localestringoffer_tokenstringPrice-check mode: re-price one known offer instead of searching a route. Route and filter fields are not allowed beside it (422); the passenger counts and `currency` are. Two kinds of token behave differently. A cached-itinerary `offer_token` from `/flights/calendar`, `/flights/dates` or `/flights/destinations` is re-shopped LIVE on its route and dates with no cabin, stop or carrier constraint: `offers[0]` is the cheapest live offer with the same flights and cabin when one exists, `exact_match_found` says whether it did, and up to 100 alternatives follow. An `offer_id` from an earlier `/flight
