Skip to main content

Python client for FlightGrab flight deals (search, export, optional Pro booking links)

Project description

FlightGrab (Python)

Client library for FlightGrab flight deals: search stored routes, export to CSV/JSON, optional pandas, and (Pro-gated) browser booking links.

Install

pip install flightgrab

Optional extras:

pip install flightgrab[pandas]   # DataFrame export
pip install flightgrab[dev]      # pytest, black

Quick start

from flightgrab import FlightSearch

search = FlightSearch()
flights = search.find_flights("ATL", "MIA", date="2026-04-15", limit=20)

for f in flights:
    print(f)   # Spirit: $89 (nonstop)

Point at a self-hosted API:

import os
os.environ["FLIGHTGRAB_API_URL"] = "http://127.0.0.1:8000"

API surface (HTTP)

The client uses public endpoints on the FlightGrab backend:

  • GET /api/route-flights — list flights for an origin/destination (optional departure_date, limit)
  • GET /api/book-redirect?format=json — resolve a booking URL plus fallback_url, ttl_seconds (heuristic), and source (how the link was obtained). If an airline URL goes stale, call again or use the fallback (Google Flights search).
  • POST /api/alerts/subscribe — price alerts (requires Bearer JWT from app sign-in)

Pro: open booking in browser

Free tier includes search and export. Opening the system browser to a resolved booking URL is gated so you can sell a Pro license later:

  • Set FLIGHTGRAB_LICENSE_KEY, or
  • For local development: FLIGHTGRAB_PRO=1
from flightgrab import FlightSearch, open_booking_link

# After setting FLIGHTGRAB_PRO=1 or a license key:
search = FlightSearch()
flights = search.find_flights("ATL", "MIA", date="2026-04-15", limit=1)
open_booking_link(flights[0])

fetch_booking_url(...) returns only the primary URL (no Pro). For full metadata:

from flightgrab import resolve_booking
import time

r = resolve_booking("ATL", "MIA", "2026-04-15")
t0 = time.time()
# ... user waits ...
if r.is_expired(t0):
    r = resolve_booking("ATL", "MIA", "2026-04-15")  # fresh airline URL
# or open r.fallback_url (Google Flights search)

open_booking_link(...) returns a BookingResolution (opens browser; Pro-gated).

CLI

flightgrab search ATL MIA --date 2026-04-15 --json

Development

cd flightgrab-python
pip install -e ".[dev]"
pytest

License

MIT — see LICENSE.

Author

Tevin Parboosingh — flightgrab.cc

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

flightgrab-0.1.0.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

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

flightgrab-0.1.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file flightgrab-0.1.0.tar.gz.

File metadata

  • Download URL: flightgrab-0.1.0.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for flightgrab-0.1.0.tar.gz
Algorithm Hash digest
SHA256 48b8e001a56a8aa1d7ea74e0737734f42cc8926017f85fcfe989d79da608c2a9
MD5 0d5881a60e60fe242834a64f22750927
BLAKE2b-256 dacdb799fc1d7c3f5481406eac7939c1258949cbc33e085e135f7fe053d178bb

See more details on using hashes here.

File details

Details for the file flightgrab-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: flightgrab-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for flightgrab-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8757a54a44056a8689c8de049c6fd4200b0d28b8ce8fdbcc41af709862bc7d67
MD5 f38988f8abd3dde7cf65450736faffb5
BLAKE2b-256 1c6b561abaded048f51009db932debd3cec3fcca5b2763cfc48226752b2f280f

See more details on using hashes here.

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