← Back to marketplace

Google Flights

Fast JSON API for Google Flights - one-way and round-trip flight search with stops, airlines, price, time and duration filters, prices, schedules, layovers, aircraft and emissions, price insights with price history, and airport and city search.

travel
by Mark89 endpoints100% uptime90ms avg

Includes 100 free calls per month

After the free quota, standard per-request pricing applies via x402 (USDC on Base).

Endpoints

GET/v1/flights/price-insights
$0.0010/req

Returns the price insights of a route on a date: the lowest price, whether it is low, typical or high, the typical price range and the price history of the cheapest flight over the past two months.

Request schema

departure_idstringrequired

Where from: an airport code (e.g. "JFK") or a city id (e.g. "/m/02_286" for New York), or up to 7 of them separated by commas. Use the /search/locations endpoint to list valid values.

arrival_idstringrequired

Where to: an airport code (e.g. "LAX") or a city id, or up to 7 of them separated by commas. Use the /search/locations endpoint to list valid values.

outbound_datestringrequired

Departure date, YYYY-MM-DD.

return_datestring

Optional return date, YYYY-MM-DD, for a round trip.

adultsstring

Optional number of adults, 1 to 9 (defaults to 1).

travel_classstring

Optional travel class (defaults to "economy"). Use the /general/travel-classes endpoint to list valid values.

stopsstring

Optional limit on the number of stops (defaults to "any"). Use the /general/stops endpoint to list valid values.

currencystring

Optional currency of the prices (defaults to "USD"). Use the /general/currencies endpoint to list valid values.

countrystring

Optional country the search is made from (defaults to "US"). Use the /general/countries endpoint to list valid values.

Response schema

lowest_priceinteger
price_levelstring
typical_price_rangeobject
price_historyarray
GET/v1/flights/search
$0.0010/req

Searches one-way and round-trip flights between two airports or cities on a date. Returns the best flights and the other flights, each with its price, departure and arrival, total duration, stops, layovers, every flight with airline, flight number, aircraft, legroom and emissions, plus the price insights of the route (lowest price, price level, typical price range and price history), and the airlines, alliances and connecting airports that can be filtered by, with the price range of the route. The price of an outbound flight of a round trip is that of the whole round trip.

Request schema

departure_idstringrequired

Where from: an airport code (e.g. "JFK") or a city id (e.g. "/m/02_286" for New York), or up to 7 of them separated by commas (e.g. "JFK,EWR"). Use the /search/locations endpoint to list valid values.

arrival_idstringrequired

Where to: an airport code (e.g. "LAX") or a city id (e.g. "/m/030qb3t" for Los Angeles), or up to 7 of them separated by commas. Use the /search/locations endpoint to list valid values.

outbound_datestringrequired

Departure date, YYYY-MM-DD.

return_datestring

Optional return date, YYYY-MM-DD, for a round trip. Leave it out for a one-way trip.

adultsstring

Optional number of adults, 1 to 9 (defaults to 1).

childrenstring

Optional number of children aged 2 to 11 (defaults to 0).

infants_in_seatstring

Optional number of infants under 2 in their own seat (defaults to 0).

infants_on_lapstring

Optional number of infants under 2 on a lap, at most one per adult (defaults to 0).

travel_classstring

Optional travel class (defaults to "economy"). Use the /general/travel-classes endpoint to list valid values.

stopsstring

Optional limit on the number of stops (defaults to "any"). Use the /general/stops endpoint to list valid values.

airlinesstring

Optional comma-separated airline codes (e.g. "DL,AA") or alliances ("ONEWORLD", "SKYTEAM", "STAR_ALLIANCE") to fly with. The /flights/search endpoint lists the airlines of a route.

max_pricestring

Optional highest price, in the currency asked for.

max_durationstring

Optional longest total duration of a flight, in minutes.

outbound_timesstring

Optional departure hours of the outbound flight as "from,to" (e.g. "6,12" leaves between 6:00 and 12:59), optionally followed by arrival hours (e.g. "6,12,18,23"); hours are 0 to 23.

return_timesstring

Optional departure hours of the return flight, in the same format as "outbound_times".

sortstring

Optional sort order (defaults to "best"). Use the /general/sort-orders endpoint to list valid values.

currencystring

Optional currency of the prices (defaults to "USD"). Use the /general/currencies endpoint to list valid values.

languagestring

Optional language of the names (defaults to "en"). Use the /general/languages endpoint to list valid values.

countrystring

Optional country the search is made from, which decides the offers and sellers (defaults to "US"). Use the /general/countries endpoint to list valid values.

Response schema

best_flightsarray
other_flightsarray
price_insightsobject
airlinesarray
alliancesarray
connecting_airportsarray
price_rangeobject
GET/v1/general/countries
$0.0010/req

Lists the countries accepted by the "country" parameter, each with its code and name.

Request schema

languagestring

Optional language of the names (defaults to "en").

Response schema

{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "code": {
        "type": "string"
      },
      "name": {
        "type": "string"
      }
    }
  }
}
GET/v1/general/currencies
$0.0010/req

Lists the currencies accepted by the "currency" parameter, each with its code and name.

Request schema

languagestring

Optional language of the names (defaults to "en").

Response schema

{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "code": {
        "type": "string"
      },
      "name": {
        "type": "string"
      }
    }
  }
}
GET/v1/general/languages
$0.0010/req

Lists the languages accepted by the "language" parameter, each with its code, English name and native name.

Request schema

{
  "type": "object",
  "properties": {}
}

Response schema

{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "code": {
        "type": "string"
      },
      "name": {
        "type": "string"
      },
      "native_name": {
        "type": "string"
      }
    }
  }
}
GET/v1/general/sort-orders
$0.0010/req

Lists the values accepted by the "sort" parameter of the flight searches.

Request schema

{
  "type": "object",
  "properties": {}
}

Response schema

{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "value": {
        "type": "string"
      },
      "label": {
        "type": "string"
      }
    }
  }
}
GET/v1/general/stops
$0.0010/req

Lists the values accepted by the "stops" parameter.

Request schema

{
  "type": "object",
  "properties": {}
}

Response schema

{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "value": {
        "type": "string"
      },
      "label": {
        "type": "string"
      }
    }
  }
}
GET/v1/general/travel-classes
$0.0010/req

Lists the values accepted by the "travel_class" parameter.

Request schema

{
  "type": "object",
  "properties": {}
}

Response schema

{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "value": {
        "type": "string"
      },
      "label": {
        "type": "string"
      }
    }
  }
}
GET/v1/search/locations
$0.0010/req

Searches airports, cities and regions by name or code, as the "Where from?" and "Where to?" fields of Google Flights suggest them. Each result has its type and the id the other endpoints take: an airport its IATA code, a city and a region their id. A city comes with its airports and their distance.

Request schema

querystringrequired

Name or code of an airport, city, country or region (e.g. "new york", "LHR" or "italy").

languagestring

Optional language of the names (defaults to "en"). Use the /general/languages endpoint to list valid values.

Response schema

{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string"
      },
      "type": {
        "type": "string"
      },
      "name": {
        "type": "string"
      },
      "city": {
        "type": "string"
      },
      "description": {
        "type": "string"
      },
      "city_id": {
        "type": "string"
      },
      "airports": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "type": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "city": {
              "type": "string"
            },
            "description": {
              "type": "null"
            },
            "city_id": {
              "type": "string"
            },
            "distance": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}

Quick start

Easiest way: the APIHub CLI. Credits cover x402, no wallet needed.

# install and set up once
npx @apihubio/cli register
npx @apihubio/cli topup 10

# call this service
npx @apihubio/cli call -X GET "https://proxy.apihub.io/googleflights/v1/flights/price-insights" \
  -d '{"departure_id":"JFK","arrival_id":"LAX","outbound_date":"2027-03-10","return_date":"2027-03-17","adults":"1","travel_class":"economy","stops":"any","currency":"USD","country":"US"}'

Or call the proxy directly (curl / any HTTP client):

curl https://proxy.apihub.io/googleflights/v1/flights/price-insights \
  -H "Authorization: Bearer ahk_your_key"

# If credits available: charged automatically, returns 200
# Otherwise: returns 402 (pay via @x402/fetch or top up credits)

Pricing calculator

Estimate your monthly cost for Google Flights.

GET /v1/flights/price-insights$0.0010/req
-
GET /v1/flights/search$0.0010/req
-
GET /v1/general/countries$0.0010/req
-
GET /v1/general/currencies$0.0010/req
-
GET /v1/general/languages$0.0010/req
-
GET /v1/general/sort-orders$0.0010/req
-
GET /v1/general/stops$0.0010/req
-
GET /v1/general/travel-classes$0.0010/req
-
GET /v1/search/locations$0.0010/req
-