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.1.tar.gz (460.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.1-cp310-abi3-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.10+Windows x86-64

gflights-0.3.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

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

gflights-0.3.1-cp310-abi3-macosx_11_0_arm64.whl (3.7 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file gflights-0.3.1.tar.gz.

File metadata

  • Download URL: gflights-0.3.1.tar.gz
  • Upload date:
  • Size: 460.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for gflights-0.3.1.tar.gz
Algorithm Hash digest
SHA256 05c965d1640eace4be093551b96a2d93772cd1d2ee6f7ed32b8c80b36e8cf156
MD5 7e44c30fd7111d16c6394d1374e6c404
BLAKE2b-256 33f6562152f839e73ff3008602308e7710bc4c77def142ae6775b49e9b69ae00

See more details on using hashes here.

Provenance

The following attestation bundles were made for gflights-0.3.1.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.1-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: gflights-0.3.1-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.14

File hashes

Hashes for gflights-0.3.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 500fac16528b1a4dd02501b4400772abf23f95de7db715dcb94845e9461e3289
MD5 97c8daa7ed02ca215f0cb74cd5b06155
BLAKE2b-256 d15103984e2cf74044731d78ee50eede53c4855a712b30f03b77383d6ef15681

See more details on using hashes here.

Provenance

The following attestation bundles were made for gflights-0.3.1-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.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gflights-0.3.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 467c7100e1de84560fc07758314f5bcca2da4926e895f0bdda3970eb50928fb1
MD5 92f5717aa94a79306bd475288a0789c6
BLAKE2b-256 feb96fa2918f20538aea002f686c7eb0fbd4913b51bd09279f761dface83ed03

See more details on using hashes here.

Provenance

The following attestation bundles were made for gflights-0.3.1-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.1-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gflights-0.3.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4beabbc3dcbe68d02aa67ca05b84f58c5f9bc0ccf09d1ff8a7be3cd011655850
MD5 c2dc1127cdf82b6de1b740c634849459
BLAKE2b-256 de2d948a31e9268a50203e235767bd09d5da3ecff6043559906c03f090c78a59

See more details on using hashes here.

Provenance

The following attestation bundles were made for gflights-0.3.1-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