Call it
curl https://api.peume.com/v1/call/google-search-airfares \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"hl": "your hl",
"bags": "your bags"
}
}'const res = await fetch("https://api.peume.com/v1/call/google-search-airfares", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"hl": "your hl",
"bags": "your bags"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/google-search-airfares",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"hl": "your hl",
"bags": "your bags"
}
},
)
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: google-search-airfares.
Parameters
hlstringThe language to use for the Google Flights search. It's a two or three-letter language code. (e.g., `en` for English, `es` for Spanish, or `fr` for French), optionally followed by a two-letter or three-digit region code (e.g., `en-gb` for British English, or `es-419` for Latin American Spanish).
bagsstringThe number of carry-on bags. Default to `0`. Parameter should not exceed the total number of passengers with carry-on bag allowance (`adults`, `children` and `infants_in_seat`).
arrival_idstringThe arrival airport code or location kgmid. An airport code is an uppercase 3-letter code. You can search for it on Google Flights or IATA. For example, `CDG` is Paris Charles de Gaulle Airport and `AUS` is Austin-Bergstrom International Airport. A location kgmid is a string that starts with `/m/` or `/g/`. You can search for a location on Wikidata and use its "Freebase ID" as the location kgmid. For example, `/m/0vzm` is the location kgmid for Austin, TX. You can specify multiple arrival airports by separating them with a comma. For example, `CDG,ORY,/m/04jpl`.
adultsstringThe number of adults. Default to 1.
sort_bystringThe sorting order of the results. Available options: `1` - Top flights (default) `2` - Price `3` - Departure time `4` - Arrival time `5` - Duration `6` - Emissions
typestringThe type of the flights. Available options: `1` - Round trip (default) `2` - One way `3` - Multi-city When this parameter is set to `3`, use `multi_city_json` to set the flight information. To obtain the returning flight information for Round Trip `(1)`, you need to make another request using a departure_token.
outbound_datestringThe outbound date. The format is YYYY-MM-DD. e.g. `2026-12-02` Parameter is required when `type` is `1` (Round trip) or `2` (One way), unless `selected_flights_json` is used. Parameter can't be used when `type` is `3` (Multi-city). Use `date` inside `multi_city_json` instead.
infants_in_seatstringThe number of infants in seat. Default to 0.
include_airlinesstringThe airline codes to be included. Split multiple airlines with comma. Each airline code should be a 2-character IATA code consisting of either two uppercase letters or one uppercase letter and one digit. You can search for airline codes on IATA. For example, `UA` is United Airlines. Additionally, alliances can be also included here: `STAR_ALLIANCE` - Star Alliance `SKYTEAM` - SkyTeam `ONEWORLD` - Oneworld `exclude_airlines` and `include_airlines` parameters can't be used together.
childrenstringThe number of children. Default to 0.
currencystringThe currency of the returned prices. Default to `USD`.
exclude_connsstringThe connecting airport codes to be excluded. An airport ID is an uppercase 3-letter code. You can search for it on Google Flights or IATA. For example, `CDG` is Paris Charles de Gaulle Airport and `AUS` is Austin-Bergstrom International Airport. You can also combine multiple Airports by joining them with a comma (`value` + `,` + `value`; eg: `CDG,AUS`).
emissionsstringThe emission level of the flight. Available options: `1` - Less emissions only
multi_city_jsonstringThe flight information for multi-city flights. It's a JSON string containing multiple flight information objects. Each object should contain the following fields: `departure_id` - The departure airport code or location kgmid. The format is the same as the main departure_id parameter. `arrival_id` - The arrival airport code or location kgmid. The format is the same as the main arrival_id parameter. `date` - Flight date. The format is the same as the outbound_date parameter. `times` - Time range for the flight. The format is the same as the outbound_times parameter. This parameter is optional.
outbound_timesstringThe outbound times range. It's a string containing two (for departure only) or four (for departure and arrival) comma-separated numbers. Each number represents the beginning of an hour. For example: `4,18`: 4:00 AM - 7:00 PM departure `0,18`: 12:00 AM - 7:00 PM departure `19,23`: 7:00 PM - 12:00 AM departure `4,18,3,19`: 4:00 AM - 7:00 PM departure, 3:00 AM - 8:00 PM arrival `0,23,3,19`: unrestricted departure, 3:00 AM - 8:00 PM arrival
booking_tokenstringGet booking options for the selected flights. Find this token in the flight results. It cannot be used together with `departure_token`. When using this token, parameters related to date and parameters inside "Advanced filters" section won't affect the result.
departure_idstringThe departure airport code or location kgmid. An airport code is an uppercase 3-letter code. You can search for it on Google Flights or IATA. For example, `CDG` is Paris Charles de Gaulle Airport and `AUS` is Austin-Bergstrom International Airport. A location kgmid is a string that starts with `/m/` or `/g/`. You can search for a location on Wikidata and use its "Freebase ID" as the location kgmid. For example, `/m/0vzm` is the location kgmid for Austin, TX. You can specify multiple departure airports by separating them with a comma. For example, `CDG,ORY,/m/04jpl`.
departure_tokenstringSelect the flight and get returning flights (for Round trip) or flights for the next leg of itinerary (for Multi-city). Find this token in the departure flight results. It cannot be used together with `booking_token`.
show_hiddenstringSet to `true` to include the hidden flight results. This is equivalent to clicking 'View more flights' on Google Flights. Default to `false`.
glstringThe country to use for the Google Flights search. It's a two-letter country code. (e.g., `us` for the United States, `uk` for United Kingdom, or `fr` for France)
deep_searchstringSet to `true` to enable deep search, which may yield better results but with a longer response time. Deep search results are identical to those found on Google Flights pages in the browser. By default, this option is set to `false` for performance reasons.
infants_on_lapstringThe number of infants on lap. Default to 0.
exclude_basicstringSet to `true` to exclude basic results. Resulting fares will have free seat selection and carry on bags. Default to `false`. As of now, this filter only works for domestic flights in the US. Parameter can only be used when `gl` is`us` and `travel_class` is`1`
max_durationstringThe maximum flight duration, in minutes. For example, specify `1500` for 25 hours. If your search returns no results, try increasing your `max_duration` by up to `200` minutes to account for route-specific scheduling variances.
layover_durationstringThe layover duration, in minutes. It's a string containing two comma-separated numbers. For example, specify `90,330` for 1 hr 30 min - 5 hr 30 min.
max_pricestringThe maximum ticket price. Default to unlimited.
selected_flights_jsonstringPins the itinerary to specific flights, segment by segment. It's a JSON object with an `outbound` key (required) and a `return` key (required for round-trip, forbidden for one-way). Each value is an ordered array of flight segment objects, each containing: `flight_number` - IATA flight number (2-character airline code + 1–4 digits, e.g. `BA591`). `departure_id` - 3-letter IATA airport code for that segment's departure. `arrival_id` - 3-letter IATA airport code for that segment's arrival. `date` - Departure date of that segment, `YYYY-MM-DD`. Within a leg, each segment's `departure_id` must equ
exclude_airlinesstringThe airline codes to be excluded. Split multiple airlines with comma. Each airline code should be a 2-character IATA code consisting of either two uppercase letters or one uppercase letter and one digit. You can search for airline codes on IATA. For example, `UA` is United Airlines. Additionally, alliances can be also included here: `STAR_ALLIANCE` - Star Alliance `SKYTEAM` - SkyTeam `ONEWORLD` - Oneworld `exclude_airlines` and `include_airlines` parameters can't be used together.
stopsstringThe number of stops during the flight. Available options: `0` - Any number of stops (default) `1` - Nonstop only `2` - 1 stop or fewer `3` - 2 stops or fewer
travel_classstringThe travel class. Available options: `1` - Economy (default) `2` - Premium economy `3` - Business `4` - First
json_restrictorstringThe fields you want to include in the output, reducing payload size for faster response. See the JSON Restrictor documentation for more details.
return_datestringThe return date. The format is YYYY-MM-DD. e.g. `2026-12-08` Parameter is required when `type` is `1` (Round trip), unless `selected_flights_json` is used. Parameter can't be used when `type` is `2` (One way) or `3` (Multi-city).
return_timesstringThe return times range. It's a string containing two (for departure only) or four (for departure and arrival) comma-separated numbers. Each number represents the beginning of an hour. For example: `4,18`: 4:00 AM - 7:00 PM departure `0,18`: 12:00 AM - 7:00 PM departure `19,23`: 7:00 PM - 12:00 AM departure `4,18,3,19`: 4:00 AM - 7:00 PM departure, 3:00 AM - 8:00 PM arrival `0,23,3,19`: unrestricted departure, 3:00 AM - 8:00 PM arrival Parameter should only be used when `type` parameter is set to: `1` (Round trip)
