Example Gallery
You can find even more usage examples under tests/.
FR24 class¤
Flight list¤
API reference: fr24.core.FlightListService, fr24.core.FlightListService.fetch, fr24.core.FlightListService.fetch_all
Single page¤
from fr24.core import FR24
async def my_list() -> None:
async with FR24() as fr24:
response = await fr24.flight_list.fetch(reg="B-HPB")
data = response.to_arrow()
print(data.df)
data.save()
await my_list()
flight_id number callsign icao24 registration typecode origin destination status STOD ETOD ATOD STOA ETOA ATOA
0 882269295 CX982 CPA982 7901768 B-HPB A21N None None Scheduled NaT NaT NaT NaT NaT NaT
1 882279849 CX983 CPA983 7901768 B-HPB A21N ZGGG VHHH Landed 12:28 2024-04-01 02:15:00 NaT 2024-04-01 03:45:26 2024-04-01 03:45:00 NaT 2024-04-01 04:28:37
2 882263077 CX982 CPA982 7901768 B-HPB A21N VHHH ZGGG Landed 10:02 2024-03-31 23:50:00 NaT 2024-04-01 01:30:05 2024-04-01 00:55:00 NaT 2024-04-01 02:02:58
3 882098982 CX439 CPA439 7901768 B-HPB A21N RKSI VHHH Landed 17:02 2024-03-31 04:35:00 NaT 2024-03-31 05:28:02 2024-03-31 08:25:00 NaT 2024-03-31 09:02:19
4 882069433 CX2410 CPA2410 7901768 B-HPB A21N VHHH RKSI Landed 12:49 2024-03-30 23:55:00 NaT 2024-03-31 00:51:40 2024-03-31 03:35:00 NaT 2024-03-31 03:49:22
5 881837333 CX976 CPA976 7901768 B-HPB A21N RPLL VHHH Landed 07:30 2024-03-29 21:45:00 NaT 2024-03-29 21:46:49 2024-03-30 00:05:00 NaT 2024-03-29 23:30:12
6 881725491 CX913 CPA913 7901768 B-HPB A21N VHHH RPLL Landed 22:24 2024-03-29 12:20:00 NaT 2024-03-29 12:42:42 2024-03-29 14:35:00 NaT 2024-03-29 14:24:57
7 881693238 CX674 CPA674 7901768 B-HPB A21N VTBS VHHH Landed 18:58 2024-03-29 08:05:00 NaT 2024-03-29 08:52:54 2024-03-29 10:55:00 NaT 2024-03-29 10:58:14
8 881665708 CX653 CPA653 7901768 B-HPB A21N VHHH VTBS Landed 14:26 2024-03-29 04:00:00 NaT 2024-03-29 04:35:36 2024-03-29 07:05:00 NaT 2024-03-29 07:26:51
9 881605496 CX976 CPA976 7901768 B-HPB A21N RPLL VHHH Landed 07:30 2024-03-28 21:45:00 NaT 2024-03-28 21:46:18 2024-03-29 00:05:00 NaT 2024-03-28 23:30:58
Paginate all pages¤
Queries for next page as long as user doesn't enter x, or if there are no pages left.
In each iteration, rows are upserted and saved to the cache.
Note that pagination cannot be run in parallel: fetching page N requires information from page N-1.
from fr24.core import FR24
async def my_full_list() -> None:
async with FR24() as fr24:
data = fr24.flight_list.load(reg="B-HPB") # (1)!
async for response in fr24.flight_list.fetch_all(reg="B-HPB"):
data_new = response.to_arrow()
data.concat(data_new, inplace=True) # (2)!
if input() == "x":
break
data.save()
print(data.df)
await my_full_list()
- First attempt to load existing table from the cache, otherwise it creates an empty in-memory arrow table for us to concat to.
- Upserts the data, replacing older records with new ones.
flight_id number callsign icao24 registration typecode origin destination status STOD ETOD ATOD STOA ETOA ATOA
0 882269295 CX982 CPA982 7901768 B-HPB A21N None None Scheduled NaT NaT NaT NaT NaT NaT
1 882279849 CX983 CPA983 7901768 B-HPB A21N ZGGG VHHH Landed 12:28 2024-04-01 02:15:00 NaT 2024-04-01 03:45:26 2024-04-01 03:45:00 NaT 2024-04-01 04:28:37
2 882263077 CX982 CPA982 7901768 B-HPB A21N VHHH ZGGG Landed 10:02 2024-03-31 23:50:00 NaT 2024-04-01 01:30:05 2024-04-01 00:55:00 NaT 2024-04-01 02:02:58
3 882098982 CX439 CPA439 7901768 B-HPB A21N RKSI VHHH Landed 17:02 2024-03-31 04:35:00 NaT 2024-03-31 05:28:02 2024-03-31 08:25:00 NaT 2024-03-31 09:02:19
4 882069433 CX2410 CPA2410 7901768 B-HPB A21N VHHH RKSI Landed 12:49 2024-03-30 23:55:00 NaT 2024-03-31 00:51:40 2024-03-31 03:35:00 NaT 2024-03-31 03:49:22
5 881837333 CX976 CPA976 7901768 B-HPB A21N RPLL VHHH Landed 07:30 2024-03-29 21:45:00 NaT 2024-03-29 21:46:49 2024-03-30 00:05:00 NaT 2024-03-29 23:30:12
6 881725491 CX913 CPA913 7901768 B-HPB A21N VHHH RPLL Landed 22:24 2024-03-29 12:20:00 NaT 2024-03-29 12:42:42 2024-03-29 14:35:00 NaT 2024-03-29 14:24:57
7 881693238 CX674 CPA674 7901768 B-HPB A21N VTBS VHHH Landed 18:58 2024-03-29 08:05:00 NaT 2024-03-29 08:52:54 2024-03-29 10:55:00 NaT 2024-03-29 10:58:14
8 881665708 CX653 CPA653 7901768 B-HPB A21N VHHH VTBS Landed 14:26 2024-03-29 04:00:00 NaT 2024-03-29 04:35:36 2024-03-29 07:05:00 NaT 2024-03-29 07:26:51
9 881605496 CX976 CPA976 7901768 B-HPB A21N RPLL VHHH Landed 07:30 2024-03-28 21:45:00 NaT 2024-03-28 21:46:18 2024-03-29 00:05:00 NaT 2024-03-28 23:30:58
10 881497323 CX913 CPA913 7901768 B-HPB A21N VHHH RPLL Landed 22:24 2024-03-28 12:20:00 NaT 2024-03-28 12:49:47 2024-03-28 14:35:00 NaT 2024-03-28 14:24:36
11 881467141 CX421 CPA421 7901768 B-HPB A21N RCTP VHHH Landed 18:45 2024-03-28 09:00:00 NaT 2024-03-28 09:11:26 2024-03-28 11:05:00 NaT 2024-03-28 10:45:36
12 881447170 CX420 CPA420 7901768 B-HPB A21N VHHH RCTP Landed 15:33 2024-03-28 05:50:00 NaT 2024-03-28 06:11:32 2024-03-28 07:50:00 NaT 2024-03-28 07:33:47
13 881399852 CX449 CPA449 7901768 B-HPB A21N RCKH VHHH Landed 08:55 2024-03-27 23:45:00 NaT 2024-03-27 23:46:05 2024-03-28 01:15:00 NaT 2024-03-28 00:55:16
14 881284852 CX448 CPA448 7901768 B-HPB A21N VHHH RCKH Landed 22:58 2024-03-27 13:45:00 NaT 2024-03-27 14:02:26 2024-03-27 15:15:00 NaT 2024-03-27 14:58:08
15 881224769 CX357 CPA357 7901768 B-HPB A21N ZSNJ VHHH Landed 16:48 2024-03-27 06:15:00 NaT 2024-03-27 06:38:34 2024-03-27 09:05:00 NaT 2024-03-27 08:48:19
16 881200477 CX356 CPA356 7901768 B-HPB A21N VHHH ZSNJ Landed 13:01 2024-03-27 02:25:00 NaT 2024-03-27 03:09:36 2024-03-27 05:00:00 NaT 2024-03-27 05:01:42
17 881059983 CX742 CPA742 7901768 B-HPB A21N VVNB VHHH Landed 22:12 2024-03-26 12:20:00 NaT 2024-03-26 12:53:49 2024-03-26 14:15:00 NaT 2024-03-26 14:12:35
18 881028286 CX743 CPA743 7901768 B-HPB A21N VHHH VVNB Landed 18:26 2024-03-26 09:15:00 NaT 2024-03-26 09:45:30 2024-03-26 11:20:00 NaT 2024-03-26 11:26:21
19 880987691 CX906 CPA906 7901768 B-HPB A21N RPLL VHHH Landed 13:00 2024-03-26 02:50:00 NaT 2024-03-26 03:17:20 2024-03-26 05:30:00 NaT 2024-03-26 05:00:05
20 880961197 CX907 CPA907 7901768 B-HPB A21N VHHH RPLL Landed 09:31 2024-03-25 23:30:00 NaT 2024-03-25 23:48:48 2024-03-26 01:40:00 NaT 2024-03-26 01:31:18
21 880878019 CX989 CPA989 7901768 B-HPB A21N ZGGG VHHH Landed 00:08 2024-03-25 14:25:00 NaT 2024-03-25 15:32:32 2024-03-25 15:35:00 NaT 2024-03-25 16:08:08
22 880853941 CX988 CPA988 7901768 B-HPB A21N VHHH ZGGG Landed 22:13 2024-03-25 12:05:00 NaT 2024-03-25 13:39:17 2024-03-25 13:10:00 NaT 2024-03-25 14:13:28
23 880807848 CX674 CPA674 7901768 B-HPB A21N VTBS VHHH Landed 18:51 2024-03-25 08:05:00 NaT 2024-03-25 08:27:12 2024-03-25 10:55:00 NaT 2024-03-25 10:51:37
24 880782639 CX653 CPA653 7901768 B-HPB A21N VHHH VTBS Landed 13:51 2024-03-25 04:00:00 NaT 2024-03-25 04:19:31 2024-03-25 07:05:00 NaT 2024-03-25 06:51:40
...
Playback¤
API reference: fr24.core.PlaybackService, fr24.core.PlaybackService.fetch
Miracle on the Hudson¤
Downloads the flight trajectory for UA1549
import rich
from fr24.core import FR24
async def my_playback() -> None:
async with FR24() as fr24:
response = await fr24.playback.fetch(0x2FB3041) # (1)!
data = response.to_arrow()
print(data.df)
rich.print(data.metadata)
data.save()
await my_playback()
timestamp latitude longitude altitude ground_speed vertical_speed track squawk ems
0 1232049993 40.770302 -73.862801 0 0 NaN 59 0 None
1 1232049997 40.770302 -73.862503 0 0 NaN 65 0 None
2 1232050001 40.770302 -73.862198 0 0 NaN 71 0 None
3 1232050005 40.770302 -73.862198 0 0 NaN 76 0 None
4 1232050009 40.770302 -73.862198 0 0 NaN 82 0 None
.. ... ... ... ... ... ... ... ... ...
358 1232051425 40.781399 -73.998199 326 137 NaN 223 0 None
359 1232051429 40.779202 -73.999603 274 131 NaN 226 0 None
360 1232051433 40.777199 -74.001297 187 134 NaN 222 0 None
361 1232051437 40.775002 -74.002899 106 130 NaN 223 0 None
362 1232051441 40.773102 -74.004303 42 128 NaN 223 0 None
[363 rows x 9 columns]
{
'flight_id': 50016321,
'callsign': 'AWE1549',
'flight_number': 'UA1549',
'status_type': 'departure',
'status_text': None,
'status_diverted': None,
'status_time': None,
'model_code': 'A320',
'icao24': 10493137,
'registration': 'N106US',
'owner': None,
'airline': None,
'origin': 'KLGA',
'destination': 'KCLT',
'median_delay': None,
'median_time': None
}
File operations¤
Saves trajectory data to disk, reads the track and metadata from it.
import rich
from fr24.core import FR24
async def my_playback() -> None:
async with FR24() as fr24:
response = await fr24.playback.fetch(0x2FB3041)
data = response.to_arrow()
data.save() # (1)!
# some time later...
data_local = fr24.playback.load(0x2FB3041) # (2)!
print(data_local.df)
rich.print(data_local.metadata)
await my_playback()
timestamp latitude longitude altitude ground_speed vertical_speed track squawk ems
0 1232049993 40.770302 -73.862801 0 0 NaN 59 0 None
1 1232049997 40.770302 -73.862503 0 0 NaN 65 0 None
2 1232050001 40.770302 -73.862198 0 0 NaN 71 0 None
3 1232050005 40.770302 -73.862198 0 0 NaN 76 0 None
4 1232050009 40.770302 -73.862198 0 0 NaN 82 0 None
.. ... ... ... ... ... ... ... ... ...
358 1232051425 40.781399 -73.998199 326 137 NaN 223 0 None
359 1232051429 40.779202 -73.999603 274 131 NaN 226 0 None
360 1232051433 40.777199 -74.001297 187 134 NaN 222 0 None
361 1232051437 40.775002 -74.002899 106 130 NaN 223 0 None
362 1232051441 40.773102 -74.004303 42 128 NaN 223 0 None
[363 rows x 9 columns]
{
'flight_id': 50016321,
'callsign': 'AWE1549',
'flight_number': 'UA1549',
'status_type': 'departure',
'status_text': None,
'status_diverted': None,
'status_time': None,
'model_code': 'A320',
'icao24': 10493137,
'registration': 'N106US',
'owner': None,
'airline': None,
'origin': 'KLGA',
'destination': 'KCLT',
'median_delay': None,
'median_time': None
}
Live Feed¤
API reference: fr24.core.LiveFeedService, fr24.core.LiveFeedService.fetch
Live¤
This example is covered in detail in the quickstart.
from fr24.core import FR24
async def my_feed() -> None:
async with FR24() as fr24:
response = await fr24.livefeed.fetch()
print(response)
datac = response.to_arrow()
print(datac.df)
datac.save()
await my_feed()
LiveFeedAPIResp(
ctx={
"timestamp": 1711911907,
"source": "live",
"duration": None,
"hfreq": None,
"base_dir": PosixPath("/home/user/.cache/fr24"),
},
data=[
{
"timestamp": 1711911905,
"flightid": 882151247,
"latitude": -12.432657241821289,
"longitude": -172.14825439453125,
"track": 203,
"altitude": 34000,
"ground_speed": 515,
"vertical_speed": 0,
"on_ground": False,
"callsign": "QFA7552",
"source": 0,
"registration": "N409MC",
"origin": "HNL",
"destination": "AKL",
"typecode": "B744",
"eta": 0,
"squawk": 0,
}
# ... 15109 more items
],
)
timestamp flightid latitude longitude track altitude ground_speed on_ground callsign source registration origin destination typecode eta vertical_speed squawk
0 1711911905 882151247 -12.432657 -172.148254 203 34000 515 False QFA7552 0 N409MC HNL AKL B744 0 0 0
1 1711911902 882203620 -16.504490 -178.940308 249 36000 460 False VOZ76 0 VH-YIL APW BNE B738 0 0 0
2 1711911904 882212062 -13.240505 -176.195602 292 0 0 True RLY0100 0 F-OCQZ WLS DHC6 0 0 0
3 1711911897 882145424 10.347591 -167.007263 56 37000 516 False QFA15 5 VH-EBQ BNE LAX A332 0 0 0
4 1711911905 882199081 18.591330 -165.391083 247 32000 416 False UAL132 3 N77296 HNL MAJ B738 0 0 0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
15095 1711911897 882140495 53.746582 174.467392 258 38000 435 False GTI8650 5 N710GT LAX HKG B77L 0 0 0
15096 1711911887 882155955 54.291172 175.606842 57 31000 515 False UPS81 5 N628UP PVG ANC B748 0 0 0
15097 1711911673 882165589 57.548691 179.460800 246 36000 438 False KAL258 4 HL8285 ANC ICN B77L 0 0 0
15098 1711911901 882187089 56.527115 176.298798 242 38000 442 False CKS936 4 N701CK ANC HFE B744 0 0 0
15099 1711911905 882137160 59.153641 179.730972 229 38000 471 False KAL8286 5 HL8043 YYZ ICN B77L 0 0 0
[15100 rows x 16 columns]
Playback¤
Fetches the live feed three days ago.
from fr24.core import FR24
import time
async def my_feed() -> None:
async with FR24() as fr24:
response = await fr24.livefeed.fetch(int(time.time() - 86400 * 3)) # (1)!
datac = response.to_arrow()
print(datac.df)
await my_feed()
- Subtract current UTC by 3 days.
timestamp flightid latitude longitude track altitude ground_speed on_ground callsign source registration origin destination typecode eta vertical_speed squawk
0 1711697713 881642343 -13.628512 -169.556046 44 37000 499 False DAL42 0 N519DN SYD LAX A359 0 0 0
1 1711697709 881686001 -14.096649 -172.093018 182 8850 298 False ANZ999 0 ZK-NNE APW AKL A21N 0 0 0
2 1711697713 881673319 -46.344315 -173.242355 122 31975 568 False LAN800 4 CC-BGC AKL SCL B789 0 0 0
3 1711697713 881679659 -34.398090 -178.388153 64 37975 530 False ANZ902 4 ZK-NZE AKL PPT B789 0 0 0
4 1711697717 881655685 -12.116470 -169.877808 199 36000 469 False HAL465 5 N395HA HNL PPG A332 0 0 0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
11422 1711697721 881662489 56.048801 174.987000 240 36000 468 False CPA3187 3 B-LJG ANC HKG B748 0 0 0
11423 1711697713 881602916 56.870163 175.223923 226 35000 476 False ANA111 3 JA796A ORD HND B77W 0 0 0
11424 1711697713 881669755 56.652039 176.742554 240 34000 459 False FDX5236 3 N573FE ANC ICN MD11 0 0 0
11425 1711697721 881652749 57.509033 179.559845 242 38000 467 False GTI8065 3 N452PA PDX ICN B744 0 0 0
11426 1711697717 881648986 54.571342 175.497025 55 31000 501 False EVA662 5 B-16781 TPE ANC B77L 0 0 0
[11427 rows x 16 columns]
Lower-level functions¤
Flight list¤
API Reference: fr24.history.flight_list, fr24.history.flight_list_df
import httpx
from fr24.authentication import login
from fr24.history import flight_list, flight_list_df
import pandas as pd
async def my_list() -> pd.DataFrame:
async with httpx.AsyncClient() as client:
auth = await login(client)
if auth is not None:
print(auth["message"])
list_ = await flight_list(
client,
flight="AF291",
timestamp="2024-04-01", # (1)!
auth=auth,
)
return list_
list_ = await my_list()
df = flight_list_df(list_)
df
- Replace it with the current time.
flight_id number callsign icao24 registration typecode origin destination status STOD ETOD ATOD STOA ETOA ATOA
0 NaN AF291 None NaN None 77W RJBB LFPG Scheduled 2024-04-08 02:30:00+00:00 NaT NaT 2024-04-08 17:25:00+00:00 NaT NaT
1 NaN AF291 None NaN None 772 RJBB LFPG Scheduled 2024-04-07 02:30:00+00:00 NaT NaT 2024-04-07 17:25:00+00:00 NaT NaT
2 NaN AF291 None NaN None 772 RJBB LFPG Scheduled 2024-04-06 02:30:00+00:00 NaT NaT 2024-04-06 17:25:00+00:00 NaT NaT
3 NaN AF291 None NaN None 772 RJBB LFPG Scheduled 2024-04-05 02:30:00+00:00 NaT NaT 2024-04-05 17:25:00+00:00 NaT NaT
4 NaN AF291 None NaN None 77W RJBB LFPG Scheduled 2024-04-03 02:30:00+00:00 NaT NaT 2024-04-03 17:25:00+00:00 NaT NaT
5 882273605 AF291 AFR291 3754464 F-GSPA B772 RJBB LFPG Estimated 19:06 2024-04-01 02:30:00+00:00 NaT 2024-04-01 02:56:21+00:00 2024-04-01 17:25:00+00:00 2024-04-01 17:06:08+00:00 NaT
6 882083240 AF291 AFR291 3754478 F-GSPO B772 RJBB LFPG Landed 19:15 2024-03-31 02:30:00+00:00 NaT 2024-03-31 02:47:05+00:00 2024-03-31 17:25:00+00:00 NaT 2024-03-31 17:15:33+00:00
7 881882655 AF291 AFR291 3754467 F-GSPD B772 RJBB LFPG Landed 18:47 2024-03-30 02:55:00+00:00 NaT 2024-03-30 03:27:31+00:00 2024-03-30 17:50:00+00:00 NaT 2024-03-30 17:47:52+00:00
8 881661169 AF291 AFR291 3754470 F-GSPG B772 RJBB LFPG Landed 19:14 2024-03-29 03:25:00+00:00 NaT 2024-03-29 03:41:26+00:00 2024-03-29 18:20:00+00:00 NaT 2024-03-29 18:14:54+00:00
9 881224971 AF291 AFR291 3754487 F-GSPX B772 RJBB LFPG Landed 22:22 2024-03-27 03:25:00+00:00 NaT 2024-03-27 06:58:33+00:00 2024-03-27 18:20:00+00:00 NaT 2024-03-27 21:22:08+00:00
Playback¤
API Reference: fr24.history.playback, fr24.history.playback_df
import httpx
from fr24.authentication import login
from fr24.history import playback, playback_df
import pandas as pd
async def my_playback() -> pd.DataFrame:
async with httpx.AsyncClient() as client:
auth = await login(client)
if auth is not None:
print(auth["message"])
list_ = await playback(
client,
flight_id="35d692b1",
timestamp=1719273600,
auth=auth,
)
return list_
list_ = await my_playback()
df = playback_df(list_)
df
Airport Arrivals¤
API Reference: fr24.history.airport_list
import httpx
from fr24.types.fr24 import AirportList
from fr24.history import airport_list
import pandas as pd
async def my_arrivals() -> AirportList:
async with httpx.AsyncClient() as client:
list_ = await airport_list(
client,
airport="tls",
mode="arrivals",
)
return list_
airports = await my_arrivals()
pd.DataFrame(
pd.json_normalize(
airports["result"]["response"]["airport"]["pluginData"]["schedule"][
"arrivals"
]["data"]
)
)
flight.identification.id flight.identification.row flight.identification.number.default flight.identification.number.alternative flight.identification.callsign flight.identification.codeshare flight.status.live flight.status.text flight.status.icon flight.status.estimated ... flight.time.scheduled.departure flight.time.scheduled.arrival flight.time.real.departure flight.time.real.arrival flight.time.estimated.departure flight.time.estimated.arrival flight.time.other.eta flight.time.other.duration flight.aircraft.images flight.owner
0 None 5488300922 FR8125 MAY8125 RYR8125 None False Scheduled None None ... 1711986600 1711991100 None None 1.711987e+09 None None None NaN NaN
1 None 5488216841 AF6124 None None None False Scheduled None None ... 1711987200 1711991700 None None NaN None None None NaN NaN
2 None 5488418617 U24849 EC4849 EJU51KM None False Scheduled None None ... 1711987500 1711992000 None None 1.711988e+09 None None None NaN NaN
3 None 5488418658 U24988 EC4988 EJU82LE None False Scheduled None None ... 1711986900 1711992300 None None 1.711987e+09 None None None NaN NaN
4 None 5488216846 AF6126 None None None False Scheduled None None ... 1711989000 1711993500 None None NaN None None None NaN NaN
5 None 5488417705 U21311 DS1311 EZS15PY None False Scheduled None None ... 1711990500 1711995000 None None 1.711990e+09 None None None NaN NaN
6 None 5488297888 FR1995 MAY1995 RYR1995 None False Scheduled None None ... 1711989600 1711996500 None None 1.711990e+09 None None None NaN NaN
7 None 5488418631 U24851 EC4851 EJU69EW None False Scheduled None None ... 1711992000 1711996500 None None 1.711992e+09 None None None NaN NaN
8 None 5488298693 FR3358 None None None False Scheduled None None ... 1711986900 1711996800 None None 1.711987e+09 None None None NaN NaN
9 None 5488418589 U24729 EC4729 EJU89CR None False Scheduled None None ... 1711993200 1711997400 None None 1.711993e+09 None None None NaN NaN
[10 rows x 75 columns]
"""
Airport Search¤
API Reference: fr24.find
from fr24.types.find import FindResult
from fr24.find import find
import pandas as pd
import httpx
async def my_find() -> FindResult:
async with httpx.AsyncClient() as client:
results = await find(client, "paris")
assert results is not None
return results
results = await my_find()
pd.DataFrame(pd.json_normalize(results["results"]))
id label type match detail.lat detail.lon detail.size
0 CDG Paris Charles de Gaulle Airport (CDG / LFPG) airport begins 49.012516 2.555752 199939
1 ORY Paris Orly Airport (ORY / LFPO) airport begins 48.723331 2.379444 87577
2 LBG Paris Le Bourget Airport (LBG / LFPB) airport begins 48.958801 2.433600 27873
3 BVA Paris Beauvais-Tille Airport (BVA / LFOB) airport begins 49.454189 2.113550 16566
4 PRX Paris Cox Field (PRX / KPRX) airport begins 33.636665 -95.450279 1402
5 XCR Paris Vatry Chalons Airport (XCR / LFOK) airport begins 48.759998 4.200000 1008
6 VIY Paris Villacoublay Velizy Air Base (VIY / LFPV) airport begins 48.774399 2.201540 993
7 PHT Paris Henry County Airport (PHT / KPHT) airport begins 36.336384 -88.384270 390
Live feed¤
API Reference: fr24.livefeed
Demonstrates custom bounding boxes.
import httpx
from fr24.livefeed import (
livefeed_message_create,
livefeed_post,
livefeed_request_create,
livefeed_response_parse,
)
from fr24.proto.request_pb2 import LiveFeedResponse
async def france_data() -> LiveFeedResponse:
async with httpx.AsyncClient() as client:
message = livefeed_message_create(north=50, west=-7, south=40, east=10)
request = livefeed_request_create(message)
data = await livefeed_post(client, request)
return livefeed_response_parse(data)
data = await france_data()
data
flights_list {
flightid: 882295486
latitude: 40.4882507
longitude: -6.38517904
track: 33
altitude: 36000
ground_speed: 454
icon: 7
timestamp: 1711960343
callsign: "BTI4PX"
extra_info {
flight: "BT766"
reg: "YL-ABL"
route {
from_: "LPA"
to: "RIX"
}
type: "BCS3"
}
}
flights_list {
flightid: 882307182
latitude: 40.1034851
longitude: -4.40472412
track: 162
...
to: "HRG"
}
type: "B738"
}
}
In JSON format:
from google.protobuf.json_format import MessageToDict
MessageToDict(data)["flightsList"]
[{'flightid': 882295486,
'latitude': 40.48825,
'longitude': -6.385179,
'track': 33,
'altitude': 36000,
'groundSpeed': 454,
'icon': 7,
'timestamp': 1711960343,
'callsign': 'BTI4PX',
'extraInfo': {'flight': 'BT766',
'reg': 'YL-ABL',
'route': {'from': 'LPA', 'to': 'RIX'},
'type': 'BCS3'}},
{'flightid': 882307182,
'latitude': 40.103485,
'longitude': -4.404724,
'track': 162,
'altitude': 32950,
'groundSpeed': 513,
'icon': 10,
'timestamp': 1711960344,
'callsign': 'EVE1123',
'extraInfo': {'flight': 'E91123',
'reg': 'EC-LZD',
'route': {'from': 'VLL', 'to': 'AGP'},
...
'callsign': 'CXI1015',
'extraInfo': {'flight': 'XR1015',
'reg': '9H-CXE',
'route': {'from': 'CGN', 'to': 'HRG'},
'type': 'B738'}}]