Example Requests

These examples show how to send Google Flights API requests for flight searches and raw HTML responses.

In this example, we send a simple Google Flights request searching for round-trip flights from New York to Tel Aviv. The request specifies:

  • origin and destination

  • departure and return dates

  • number of adult passengers

Request

curl -X GET "https://serp-api.netnut.io/search?engine=google_flights&flightFrom=ny&flightTo=tel-aviv&departureTime=2026-06-01&returnTime=2026-06-05&adults=2" \
  -u "username:password"

Example Response

Example shape - your actual jobId, timestamps, and flight data will vary.

{
  "url": "https://www.google.com/travel/flights/search?hl=en&gl=US&tfs=CBwQAhor...",
  "general": {
    "searchEngine": "google_flights",
    "language": "en",
    "device": "desktop",
    "searchType": "text",
    "pageTitle": "New York to Tel Aviv | Google Flights",
    "timestamp": "2026-06-01T16:02:22.487780767Z",
    "render": false
  },
  "input": {
    "originalUrl": "https://www.google.com/travel/flights/search?hl=en&gl=US&tfs=CBwQAhor...",
    "jobId": "203e0593-8bfd-49ea-a75c-8136da9d04b5"
  },
  "flights": [
    {
      "departure_time": "8:05 AM",
      "total_duration": "6 hr 15 min",
      "stops": 0,
      "total_emissions": "277 kg CO2e",
      "price": "$468",
      "price_raw": 468,
      "legs": [
        {
          "departure_airport": {
            "name": "John F. Kennedy International Airport",
            "id": "JFK",
            "time": "8:05 AM"
          },
          "arrival_airport": {
            "name": "Ben Gurion International Airport",
            "id": "TLV",
            "time": "3:20 AM+1"
          },
          "duration": "11 hr 15 min",
          "overnight": true,
          "airplane": "Boeing 777",
          "airline": "American",
          "airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/AA.png",
          "travel_class": "Economy",
          "flight_number": "AA 255",
          "amenities": [
            "Average legroom (31 in)",
            "Wi-Fi for a fee",
            "On-demand video",
            "Emissions estimate: 277 kg CO2e",
            "Contrail warming potential: Low"
          ]
        }
      ],
      "rank": 1
    }
  ],
  "pagesProcessed": 1
}

In this response:

  • url is the final Google Flights search URL used to retrieve the results.

  • general contains metadata about the request, such as language, device, page title, and timestamp.

  • input contains the original request URL and the internal jobId.

  • organic is always returned as an empty array.

  • flights contains the parsed flight results.

  • Each flight object includes fields such as departure_time, total_duration, stops, price, total_emissions, legs, and rank.

  • Each leg object includes departure and arrival airport details, airline, flight number, aircraft type, cabin class, and amenities.


Request with rawHtml=1

In this example, we request the normal parsed JSON response and the raw HTML returned from Google Flights. This mode is useful when you want the structured flight data while also keeping access to the original page source for debugging, validation, or custom parsing.

Request

Example Response

Example shape — shortened for readability. Your actual response may include more flight results and a much longer HTML string.

In this response, the response includes the regular parsed JSON fields:

  • url

  • general

  • input

  • organic

  • flights

  • pagesProcessed

In addition, it includes:

  • html — the raw HTML source of the Google Flights page

This mode is useful for:

  • Validating parsed results against the original source

  • Storing both parsed data and page source

  • Custom downstream extraction workflows


Request with rawHtml=2

In this example, we request only the raw HTML of the Google Flights page. This mode is useful when you do not need the parsed JSON response and only want the page source.

Request

Example Response

In this response:

  • The API returns only the raw HTML.

  • No parsed JSON fields such as general, input, or flights are returned.

This mode is useful for:

  • Custom parsers

  • Raw source collection

  • Debugging page output without parsed normalization

Last updated