Back to APIs
GET

Google Flights API

Search flights, prices, and availability from Google Flights.

Endpoint

GET https://api.serpii.com/v1/google/flights

Parameters

NameTypeRequiredDescription
departurestring
Required
Departure airport code
arrivalstring
Required
Arrival airport code
datestring
Required
Flight date (YYYY-MM-DD)
return_datestring
Optional
Return date for round trip
adultsnumber
Optional
Number of adult passengers

Code Examples

cURL

curl -X GET "https://api.serpii.com/v1/google/flights?departure=YOUR_VALUE&arrival=YOUR_VALUE&date=YOUR_VALUE" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Node.js

import { Serpii } from 'serpii';

const serpii = new Serpii('YOUR_API_KEY');

const response = await serpii.google_flights({
  departure: 'YOUR_VALUE',
  arrival: 'YOUR_VALUE',
  date: 'YOUR_VALUE',
});

console.log(response);

Python

from serpii import Serpii

client = Serpii('YOUR_API_KEY')

response = client.google_flights(
    departure='YOUR_VALUE',
    arrival='YOUR_VALUE',
    date='YOUR_VALUE',
)

print(response)

Example Response

{
  "success": true,
  "query": "example query",
  "intent": "informational",
  "sentiment": "neutral",
  "clusters": ["topic1", "topic2"],
  "entities": [
    {"name": "Entity Name", "type": "EntityType"}
  ],
  "organic_results": [
    {
      "position": 1,
      "title": "Result Title",
      "url": "https://example.com",
      "snippet": "Result snippet text...",
      "domain": "example.com"
    }
  ],
  "related_searches": ["related query 1", "related query 2"],
  "credits_used": 1,
  "credits_remaining": 4999
}