Flightradar24 Python SDK
Official Python SDK for the Flightradar24 API.
Features
- Access to all Flightradar24 API v1 endpoints.
- Intuitive client interface:
client.airports.get_full("WAW") - Typed responses.
- Robust error handling with custom exceptions.
- Synchronous client (async coming soon).
- Lightweight input validation for common parameters.
Installation
Release Version
Using uv:
uv pip install fr24sdk
Using pip:
pip install fr24sdk
SDK Usage Guide
This guide provides a comprehensive overview of how to use the fr24sdk to interact with the Flightradar24 API.
1. Client Initialization
The Client is your main entry point to the API.
Using Environment Variable:
Ensure your API token is set as an environment variable FR24_API_TOKEN.
export FR24_API_TOKEN="your_actual_token_here" # On Linux/macOS
# set FR24_API_TOKEN=your_actual_token_here # On Windows Command Prompt
# $Env:FR24_API_TOKEN="your_actual_token_here" # On Windows PowerShell
Then, initialize the client:
from fr24sdk.client import Client
client = Client()
Passing Token Directly: You can also pass the API token directly during client initialization.
client = Client(api_token="your_actual_token_here")
Using as a Context Manager: This ensures the underlying HTTP client is closed properly.
from fr24sdk.client import Client
with Client() as client:
client.flight_summary(flight_ids="")
pass
2. Accessing API Resources
The client provides access to different API resources as attributes. For example:
client.airlines: Fetch airline details.client.airports: Fetch airport details.client.live: Get live flight data, including flights within specific geographical bounds.client.historic: Query historic flight information.client.flight_summary: Retrieve summaries for specific flights.client.flight_tracks: Access flight track data.client.usage: Check your API usage statistics.
Each resource object then has methods to fetch data related to that resource.
3. Resource Examples
The SDK provides intuitive access to various API resources. Here's how you can typically interact with them:
a. Fetching Airport Details
This example demonstrates fetching detailed information for an airport (e.g., Warsaw Chopin Airport - WAW) and accessing its attributes.
from fr24sdk.client import Client
from fr24sdk.exceptions import ApiError
# Initialize client (ensure FR24_API_TOKEN is set or pass api_token="your_token")
client = Client()
airport_iata = "WAW"
print(f"Fetching full details for airport: {airport_iata}")
airport_details = client.airports.get_full(airport_iata)
if airport_details:
print(f" Name: {airport_details.name}")
print(f" ICAO: {airport_details.icao}")
print(f" City: {airport_details.city}")
print(f" Country: {airport_details.country_name}")
print(f" Latitude: {airport_details.lat}")
print(f" Longitude: {airport_details.lon}")
b. Other Available Resources
The client provides access to a comprehensive set of Flightradar24 API resources, including but not limited to:
client.airlines: Fetch airline details.client.live: Get live flight data, including flights within specific geographical bounds.client.flight_summary: Retrieve summaries for specific flights.client.flight_tracks: Access flight track data.client.historic: Query historic flight information.client.usage: Check your API usage statistics.
Each of these resources offers methods to interact with the corresponding API endpoints. For example, you might use client.live.get_flights(...) or client.airlines.get_by_iata(...). Please refer to the SDK's source code or future detailed documentation for specific method signatures and parameters.
4. Handling Responses
API methods return Python objects that represent the JSON response from the API. You can access data using dot notation, as shown in the examples.
# Example with AirportFull object
# waw_full = client.airports.get_full("WAW")
# print(waw_full.name)
# print(waw_full.timezone_name)
5. Error Handling
The SDK uses custom exceptions to indicate errors. The base exception is Fr24SdkError. More specific errors like ApiError, AuthenticationError, RateLimitError, etc., inherit from it.
import os
from fr24sdk.client import Client
from fr24sdk.exceptions import ApiError, AuthenticationError, Fr24SdkError # Import relevant exceptions
# Assumes FR24_API_TOKEN is set, or pass it to Client()
try:
with Client() as client:
# Example: Intentionally try to get a non-existent airport
airport = client.airports.get_full("INVALID_IATA")
if airport:
print(airport.name)
except AuthenticationError:
print("Authentication failed. Please check your API token.")
except ApiError as e:
print(f"API Error occurred: Status {e.status}, Message: {e.message}")
print(f"Request URL: {e.request_url}")
if e.body:
print(f"Response body: {e.body}")
except Fr24SdkError as e:
print(f"An SDK-specific error occurred: {e}")
except Exception as e:
print(f"An unexpected error occurred: {e}")
6. Closing the Client
If you are not using the client as a context manager (with Client() as client:), you should explicitly close it to release resources:
client = Client()
# ... use client ...
client.close()
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for fr24sdk 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fr24sdk-0.3.1.tar.gz | 153.6 kB | With provenance | Details for fr24sdk-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fr24sdk-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for fr24sdk-0.3.1-py3-none-any.whl |
Total release size: 182.7 kB
Release files / fr24sdk-0.3.1.tar.gz
| Download URL | fr24sdk-0.3.1.tar.gz |
|---|---|
| Size | 153.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0cb2e54601e162b683df6d6a6f3b1121106201c3f185e6d226979201ad45b77d
|
|
BLAKE2b-256 checksum How to use checksums |
a13ba4b5ec36dd9d86caa168b3a7a38c1864bf47efc8d16e8a6060cee47f6b6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 3, 2026.
Transparency logRelease files / fr24sdk-0.3.1-py3-none-any.whl
| Download URL | fr24sdk-0.3.1-py3-none-any.whl |
|---|---|
| Size | 29.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
195410211a9081ae782dba67ea557500da1b91bc9269be08e0a643ab0e809e39
|
|
BLAKE2b-256 checksum How to use checksums |
3b3ca8f7c65d3c05a358dc56ed9983a060f5e44a38875a2068b589644efad5e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 3, 2026.
Transparency logSecurity for fr24sdk 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for fr24sdk-0.3.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 3, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.