Skip to main content

Parse gRPC and JSON data from flightradar24

Project description

fr24

image image image image

fr24 is a Python library for data retrieval from Flightradar24 using gRPC and JSON APIs.

For a detailed quickstart, examples and references, please refer to the documentation.

Features

fr24 supports the following endpoints:

Endpoint Description Type
Live Feed Current real-time flight data within a bounding box. gRPC
Live Feed Playback Historical snapshot of live feed data for a specific time. gRPC
Flight List List of flights based on registration or flight number. JSON
Playback Historical state vectors data for a flight. JSON
Airport Arrivals Aircraft arrival information for a given airport. JSON
Airport Search Search for airports by keyword. JSON
Nearest Flights Real-time flight data for aircraft within a given radius. gRPC
Follow Flight (streaming) Historical track and real-time updates for a live flight. gRPC
Top Flights List of the most viewed flights. gRPC
Live Flight Status Real-time status updates for live flights. gRPC
Flight Details Detailed information for a live flight. gRPC
Playback Flight Detailed information for a historical flight. gRPC

fr24 is built with modularity and performance in mind, utilising asynchronous programming to handle concurrent requests efficiently.

Installation

For the latest stable version:

pip install fr24

[!IMPORTANT] fr24 comes with minimal dependencies. If you need to_polars(), write_table(), scan_table(), or CSV/Parquet (de)serialisation, install the fr24[polars].

Feature flags:

  • fr24[polars]: dataframe and table I/O support via Polars
  • fr24[cli]: command-line interface dependencies, including polars and rich
  • fr24[tui]: terminal UI dependencies, including cli

For a development version, clone the repository and run in the directory:

uv venv
source .venv/bin/activate
uv sync --all-extras --dev

This installs all optional dependencies, typing, linting, testing and documentation tools.

Examples

Fetch live feed data for a specific bounding box:

import asyncio

from fr24 import FR24, BoundingBox

bbox = BoundingBox(south=42, north=52, west=-8, east=10)

async def main() -> None:
    async with FR24() as client:
        result = await client.live_feed.fetch(bbox)
        print(result.response.content)  # access raw, undecoded bytes
        # convert to other formats:
        print(result.to_proto())  # protobuf object
        print(result.to_dict())  # nested dictionary
        print(result.to_polars())  # polars dataframe

        # write to a parquet file:
        result.write_table("feed.parquet")


if __name__ == "__main__":
    asyncio.run(main())

To improve efficiency and reduce API calls, fr24 provides a simple file-based cache:

import asyncio

from fr24 import FR24, FR24Cache, BBOX_FRANCE_UIR

cache = FR24Cache.default()

async def main() -> None:
    async with FR24() as client:
        result = await client.live_feed.fetch(BBOX_FRANCE_UIR)
        # on Linux, this writes to ~/.cache/fr24/feed/{timestamp_s}.parquet
        result.write_table(cache)

def some_time_later() -> None:
    for fp in cache.live_feed.glob("*"):
        print(fp)
        print(cache.live_feed.scan_table(fp).collect())

if __name__ == "__main__":
    asyncio.run(main())
    some_time_later()

fr24 also comes with a CLI for quick data retrieval:

$ fr24 live-feed --bounding-box "42.0,52.0,-8.0,10.0" -o feed.parquet
[00:00:00] INFO     using environment `subscription_key` and      __init__.py:98
                    `token`                                                     
[00:00:00] INFO     HTTP Request: POST                           _client.py:1740
                    https://data-feed.flightradar24.com/fr24.fee                
                    d.api.v1.Feed/LiveFeed "HTTP/2 200 OK"                      
           INFO     wrote 1500 rows to                              utils.py:229
                    `/home/user/feed.parquet
$ duckdb -c "describe select * from 'feed.parquet'";
┌─────────────────┬──────────────────────┬─────────┬───┬─────────┬─────────┐
│   column_name   │     column_type      │  null   │ … │ default │  extra  │
│     varchar     │       varchar        │ varchar │   │ varchar │ varchar │
├─────────────────┼──────────────────────┼─────────┼───┼─────────┼─────────┤
│ timestamp       │ TIMESTAMP WITH TIM…  │ YES     │ … │ NULL    │ NULL    │
│ flightid        │ UINTEGER             │ YES     │ … │ NULL    │ NULL    │
│ latitude        │ FLOAT                │ YES     │ … │ NULL    │ NULL    │
│ longitude       │ FLOAT                │ YES     │ … │ NULL    │ NULL    │
│ track           │ USMALLINT            │ YES     │ … │ NULL    │ NULL    │
│ altitude        │ INTEGER              │ YES     │ … │ NULL    │ NULL    │
│ ground_speed    │ SMALLINT             │ YES     │ … │ NULL    │ NULL    │
│ on_ground       │ BOOLEAN              │ YES     │ … │ NULL    │ NULL    │
│ callsign        │ VARCHAR              │ YES     │ … │ NULL    │ NULL    │
│ source          │ UTINYINT             │ YES     │ … │ NULL    │ NULL    │
│ registration    │ VARCHAR              │ YES     │ … │ NULL    │ NULL    │
│ origin          │ VARCHAR              │ YES     │ … │ NULL    │ NULL    │
│ destination     │ VARCHAR              │ YES     │ … │ NULL    │ NULL    │
│ typecode        │ VARCHAR              │ YES     │ … │ NULL    │ NULL    │
│ eta             │ UINTEGER             │ YES     │ … │ NULL    │ NULL    │
│ squawk          │ USMALLINT            │ YES     │ … │ NULL    │ NULL    │
│ vertical_speed  │ SMALLINT             │ YES     │ … │ NULL    │ NULL    │
│ position_buffer │ STRUCT(delta_lat I…  │ YES     │ … │ NULL    │ NULL    │
├─────────────────┴──────────────────────┴─────────┴───┴─────────┴─────────┤
│ 18 rows                                              6 columns (5 shown) │
└──────────────────────────────────────────────────────────────────────────┘

For a full list of commands and options, run:

fr24 --help

fr24 also comes with a TUI - search for flights directly in your terminal:

fr24 tui

Disclaimer

[!IMPORTANT]
Code has been developed for educational purposes ONLY. Do not abuse it.

{
  "copyright": "Copyright (c) 2014-2025 Flightradar24 AB. All rights reserved.",
  "legalNotice": "The contents of this file and all derived data are the property of Flightradar24 AB for use exclusively by its products and applications. Using, modifying or redistributing the data without the prior written permission of Flightradar24 AB is not allowed and may result in prosecutions."
}

Official Resources: Python SDK, API

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

fr24-0.3.0.tar.gz (377.2 kB view details)

Uploaded Source

Built Distribution

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

fr24-0.3.0-py3-none-any.whl (113.6 kB view details)

Uploaded Python 3

File details

Details for the file fr24-0.3.0.tar.gz.

File metadata

  • Download URL: fr24-0.3.0.tar.gz
  • Upload date:
  • Size: 377.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fr24-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f70958b5fd3ed484e886815ea6dd714d8926a545e8e79b53c927c98c2bf4ba61
MD5 ef6fb7fabebdaae5b0b9279ceb3386ae
BLAKE2b-256 1adc399693b569c046a7a7384bd3d08baa787e10f7bdff329999225dd150d7c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for fr24-0.3.0.tar.gz:

Publisher: publish-pypi.yml on abc8747/fr24

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fr24-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: fr24-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 113.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fr24-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16c029aaaf6c17e12ce717ff41ec7ed29b1f1aea94303655bb2c01701f073ffb
MD5 7835a39fe56df6bfe8d9eff9d86dbc53
BLAKE2b-256 765be3b52e09680a6994bdb609bdfc673392377aef8917e7a8af16af9ed15c5b

See more details on using hashes here.

Provenance

The following attestation bundles were made for fr24-0.3.0-py3-none-any.whl:

Publisher: publish-pypi.yml on abc8747/fr24

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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