FlightRadarAPI

raw JSON →
1.4.0 verified Mon Apr 27 auth: no python

Python SDK for FlightRadar24, providing access to real-time flight tracking data including flights, airlines, airports, and more. Currently at version 1.4.0, with monthly releases. Works with Python >=3.7.

pip install FlightRadarAPI
error ModuleNotFoundError: No module named 'FlightRadarAPI'
cause Package not installed or installed but import path wrong.
fix
Run pip install FlightRadarAPI and ensure import is from FlightRadarAPI import FlightRadarAPI.
error AttributeError: module 'FlightRadarAPI' has no attribute 'get_flights'
cause Trying to call get_flights as a module function instead of a method on an instance.
fix
Create an instance first: api = FlightRadarAPI(...) then api.get_flights().
error ValueError: Needs authentication. Provide username and password.
cause Missing credentials when calling methods that require authentication.
fix
Set FR24_USERNAME and FR24_PASSWORD environment variables or pass them to the constructor.
breaking The SDK changed from a module-level function-based API to a class-based API in version 1.0.0. Old code using `import FlightRadarAPI` and calling functions directly will break.
fix Use `from FlightRadarAPI import FlightRadarAPI` and instantiate the class.
deprecated The `get_flights` method now requires authentication (username/password or token). Anonymous access is no longer supported.
fix Provide valid credentials via environment variables or constructor arguments.
gotcha FlightRadarAPI uses rate limits; frequent requests may result in temporary bans. Use with respect and caching.
fix Implement request throttling and respect HTTP 429 responses.

Initialize the API with credentials and fetch live flight data.

from FlightRadarAPI import FlightRadarAPI

# Initialize with your FlightRadar24 username/password or token
username = os.environ.get('FR24_USERNAME', '')
password = os.environ.get('FR24_PASSWORD', '')
api = FlightRadarAPI(username=username, password=password)

# Get real-time flights (returns list of Flight objects)
flights = api.get_flights()
for flight in flights:
    print(flight.callsign, flight.latitude, flight.longitude)