Call it
curl https://api.peume.com/v1/call/find-lowest-fares \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"origins": [],
"trip_type": "oneway"
}
}'const res = await fetch("https://api.peume.com/v1/call/find-lowest-fares", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"origins": [],
"trip_type": "oneway"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/find-lowest-fares",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"origins": [],
"trip_type": "oneway"
}
},
)
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: find-lowest-fares.
Parameters
originsRequiredarrayIATA city or airport codes. See `origin_type` for how an untyped code is read.
destinationsarrayIATA city or airport codes. Omit for global discovery (`/flights/destinations`) or to scan every destination from the origins. See `destination_type` for how an untyped code is read.
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.
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.
city · airport
departure_datesarraydeparture_date_rangesarrayreturn_datesarrayreturn_date_rangesarraystay_daysintegerstay_days_rangeobjecttrip_typeRequiredstringoneway · roundtrip
cabin_classstringeconomy · premium_economy · business · first
accuracystringHow strict the freshness check on cached fares is. `standard` (default) returns fares estimated to be at least 80% likely to still be available at the cached price; `high` raises that to 95%, so fewer fares come back.
standard · high
include_carriersarrayKeep only itineraries ticketed by these IATA carriers (the validating carrier, which issues the ticket). A codeshare segment marketed or operated by another airline does not change the match. Unlike `/flights/search`, which matches the marketing carrier of every segment.
exclude_carriersarrayDrop itineraries ticketed by these IATA carriers (the validating carrier). Must not overlap `include_carriers`.
max_totalnumberCaps the cached fare's total. Cached fares are priced for one adult.
currencystringlocalestringlimitintegerWhat `limit` counts depends on the route; 1 to 100, default 20. On `/flights/calendar`, the maximum number of itineraries returned across the entire matching date range after `sort_by` is applied. This is a global result cap, not one itinerary per date pair: with the default `sort_by: lowest`, `limit: N` returns the cheapest N itineraries overall, so some matching date pairs may be absent. On `/flights/dates`, the maximum number of date pairs, each answered with its cheapest itinerary and spread across the requested departure window.
sort_bystringThe order of the results. `lowest`, the only order today, is cheapest first by the cached one-adult total; on `/flights/destinations` it orders destinations by their cheapest itinerary. Omit it for the same order.
lowest
max_stopsintegerMaximum stops per leg: `0` non-stop, `1` one connection, `2` two. Applies to every leg of the trip. `1` and `2` need at least one code in `destinations`.
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".
origin_radius_kmnumberAlso search every airport within this many kilometres (straight-line distance) of each origin code: an airport code is measured from that airport, a city code from the city. Widening only: the origins are always searched as well. Greater than 0, at most 500.
destination_radius_kmnumberAlso search every airport within this many kilometres of each destination code. Same rules as `origin_radius_km`; needs at least one code in `destinations`.
connection_time_min_minutesintegerShortest acceptable layover, in minutes, applied to every connection of every leg; a non-stop leg passes. Must not exceed `connection_time_max_minutes`. An itinerary whose connection times cannot be read is dropped. With either bound set, a response can hold fewer than `limit` itineraries even when more match.
connection_time_max_minutesintegerLongest acceptable layover, in minutes, applied to every connection of every leg; a non-stop leg passes. Same rules as `connection_time_min_minutes`.
page_tokenstringReads the next page: the `next_page_token` of the previous response, sent with the same request (`limit` may change). The page starts right after the last itinerary of the previous page, so no itinerary is skipped when cached fares expire between pages. An itinerary whose price changes between two pages can appear on both or on neither, so deduplicate by `offer_token`. Keep reading until a response has no `next_page_token`.
