Skip to main content

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 Passengers object and shared result filters into a SearchFilters object (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 .pyi stubs 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

MIT licensed. This is an unofficial client and is not affiliated with Google.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gflights-0.3.0.tar.gz (457.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

gflights-0.3.0-cp310-abi3-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.10+Windows x86-64

gflights-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

gflights-0.3.0-cp310-abi3-macosx_11_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

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

Hashes for gflights-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f60f51d953b5e09fb0444ec08e97eefa5960dbc49fe91287192305ea3355c9ab
MD5 449d14e069b7ebeae43d5303ae4ee44d
BLAKE2b-256 7b0ce75fe5c192c1b6a340442d4c8ce2849c98fbbc9a6b333032649a905196fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for gflights-0.3.0.tar.gz:

Publisher: release.yml on nas-/google-flights-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for gflights-0.3.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a7d35fe9a33a68bf43489b07e03b8a1fa89dc0b1cc74237211003d55bf5c6222
MD5 6d2cf834aa3849126c9cd1dd83f873c2
BLAKE2b-256 8ad84b43e9f81e1a47ddd76011c665a23977cedd24cc2a60ca03bb5528beed60

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gflights-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gflights-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ab6b795c4af6e02682de2f9e837bf41ea084dd98f085e1826f8da0ea4ddae0a7
MD5 8c8adc4bd0f7c448cbd58671044a2ba0
BLAKE2b-256 dc4d420213835de383e34b26ea96996403f59622445a8fd7a4af5c1413d23bdd

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gflights-0.3.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gflights-0.3.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 53c019de014cef67385907dec54954015ef9a925a7471e82f175c8ac50816419
MD5 01b34ca57cd09c06c5fa5a692578b8b1
BLAKE2b-256 577cd964f9a87c033af66ab0f6d0a012ec470facf138c04ba4e8e182c3d73613

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page