The fast, robust, strongly-typed Google Flights scraper (API) implemented in Python.
Project description
flights
The fast, robust, strongly-typed Google Flights scraper (API) implemented in Python. Based on Baes64-encoded Protobuf string.
$ pip install fast-flights
Usage
To use fast-flights
, you'll first create a filter (inherited from ?tfs=
) to perform a request.
Then, add flight_data
, trip
, seat
and passengers
info to use the API directly.
Honorable mention: I like birds. Yes, I like birds.
from fast_flights import FlightData, Passengers, create_filter, get_flights
# Create a new filter
filter = create_filter(
flight_data=[
# Include more if it's not a one-way trip
FlightData(
date="2024-07-02",
from_airport="TPE",
to_airport="MYJ"
)
],
trip="one-way",
seat="economy",
passengers=Passengers(
adults=2,
children=1
),
)
# Get flights from a filter
result = get_flights(filter)
# The price is currently... low/typical/high
print("The price is currently", result.current_price)
# Display the first flight
print(result.flights[0])
Additionally, you can use the Airport
enum to search for airports in code (as you type)!
Airport.TAIPEI
|---------------------------------|
| TAIPEI_SONGSHAN_AIRPORT |
| TAPACHULA_INTERNATIONAL_AIRPORT |
| TAMPA_INTERNATIONAL_AIRPORT |
| ... 5 more |
|---------------------------------|
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
fast_flights-0.1.tar.gz
(42.7 kB
view details)
File details
Details for the file fast_flights-0.1.tar.gz
.
File metadata
- Download URL: fast_flights-0.1.tar.gz
- Upload date:
- Size: 42.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a2bb36a15e7fc1d1a90bcd20b7ecbc8e2018a55a99d1326ce9cacad099e739f |
|
MD5 | 5eedab894f87acdcb0b4d46a000e2552 |
|
BLAKE2b-256 | d61a0adefd2ec8544b6d2187265c10fba2a174bca483e98ed3e3782841a5b7a6 |