Skip to main content

A Python client for the Flightradar24 API with CLI support

Project description

Pyfr24

Documentation Status

A Python client for the Flightradar24 API that provides an interface to fetch, plot and analyze flight data. The package includes both a Python API and a command-line interface for accessing flight data.

Full documentation: https://pyfr24.readthedocs.io/

Installation

# Install from PyPI
pip install pyfr24

# Or from source
git clone https://github.com/stiles/pyfr24.git
cd pyfr24
pip install -e .

Basic usage

Python API

from pyfr24 import FR24API

# Initialize the client
api = FR24API("your_api_token")

# Get flight tracks for a specific flight ID
tracks = api.get_flight_tracks("39bebe6e")

# Export flight data
output_dir = api.export_flight_data(
    "39bebe6e",
    background='osm',        # OpenStreetMap background
    orientation='horizontal'  # 16:9 aspect ratio
)

Full Python docs: https://pyfr24.readthedocs.io/en/latest/usage/api/

Command-line interface

# Export flight data
pyfr24 export-flight --flight-id 39a84c3c --output-dir data/flight_39a84c3c

# Get live flights for an aircraft registration
pyfr24 live-flights --registration N12345

# Get flight positions within a bounding box (Los Angeles area)
pyfr24 flight-positions --bounds "33.5,-118.8,34.5,-117.5"

Full CLI reference: https://pyfr24.readthedocs.io/en/latest/usage/cli/

API token

Your Flightradar24 API token can be provided:

  1. Via environment variable:

    export FLIGHTRADAR_API_KEY="your_api_token"
    
  2. As a command-line argument:

    pyfr24 --token "your_api_token" flight-summary --flight BA123
    
  3. Through an interactive prompt when no token is provided

Features

  • Flight data retrieval (live flights, historical tracks and flight info)
  • Data export in multiple formats (CSV, GeoJSON and KML)
  • Map visualizations with multiple background options
  • Speed and altitude profile charts
  • Error handling and logging
  • Testing

Contributing

Contributions are welcome. Please:

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Ensure all tests pass with python run_tests.py
  5. Submit a pull request

License

This project is licensed under the MIT License.

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

pyfr24-0.1.6.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

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

pyfr24-0.1.6-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

Details for the file pyfr24-0.1.6.tar.gz.

File metadata

  • Download URL: pyfr24-0.1.6.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for pyfr24-0.1.6.tar.gz
Algorithm Hash digest
SHA256 cc4a1ab344a61c909003d653d47cc1e3f23d6095d8fa705000954c6063b6fb9b
MD5 9c2ad0a3ccd35055c34edd64e907e34c
BLAKE2b-256 8030895436a22e596f45b30e24c5503429d07a01d79f725597293afe2c062358

See more details on using hashes here.

File details

Details for the file pyfr24-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: pyfr24-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 22.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for pyfr24-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a699460aa2b1ec01c866ac54ca7656981c3986b6e160e28bbab60258563df3b5
MD5 0ac53cee0ebc0b8e927d35ab76c03926
BLAKE2b-256 11330495adea9819d698dd513fd9668c384d2aca47b6aeed58c4bb84b5c092a4

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