Google Flights

This document provides information about the Google Flights API and the available parameters.

Google Flights API

The Google Flights API enables retrieval of Google Flights search results and returns structured JSON output. It supports flight search queries with filters such as departure and return dates, origin and destination, number of passengers, cabin class, number of stops, and more.


API Setup

Endpoint

https://serp-api.netnut.io/search

Authentication

Use HTTP Basic Authentication:

Authorization: Basic <base64(username:password)>

Where <base64(username:password)> is the Base64-encoded string of your NetNut credentials.


Request Format

The request is sent as a GET request. All parameters are passed directly in the URL query string.

Example Request

https://serp-api.netnut.io/search?engine=google_flights&flightFrom=ny&flightTo=lax&departureTime=2026-06-01&returnTime=2026-06-05&adults=1&hl=en&gl=us

Request Parameters

Parameter
Type
Required
Description

engine

string

Yes

Must be set to google_flights

flightFrom

string

Yes

Origin location. Accepts city name, airport code, or region (e.g., ny, JFK, New York)

flightTo

string

Yes

Destination location. Accepts city name, airport code, or region (e.g., lax, LAX, Los Angeles)

departureTime

string

Yes

Departure date in YYYY-MM-DD format

returnTime

string

No

Return date in YYYY-MM-DD format. Omit for one-way searches

adults

integer

No

Number of adult passengers. Defaults to 1

children

integer

No

Number of child passengers (ages 2-11). Defaults to 0

infants

integer

No

Number of lap infant passengers (under 2). Defaults to 0

travelClass

integer

No

Cabin class. 1 = Economy (default), 2 = Premium Economy, 3 = Business, 4 = First

stops

integer

No

Maximum number of stops. 0 = Nonstop only, 1 = 1 stop or fewer, 2 = 2 stops or fewer. Omit to return all results

currency

string

No

Currency code for prices (e.g., USD, EUR, GBP). Defaults to USD

hl

string

No

Language code for results (e.g., en, es, fr). Defaults to en

gl

string

No

Country code for localization (e.g., us, gb). Defaults to us

rawHtml

integer

No

1 = Return both parsed JSON and raw HTML. 2 = Return raw HTML only. Omit for JSON only


Code Examples


Response Format

The Google Flights API returns structured JSON. No HTML is returned by default. When rawHtml=1, the response includes both the parsed JSON and the raw HTML. When rawHtml=2, the response returns only the raw HTML.


Example JSON Response

Last updated