Unofficial async Python client for Google Flights, powered by a Rust backend
Project description
gflights
Unofficial async Python client for Google Flights, powered by a Rust backend (via PyO3/maturin).
Search flights, price graphs, date grids, multi-city itineraries, cheapest
dates, and destination exploration — all as native asyncio coroutines, with
no browser or scraping framework required.
Install
pip install gflights
Prebuilt wheels (CPython 3.10+, abi3) are published for Linux (x86_64), Windows (x64), and macOS (arm64). Other platforms build from the source distribution and require a Rust toolchain.
Quick start
import asyncio
from gflights import Client
async def main():
client = Client(currency="USD", country="US")
flights = await client.search(
origin="LHR", # IATA code or city name
destination="JFK",
date="2026-09-15", # str or datetime.date
)
for f in flights[:5]:
print(f.airline, f.price, f.duration_minutes, "min", f.stops, "stop(s)")
asyncio.run(main())
Locale (currency / language / country) is fixed per client at construction.
Currency accepts an ISO-4217 string or a Currency enum member
(Client(currency=Currency.USD)); date arguments accept "YYYY-MM-DD" strings
or datetime.date objects.
Features
search— one-way and round-trip flight search with filters (stops, airlines and alliances, connecting airports, max price, baggage, sort order, lower emissions).price_graph— cheapest fare per departure day across a date range.date_grid— full departure × return price matrix for round trips.cheapest_dates— cheapest departure dates over a range of months (one-way or fixed-length round trips).multi_city_search— open-jaw itineraries across multiple legs.explore— discover cheap destinations from an origin airport.deals— discounted destinations from an origin (price vs typical price).offer— price the cheapest itinerary and resolve real booking URLs.- Passenger counts grouped into a
Passengersobject and shared result filters into aSearchFiltersobject (adults, children, infants; class, stops, sort, airlines, via, max price, baggage, lower emissions). - Typed results (
FlightResult,CheapDate,ExploreResult,DealResult,Offer,BookingOption,EmissionsInfo,LayoverInfo,LegInfo) with.to_dict()and clean__repr__, plus full.pyistubs for IDE/mypy. - Built-in rate limiting and retry with 429 detection.
Proxy & User-Agent
client = Client(
proxy="socks5://127.0.0.1:9050", # http://, https://, or socks5://
user_agent="Mozilla/5.0 ...", # default: rotating real desktop UA
)
Error handling
All API calls raise GFlightsError on network or parse failures:
from gflights import Client, GFlightsError
try:
flights = await client.search(origin="LHR", destination="JFK", date="2026-09-15")
except GFlightsError as e:
print("lookup failed:", e)
Links & license
- Source, full documentation, and the Rust crate: https://github.com/nas-/google-flights-rs
MIT licensed. This is an unofficial client and is not affiliated with Google.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gflights-0.3.0.tar.gz.
File metadata
- Download URL: gflights-0.3.0.tar.gz
- Upload date:
- Size: 457.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f60f51d953b5e09fb0444ec08e97eefa5960dbc49fe91287192305ea3355c9ab
|
|
| MD5 |
449d14e069b7ebeae43d5303ae4ee44d
|
|
| BLAKE2b-256 |
7b0ce75fe5c192c1b6a340442d4c8ce2849c98fbbc9a6b333032649a905196fb
|
Provenance
The following attestation bundles were made for gflights-0.3.0.tar.gz:
Publisher:
release.yml on nas-/google-flights-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gflights-0.3.0.tar.gz -
Subject digest:
f60f51d953b5e09fb0444ec08e97eefa5960dbc49fe91287192305ea3355c9ab - Sigstore transparency entry: 1739882306
- Sigstore integration time:
-
Permalink:
nas-/google-flights-rs@390b8859b90430502f0450a5f5c8165a6ad87d6c -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/nas-
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@390b8859b90430502f0450a5f5c8165a6ad87d6c -
Trigger Event:
push
-
Statement type:
File details
Details for the file gflights-0.3.0-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: gflights-0.3.0-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 3.5 MB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7d35fe9a33a68bf43489b07e03b8a1fa89dc0b1cc74237211003d55bf5c6222
|
|
| MD5 |
6d2cf834aa3849126c9cd1dd83f873c2
|
|
| BLAKE2b-256 |
8ad84b43e9f81e1a47ddd76011c665a23977cedd24cc2a60ca03bb5528beed60
|
Provenance
The following attestation bundles were made for gflights-0.3.0-cp310-abi3-win_amd64.whl:
Publisher:
release.yml on nas-/google-flights-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gflights-0.3.0-cp310-abi3-win_amd64.whl -
Subject digest:
a7d35fe9a33a68bf43489b07e03b8a1fa89dc0b1cc74237211003d55bf5c6222 - Sigstore transparency entry: 1739882316
- Sigstore integration time:
-
Permalink:
nas-/google-flights-rs@390b8859b90430502f0450a5f5c8165a6ad87d6c -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/nas-
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@390b8859b90430502f0450a5f5c8165a6ad87d6c -
Trigger Event:
push
-
Statement type:
File details
Details for the file gflights-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: gflights-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 4.2 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab6b795c4af6e02682de2f9e837bf41ea084dd98f085e1826f8da0ea4ddae0a7
|
|
| MD5 |
8c8adc4bd0f7c448cbd58671044a2ba0
|
|
| BLAKE2b-256 |
dc4d420213835de383e34b26ea96996403f59622445a8fd7a4af5c1413d23bdd
|
Provenance
The following attestation bundles were made for gflights-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on nas-/google-flights-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gflights-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
ab6b795c4af6e02682de2f9e837bf41ea084dd98f085e1826f8da0ea4ddae0a7 - Sigstore transparency entry: 1739882321
- Sigstore integration time:
-
Permalink:
nas-/google-flights-rs@390b8859b90430502f0450a5f5c8165a6ad87d6c -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/nas-
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@390b8859b90430502f0450a5f5c8165a6ad87d6c -
Trigger Event:
push
-
Statement type:
File details
Details for the file gflights-0.3.0-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: gflights-0.3.0-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53c019de014cef67385907dec54954015ef9a925a7471e82f175c8ac50816419
|
|
| MD5 |
01b34ca57cd09c06c5fa5a692578b8b1
|
|
| BLAKE2b-256 |
577cd964f9a87c033af66ab0f6d0a012ec470facf138c04ba4e8e182c3d73613
|
Provenance
The following attestation bundles were made for gflights-0.3.0-cp310-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on nas-/google-flights-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gflights-0.3.0-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
53c019de014cef67385907dec54954015ef9a925a7471e82f175c8ac50816419 - Sigstore transparency entry: 1739882309
- Sigstore integration time:
-
Permalink:
nas-/google-flights-rs@390b8859b90430502f0450a5f5c8165a6ad87d6c -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/nas-
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@390b8859b90430502f0450a5f5c8165a6ad87d6c -
Trigger Event:
push
-
Statement type: