Google Flights Scraper API
Scrape Google Flights with a JSON API. This repo has working Python examples for DataGuru’s Google Flights scraper APIs: Google Flights Details and Google Flights Search.
DataGuru runs the scraping, proxies, retries and parsing, and returns clean JSON. You pay only for successful requests, from $0.0012 per request, out of a prepaid balance: no subscription. New accounts get $1.00 of free credit.
Google Flights APIs
Quick start
- Create a free account and an API key at dashboard.dataguru.cc.
- Install and run:
git clone https://github.com/dataguru-cc/google-flights-scraper-api.git
cd google-flights-scraper-api
pip install -r requirements.txt
export DATAGURU_API_KEY="your key"
python examples/sdk_example.py google-flights-details
Examples
Every example covers all 2 Google Flights APIs. Pass an API name to run just one; with no name each script runs them all, and each call is billed at the price above.
All requests use the header Authorization: Api-Key YOUR_API_KEY. Errors return {"success": false, "error": {"code", "message", "request_id"}}, with HTTP 402 when the balance runs out and 429 (with Retry-After) when rate limited. Failed requests are not charged.
API reference
Google Flights Details
Get specific flight details, airline contacts, emissions, and layover schedules on Google Flights.
| Parameter |
Type |
Required |
Description |
date |
string |
no |
Departure date (YYYY-MM-DD or today) Default: today. |
destination |
string |
yes |
Arrival city or airport code |
flight_or_airline |
string |
yes |
Airline name or flight identifier, e.g. Emirates |
origin |
string |
yes |
Departure city or airport code |
Response fields: flight_query, origin, origin_hub, destination, destination_hub, date, url, total_matched, message, flight_details, matched_flights, error, plus _metadata
curl -X POST "https://api.dataguru.cc/api/v1/google-flights/details" \
-H "Authorization: Api-Key $DATAGURU_API_KEY" \
-H "Content-Type: application/json" \
-d '{"flight_or_airline": "Emirates", "origin": "Islamabad", "destination": "Dubai"}'
Response schema
Values are type placeholders from the API’s published schema, not real data.
{
"flight_query": "string",
"origin": "string",
"origin_hub": "string",
"destination": "string",
"destination_hub": "string",
"date": "2026-01-01T12:00:00Z",
"url": "https://example.com/...",
"total_matched": 0,
"message": "string",
"flight_details": {},
"matched_flights": [
{
"airline": "string",
"price": "string",
"departure_airport": "string",
"departure_iata": "string",
"departure_time": "string",
"departure_date": "2026-01-01T12:00:00Z",
"arrival_airport": "string",
"arrival_iata": "string",
"arrival_time": "string",
"arrival_date": "2026-01-01T12:00:00Z",
"duration": "string",
"stops": "string",
"layovers": [
"string"
],
"delay": "string",
"emissions": "string",
"summary": "string",
"booking_contact": {
"airline": "string",
"official_website": "https://example.com/...",
"booking_url": "https://example.com/...",
"customer_support": "string"
}
}
],
"error": "string",
"_metadata": {
"request_id": "3f6c1a2e-8b4d-4c1e-9a7f-2d5e6b7c8d9e",
"execution_time_ms": 842,
"endpoint": "Google Flights Details",
"mode": "live",
"format": "json",
"timestamp": "2026-01-01T12:00:00+00:00"
}
}
Google Flights Search
Search flights between origin and destination on Google Flights with prices, airlines, schedules, and duration.
| Parameter |
Type |
Required |
Description |
date |
string |
no |
Flight departure date (YYYY-MM-DD or today/tomorrow) Default: today. |
destination |
string |
yes |
Arrival city or IATA airport code, e.g. Dubai, DXB, LHR |
origin |
string |
yes |
Departure city or IATA airport code, e.g. Islamabad, ISB, JFK |
Response fields: origin, origin_hub, destination, destination_hub, date, url, total_flights, message, flights, error, plus _metadata
curl -X POST "https://api.dataguru.cc/api/v1/google-flights/search" \
-H "Authorization: Api-Key $DATAGURU_API_KEY" \
-H "Content-Type: application/json" \
-d '{"destination": "Dubai", "origin": "Islamabad"}'
Response schema
Values are type placeholders from the API’s published schema, not real data.
{
"origin": "string",
"origin_hub": "string",
"destination": "string",
"destination_hub": "string",
"date": "2026-01-01T12:00:00Z",
"url": "https://example.com/...",
"total_flights": 0,
"message": "string",
"flights": [
{
"airline": "string",
"price": "string",
"departure_airport": "string",
"departure_iata": "string",
"departure_time": "string",
"departure_date": "2026-01-01T12:00:00Z",
"arrival_airport": "string",
"arrival_iata": "string",
"arrival_time": "string",
"arrival_date": "2026-01-01T12:00:00Z",
"duration": "string",
"stops": "string",
"layovers": [
"string"
],
"delay": "string",
"emissions": "string",
"summary": "string",
"booking_contact": {
"airline": "string",
"official_website": "https://example.com/...",
"booking_url": "https://example.com/...",
"customer_support": "string"
}
}
],
"error": "string",
"_metadata": {
"request_id": "3f6c1a2e-8b4d-4c1e-9a7f-2d5e6b7c8d9e",
"execution_time_ms": 842,
"endpoint": "Google Flights Search",
"mode": "live",
"format": "json",
"timestamp": "2026-01-01T12:00:00+00:00"
}
}
More
- Python SDK and examples for all DataGuru APIs: github.com/dataguru-cc/dataguru-python (docs)
- Every API, with a live playground: https://dataguru.cc/apis/
- Use DataGuru from Claude, ChatGPT or Cursor through the MCP server: https://dataguru.cc/mcp/
- Run thousands of inputs from a CSV at half price with batch jobs: https://dataguru.cc/documentation/
- Other scraper APIs: 1688, Airbnb, Alibaba, AliExpress, Amazon, Apple App Store, arXiv, ASOS, Best Buy, Booking.com, Brave Search, CA State Bar, Capterra, CoinGecko, CoinMarketCap, Companies House, Costco, CourtListener, Crunchbase, Discord, DoorDash, eBay, Etsy, Expedia, Fiverr, Flipkart, GitHub, Glassdoor, Google Patents, Google Play, Google Scholar, Google Search, Grubhub, Home Depot, Hotels.com, Instagram, Investing.com, Justia, Kayak, Kick, Lazada, LinkedIn, MarketWatch, Mercado Libre, Monster, OpenCorporates, OpenTable, PACER, PitchBook, Product Hunt, PubMed, Reddit, Redfin, Resy, Rightmove, SEC EDGAR, Seeking Alpha, Shopee, Skyscanner, Stack Overflow, Target, TikTok, TradingView, TripAdvisor, Trulia, TrustRadius, Twitch, Uber Eats, Upwork, Vrbo, Walmart, Wayfair, X (Twitter), Yahoo Finance, YouTube, Zillow, ZoomInfo, Zoopla
License
The example code is MIT licensed. Use of the DataGuru API is subject to the terms of service.
评论