{"id":28998705,"url":"https://github.com/luminati-io/google-flights-api","last_synced_at":"2025-07-12T07:04:24.540Z","repository":{"id":283783966,"uuid":"951943399","full_name":"luminati-io/google-flights-api","owner":"luminati-io","description":"Real-time flight data from Google Flights using a free scraper or Bright Data’s high-volume Google Flights Scraper API for reliable, scalable data collection.","archived":false,"fork":false,"pushed_at":"2025-03-20T13:50:38.000Z","size":1933,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-25T07:09:46.549Z","etag":null,"topics":["google-flights-api","google-flights-scraper","google-scraper","html","python","python-web-scraper","web-scraper"],"latest_commit_sha":null,"homepage":"https://brightdata.com/products/web-scraper/google-flights","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luminati-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-20T13:40:36.000Z","updated_at":"2025-06-04T05:16:33.000Z","dependencies_parsed_at":"2025-03-22T07:02:06.542Z","dependency_job_id":null,"html_url":"https://github.com/luminati-io/google-flights-api","commit_stats":null,"previous_names":["luminati-io/google-flights-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/luminati-io/google-flights-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luminati-io%2Fgoogle-flights-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luminati-io%2Fgoogle-flights-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luminati-io%2Fgoogle-flights-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luminati-io%2Fgoogle-flights-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luminati-io","download_url":"https://codeload.github.com/luminati-io/google-flights-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luminati-io%2Fgoogle-flights-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264952241,"owners_count":23688041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google-flights-api","google-flights-scraper","google-scraper","html","python","python-web-scraper","web-scraper"],"created_at":"2025-06-25T07:09:37.276Z","updated_at":"2025-07-12T07:04:24.513Z","avatar_url":"https://github.com/luminati-io.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Flights Scraper\n\n[![Promo](https://github.com/luminati-io/LinkedIn-Scraper/blob/main/Proxies%20and%20scrapers%20GitHub%20bonus%20banner.png)](https://brightdata.com/products/web-scraper/google-flights)\n\nThis repository provides two ways to extract flight data from Google Flights:\n\n1. **Free Google Flights Scraper:** Ideal for small-scale extraction\n2. **Google Flights Scraper API:** Designed for high-volume, real-time data extraction with unlimited requests. Part of Bright Data's [SERP Scraping API](https://brightdata.com/products/serp-api).\n\n\n## Table of Contents\n2. [Free Scraper](#free-scraper)\n   - [Setup Requirements](#setup-requirements)\n   - [Quick Start](#quick-start)\n   - [Sample Output](#sample-output)\n   - [Limitations](#limitations)\n3. [Google Flights Scraper API](#google-flights-api)\n   - [Key Features](#key-features)\n   - [Prerequisites](#prerequisites)\n   - [Direct API Access](#direct-api-access)\n   - [Native Proxy-Based Access](#native-proxy-based-access)\n4. [Additional Parameters](#additional-parameters)\n   - [Localization Parameters](#localization-parameters)\n   - [Currency Parameter](#currency-parameter)\n5. [Support \u0026 Resources](#support--resources)\n\n## Free Scraper\nA quick and simple scraper for limited data extraction from Google Flights.\n\n\u003cimg width=\"800\" alt=\"google-flights-scraper\" src=\"https://github.com/luminati-io/google-flights-api/blob/main/images/424383720-44ae10b1-4974-497e-9a7c-c1a762614f0e.png\" /\u003e\n\n### Setup Requirements\n- [Python 3.9+](https://www.python.org/downloads/)\n- [Playwright](https://playwright.dev/) for browser automation\n\n```bash\npip install playwright\nplaywright install chromium\n```\n\n\u003e **New to web scraping?** Explore our [Beginner's Guide to Web Scraping with Python](https://brightdata.com/blog/how-tos/web-scraping-with-python)\n\u003e\n\n### Quick Start\n1. Open [google-flights-scraper.py](https://github.com/luminati-io/google-flights-api/blob/main/google-flights-scraper/google-flights-scraper.py)\n2. Update the following variable:\n    - `url`: Paste the Google Flights URL (usually contains `tfs`).\n3. Run the script.\n\n💡 Pro Tip: Set `HEADLESS = False` to minimize detection by Google's anti-scraping measures.\n\n### Sample Output\n```json\n{\n  \"airline\": \"Emirates\",\n  \"departure_time\": \"4:15 AM\",\n  \"arrival_time\": \"2:00 PM\",\n  \"duration\": \"22 hr 15 min\",\n  \"stops\": \"1 stop in DXB\",\n  \"price\": \"$1,139\",\n  \"co2_emissions\": \"1,092 kg CO2e\",\n  \"emissions_variation\": \"+6% emissions\"\n}\n```\n\n👉  [View complete output sample](https://github.com/luminati-io/google-flights-api/blob/main/google-flights-results/flight_results.json)\n\n\n### Limitations\nThe Free Scraper has several constraints:\n- High risk of IP blocking\n- Limited request volume\n- Frequent CAPTCHAs\n- Unreliable for production use\n\nFor robust, scalable scraping without these limitations, consider Bright Data's dedicated API below. 👇\n\n## Google Flights Scraper API\n[Bright Data's Google Flights Scraper API](https://brightdata.com/products/web-scraper/google-flights) is integrated into the [SERP Scraping API](https://brightdata.com/products/serp-api) and leverages our extensive [proxy network](https://brightdata.com/proxy-types) to extract real-time flight data—including prices, schedules, and airline details—at scale, without CAPTCHAs or IP blocks.\n\n### Key Features\n\n- **Global Accuracy:** Tailored results for specific locations\n- **Pay-Per-Success:** Only pay for successful requests\n- **Real-Time Data:** Get up-to-date flights data in seconds\n- **Unlimited Scalability:** Handle high-volume scraping effortlessly\n- **Cost-Efficient:** Eliminates the need for costly infrastructure\n- **Reliable Performance:** Built-in anti-blocking technology\n- **24/7 Expert Support:** Assistance whenever required\n\n### Prerequisites\n\n1. [Create a Bright Data account](https://brightdata.com/) (new users receive a $5 credit).\n2. Generate your [API key](https://docs.brightdata.com/general/account/api-token).\n3. Follow our [step-by-step guide](https://github.com/luminati-io/google-flights-api/blob/main/setup-serp-api-guide.md) to configure the SERP API and set up your credentials.\n\n### Direct API Access\n\nMake a direct request to the API endpoint.\n\n**cURL Example:**\n\n```bash\ncurl https://api.brightdata.com/request \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer API_TOKEN\" \\\n  -d '{\n        \"zone\": \"ZONE_NAME\",\n        \"url\": \"https://www.google.com/travel/flights/search?tfs=CBwQAhojEgoyMDI1LTA0LTAxagcIARIDREVMcgwIAxIIL20vMDRqcGxAAUgBcAGCAQsI____________AZgBAg\",\n        \"format\": \"raw\"\n      }'\n```\n\n**Python Example:**\n\n```python\nimport requests\n\nurl = \"https://api.brightdata.com/request\"\nheaders = {\"Content-Type\": \"application/json\", \"Authorization\": \"Bearer API_TOKEN\"}\npayload = {\n    \"zone\": \"ZONE_NAME\",\n    \"url\": \"https://www.google.com/travel/flights/search?tfs=CBwQAhojEgoyMDI1LTA0LTAxagcIARIDREVMcgwIAxIIL20vMDRqcGxAAUgBcAGCAQsI____________AZgBAg\",\n    \"format\": \"raw\",\n}\n\nresponse = requests.post(url, headers=headers, json=payload)\n\nwith open(\"google-flights-data.html\", \"w\", encoding=\"utf-8\") as file:\n    file.write(response.text)\nprint(\"HTML response saved to 'google-flights-data.html'.\")\n```\n\n### Native Proxy-Based Access\n\nAlternatively, use Bright Data's proxy routing method.\n\n**cURL Example:**\n\n```bash\ncurl -i \\\n  --proxy brd.superproxy.io:33335 \\\n  --proxy-user \"brd-customer-\u003ccustomer-id\u003e-zone-\u003czone-name\u003e:\u003czone-password\u003e\" \\\n  -k \\\n  \"https://www.google.com/travel/flights/search?tfs=CBwQAhojEgoyMDI1LTA0LTAxagcIARIDREVMcgwIAxIIL20vMDRqcGxAAUgBcAGCAQsI____________AZgBAg\"\n```\n\n**Python Example:**\n\n```python\nimport requests\nimport urllib3\n\nurllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)\n\nhost = \"brd.superproxy.io\"\nport = 33335\nusername = \"brd-customer-\u003ccustomer-id\u003e-zone-\u003czone-name\u003e\"\npassword = \"\u003czone-password\u003e\"\nproxy_url = f\"http://{username}:{password}@{host}:{port}\"\n\nproxies = {\"http\": proxy_url, \"https\": proxy_url}\nurl = \"https://www.google.com/travel/flights/search?tfs=CBwQAhojEgoyMDI1LTA0LTAxagcIARIDREVMcgwIAxIIL20vMDRqcGxAAUgBcAGCAQsI____________AZgBAg\"\nresponse = requests.get(url, proxies=proxies, verify=False)\n\nwith open(\"google-flights-data.html\", \"w\", encoding=\"utf-8\") as file:\n    file.write(response.text)\n\nprint(\"Response saved to 'google-flights-data.html'.\")\n```\n\n👉 View the [full HTML output](https://github.com/luminati-io/google-flights-api/blob/main/google-flights-api-output/google-flights-data.html).\n\n**Note:** For production use, load Bright Data's SSL certificate as per the [SSL Certificate Guide](https://docs.brightdata.com/general/account/ssl-certificate).\n\n\n## Additional Parameters\nFine-tune your Google Flights data extraction with these optional parameters.\n\n### Localization Parameters\n\u003cimg width=\"800\" alt=\"bright-data-google-flights-api-localization\" src=\"https://github.com/luminati-io/google-flights-api/blob/main/images/424454961-e77f10c9-8e44-46aa-be3d-64c756741479.png\" /\u003e\n\nCustomize search results based on location and language:\n\n| Parameter | Description | Example |\n| --- | --- | --- |\n| gl | Two-letter country code | `gl=us` (United States) |\n| hl | Two-letter language code | `hl=en` (English) |\n\n\n**Example:** Search for flights from Paris to London in French:\n\n```bash\ncurl --proxy brd.superproxy.io:33335 --proxy-user brd-customer-\u003ccustomer-id\u003e-zone-\u003czone-name\u003e:\u003czone-password\u003e \\\n\"https://www.google.com/travel/flights/search?tfs=CBwQAhojEgoyMDI1LTA0LTAxagcIARIDQ0RHcgwIAxIIL20vMDRqcGxAAUgBcAGCAQsI____________AZgBAg\u0026hl=fr\u0026gl=fr\"\n```\n\n### Currency Parameter\n\n\u003cimg width=\"800\" alt=\"bright-data-google-flights-api-currency\" src=\"https://github.com/luminati-io/google-flights-api/blob/main/images/424820088-c571e99f-b854-449e-abc2-60149611ad5b.png\" /\u003e\n\nDefine the currency for returned prices using the `curr` parameter.\n\n**Example:** Return prices in USD.\n\n```bash\ncurl --proxy brd.superproxy.io:33335 --proxy-user brd-customer-\u003ccustomer-id\u003e-zone-\u003czone-name\u003e:\u003czone-password\u003e \\\n\"https://www.google.com/travel/flights/search?tfs=CBwQAhojEgoyMDI1LTA0LTAxagcIARIDQ0RHcgwIAxIIL20vMDRqcGxAAUgBcAGCAQsI____________AZgBAg\u0026hl=fr\u0026gl=fr\u0026curr=USD\"\n```\n\n## Support \u0026 Resources\n\n- **Docs:** [SERP API Documentation](https://docs.brightdata.com/scraping-automation/serp-api/)\n- **Related APIs:** [Web Unlocker API](https://github.com/luminati-io/web-unlocker-api), [SERP API](https://github.com/luminati-io/serp-api), [Google Search API](https://github.com/luminati-io/google-search-api), [Google News Scraper](https://github.com/luminati-io/Google-News-Scraper), [Google Trends API](https://github.com/luminati-io/google-trends-api), [Google Reviews API](https://github.com/luminati-io/google-reviews-api), [Google Hotels API](https://github.com/luminati-io/google-hotels-api)\n- **Google Scraping Tutorials:**\n    - [How to Scrape Google Flights](https://brightdata.com/blog/web-data/how-to-scrape-google-flights)\n    - [How to Scrape Google Search Results](https://brightdata.com/blog/web-data/scraping-google-with-python)\n    - [How to Scrape Google Maps](https://brightdata.com/blog/web-data/how-to-scrape-google-maps)\n- **Use Cases:**\n    - [SEO \u0026 SERP Tracking](https://brightdata.com/use-cases/serp-tracking)\n    - [Travel Industry Data](https://brightdata.com/use-cases/travel)\n- **Additional Reading:** [Best SERP APIs](https://brightdata.com/blog/web-data/best-serp-apis)\n- **Contact Support:** [support@brightdata.com](mailto:support@brightdata.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluminati-io%2Fgoogle-flights-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluminati-io%2Fgoogle-flights-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluminati-io%2Fgoogle-flights-api/lists"}