Announcement

Collapse
No announcement yet.

flight_datetime_from & to based on first_seen is unreliable for real-time matching

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    flight_datetime_from & to based on first_seen is unreliable for real-time matching

    I am using /api/flight-summary/light programmatically with rolling windows and I keep seeing the same failure mode:

    Core failure mode
    flight_datetime_from / flight_datetime_to is evaluated on first_seen.
    first_seen is often far from actual departure time (sometimes by hours).
    Matching fields (dest_icao, type, reg) can also appear later.


    That combination creates misses: the flight is operationally active (or even airborne), but the query returns empty in real time. Later, replaying the same window can return the flight.

    Support previously explained that this behavior is expected for many GA/military flights (late destination/type/reg assignment + first_seen time basis). My data matches that, but I also see misses when aircraft sit on the ground a long time before takeoff.

    What I am expecting
    If a flight is active and matches the filter now, there should be a way to retrieve it without relying only on initial first_seen.


    What I am observing
    Real-time polling returns empty windows.
    Re-running the same request later can return the missed flight.


    Data sources in examples below
    csv snippets are from the CSV download on the flight/aircraft page on Flightradar24.
    text snippets are real-time log lines from my poller at the moment the requests ran.
    json snippets are post-mortem responses from replaying the same request windows found in the text snippets.


    ---

    Example 1: inbound QXG (OECFE)

    Code:
    2026-02-12 03:52:37,079 INFO src.poller: Poll window: from=2026-02-12T11:46:05 to=2026-02-12T11:52:37
    2026-02-12 03:53:48,657 INFO src.fr24.client: FR24 request URL: /api/flight-summary/light?airports=inbound:QXG&flight_datetime_from=2026-02-12T11:46:05&flight_datetime_to=2026-02-12T11:52:37
    2026-02-12 03:54:01,998 INFO src.poller: Poll end [dur=84.9s sleep=9.7s] [air=none reg=none apt=none]
    Code:
    Timestamp,UTC,Callsign,Position,Altitude,Speed,Direction
    1770896767,2026-02-12T11:46:07Z,OECFE,"48.105549,14.953217",0,0,182
    1770897173,2026-02-12T11:52:53Z,OECFE,"48.102081,14.949646",1725,35,40
    Code:
    {"fr24_id":"3e4d1744","callsign":"OECFE","first_seen":"2026-02-12T11:46:07Z","datetime_takeoff":"2026-02-12T11:52:24Z","dest_icao":"LOLG","dest_icao_actual":"LOLG"}
    ---

    Example 2: aircraft type CA9 (PRZJM)

    Code:
    2026-02-12 11:37:59,616 INFO src.poller: Poll window: from=2026-02-12T19:31:29 to=2026-02-12T19:37:59
    2026-02-12 11:38:15,885 INFO src.fr24.client: FR24 request URL: /api/flight-summary/light?aircraft=CA9&flight_datetime_from=2026-02-12T19:31:29&flight_datetime_to=2026-02-12T19:37:59
    2026-02-12 11:42:35,614 INFO src.poller: Poll window: from=2026-02-12T19:36:03 to=2026-02-12T19:42:35
    2026-02-12 11:42:51,881 INFO src.fr24.client: FR24 request URL: /api/flight-summary/light?aircraft=CA9&flight_datetime_from=2026-02-12T19:36:03&flight_datetime_to=2026-02-12T19:42:35
    Code:
    Timestamp,UTC,Callsign,Position,Altitude,Speed,Direction
    1770924750,2026-02-12T19:32:30Z,PRZJM,"-3.379589,-64.724937",0,0,210
    1770925515,2026-02-12T19:45:15Z,PRZJM,"-3.3983,-64.566788",5625,130,84
    Code:
    {"fr24_id":"3e4eac29","callsign":"PRZJM","type":"CA9","reg":"PR-ZJM","first_seen":"2026-02-12T19:32:30Z","datetime_takeoff":"2026-02-12T19:41:38Z"}
    ---

    Example 3: inbound YYW (CFKAH)

    Code:
    2026-02-12 12:57:20,993 INFO src.fr24.client: FR24 request URL: /api/flight-summary/light?airports=inbound:YYW&flight_datetime_from=2026-02-12T20:25:32&flight_datetime_to=2026-02-12T20:56:02
    2026-02-12 12:57:21,304 INFO src.fr24.client: FR24 response JSON: {"data": []}
    2026-02-12 13:15:41,906 INFO src.fr24.client: FR24 request URL: /api/flight-summary/light?airports=inbound:YYW&flight_datetime_from=2026-02-12T20:42:20&flight_datetime_to=2026-02-12T21:14:23
    2026-02-12 13:15:42,284 INFO src.fr24.client: FR24 response JSON: {"data": []}
    2026-02-12 13:45:29,809 INFO src.fr24.client: FR24 request URL: /api/flight-summary/light?airports=inbound:YYW&flight_datetime_from=2026-02-12T21:11:29&flight_datetime_to=2026-02-12T21:44:11
    2026-02-12 13:45:30,097 INFO src.fr24.client: FR24 response JSON: {"data": []}
    Code:
    Timestamp,UTC,Callsign,Position,Altitude,Speed,Direction
    1770929658,2026-02-12T20:54:18Z,CFKAH,"48.37635,-89.314636",0,10,236
    1770930714,2026-02-12T21:11:54Z,CFKAH,"48.375137,-89.31237",450,64,71
    Code:
    {"fr24_id":"3e4ef91e","callsign":"CFKAH","first_seen":"2026-02-12T20:54:18Z","datetime_takeoff":"2026-02-12T21:11:54Z","dest_icao":"CYYW","dest_icao_actual":"CYQT"}
    ---

    Example 4: inbound DLL / KDLC (N5001U)

    Code:
    2026-02-14 09:56:49,329 INFO src.fr24.client: FR24 request URL: /api/flight-summary/light?airports=inbound:DLL&flight_datetime_from=2026-02-14T16:51:57&flight_datetime_to=2026-02-14T17:54:58
    2026-02-14 09:56:49,652 INFO src.fr24.client: FR24 response JSON: {"data": []}
    ...
    2026-02-14 12:37:40,350 INFO src.fr24.client: FR24 request URL: /api/flight-summary/light?airports=inbound:DLL&flight_datetime_from=2026-02-14T19:32:48&flight_datetime_to=2026-02-14T20:35:49
    2026-02-14 12:37:40,678 INFO src.fr24.client: FR24 response JSON: {"data": []}
    Code:
    Timestamp,UTC,Callsign,Position,Altitude,Speed,Direction
    1771091653,2026-02-14T17:54:13Z,N5001U,"33.989365,-80.346886",775,95,40
    Code:
    {"fr24_id":"3e564439","callsign":"N5001U","first_seen":"2026-02-14T17:54:13Z","datetime_takeoff":"2026-02-14T17:53:42Z","dest_icao":"KDLC","dest_icao_actual":"KDLC"}
    In this incident I logged 54 request/response pairs for inboundLL; all 54 responses were empty in real time.

    ---

    Example 5: inbound WBG (NAF77, C130) with long ground time

    Code:
    Timestamp,UTC,Callsign,Position,Altitude,Speed,Direction
    1771398091,2026-02-18T07:01:31Z,NAF77,"51.4506,5.382262",0,0,216
    1771406123,2026-02-18T09:15:23Z,NAF77,"51.444458,5.368118",75,108,35
    first_seen -> airborne gap is 2:13:52.

    Code:
    2026-02-17 23:05:04,327 INFO src.fr24.client: FR24 request URL: /api/flight-summary/light?airports=inbound:WBG&flight_datetime_from=2026-02-18T05:59:46&flight_datetime_to=2026-02-18T07:02:47
    2026-02-17 23:05:04,640 INFO src.fr24.client: FR24 response JSON: {"data": []}
    2026-02-18 00:09:00,180 INFO src.fr24.client: FR24 request URL: /api/flight-summary/light?airports=inbound:WBG&flight_datetime_from=2026-02-18T07:03:39&flight_datetime_to=2026-02-18T08:06:43
    2026-02-18 00:09:00,501 INFO src.fr24.client: FR24 response JSON: {"data": []}
    2026-02-18 01:18:54,314 INFO src.fr24.client: FR24 request URL: /api/flight-summary/light?airports=inbound:WBG&flight_datetime_from=2026-02-18T08:13:37&flight_datetime_to=2026-02-18T09:16:37
    2026-02-18 01:18:54,638 INFO src.fr24.client: FR24 response JSON: {"data": []}
    In this incident I logged 76 request/response pairs for inbound:WBG; all 76 were empty.

    ---

    Why this is hard for clients

    To avoid misses, clients have to increase window size significantly. That increases duplicate results and credit cost. A narrow real-time window is efficient but can miss flights when first_seen and matching-field availability are not aligned with actual flight activity.

    Requested API improvements
    Add a selectable time basis for flight_datetime_from / flight_datetime_to. Example: flight_datetime_field=first_seen|last_seen|datetim e_takeoff|datetime_landed.
    Add an update-time query mode. Example: updated_since=<timestamp> or field_changed_since=<timestamp>. This would let clients catch late dest_icao / type / reg assignments without huge windows.
    Add activity-aware filtering with clear timestamp semantics. Example: activity=airborne, min_altitude, min_groundspeed. Optionally apply datetime filtering to the first record that satisfies the activity filter.
    Add assignment timestamps in payload. Example: dest_assigned_at, type_assigned_at, reg_assigned_at. This makes client behavior deterministic and easier to debug.
    Add an active-flight time mode. Example: include flights where last_seen is inside the window (optionally with flight_ended=false).


    Thanks for reviewing. I am trying to build a reliable real-time integration while keeping credit usage efficient.
    Last edited by chanzer0; 2026-02-19, 15:06.

    #2
    Hi! Thank you for your detailed explanation of the issue.

    The approach you are currently using, namely querying the Flight Summary endpoint with a rolling time window, is not producing the expected results primarily because you are tracking general aviation and military flights. For these types of operations, it is typically not possible to reliably determine or predict the expected takeoff time, landing time, or destination in advance.

    It is also important to note that first_seen is the timestamp currently used by the Flight Summary endpoints for time based queries.

    In such cases, the destination field that you are using as a filtering parameter is often populated later during the flight, or sometimes only after landing has been detected. As a result, a real time query with your selected filters may not return results within a time window overlapping the first_seen timestamp. However, running the same query at a later time may return the expected results once the destination has been populated.

    Additionally, if the selected time window does not include the first_seen timestamp, the query will not return results, either in real time or retrospectively.

    This approach tends to work well for regularly scheduled commercial passenger flights, where departure and arrival times and destination airports are known or predictable in advance.

    For live tracking purposes, we recommend using the Live Flight Position endpoints. These endpoints are specifically designed for real time monitoring and allow filtering by parameters such as altitude and ground speed.

    We are currently discussing the possibility of introducing alternative significant flight related timestamps such as datetime_takeoff, datetime_landed, or last_seen in future developments but with no clear timeline for implementation. That said, each of these options would also have certain limitations in your scenario.

    The last_seen field is updated with each new position update, meaning you would likely receive the same flight in consecutive queries for as long as it remains active, similar to the behavior of the Live Flight Position endpoints.

    The datetime_takeoff field would in most cases yield results similar to first_seen, since the destination for the types of flights you are tracking is typically populated later in the flight.

    The datetime_landed field would return the flight only after landing, once this field has been populated.

    We hope this clarifies the behavior you are observing.​

    Comment


      #3
      Thank you for the reply. I do understand the root cause of the issue now with using a rolling time window in conjunction with my query parameters not being set until after the first_seen timestamp has "rolled past" my interval window.

      We are currently discussing the possibility of introducing alternative significant flight related timestamps such as datetime_takeoff, datetime_landed, or last_seen in future developments but with no clear timeline for implementation. That said, each of these options would also have certain limitations in your scenario.
      This makes sense, although I do think it would at least help my situation somewhat. In the examples I posted, especially the inbound:WBG example, the first_seen timestamp is often hours or some significant portion of time earlier than the next reported timestamp in the downloaded CSV files. In these scenarios, I believe the datetime_takeoff would've been sufficient as I had noticed destinations set for these aircraft both on FR24 and Skycards at the time they took off and were airborne. I do recognize that there may still be issues with certain parameters not being set until later in the flight, but I believe it would be an improvement. As far as using last_seen timestamp resulting in instances of the same flight being returned each time that field was updated, I have some notes or suggestions later in this post about possible exclusion parameters that would preclude these duplicate flights from being returned by the API.


      For live tracking purposes, we recommend using the Live Flight Position endpoints. These endpoints are specifically designed for real time monitoring and allow filtering by parameters such as altitude and ground speed.
      I have had success in the past using the live flight position endpoints, however I ran into 2 issues with these endpoints that made my use case really inefficient in terms of credit usage. The first is the obvious: each flight returned in these endpoints incurs 8 credits for the full endpoint, and 6 with the light endpoint, compared to 1 credit on the flight summary endpoints (I also do not have any need for the exact lat/long position of these endpoints, which makes it feel like a waste of credits compared to flight summary endpoints, which have all the data I need. I don't want to track flights live positions, I just want an alert on the first instance of them being airborne with my query parameters). This makes it really expensive (in conjunction with my second point) to run any sort of alerting functionality for flights. The second point is that given any query string parameters (inbound destination, ICAO type, registration number), each subsequent call to the endpoint will continue returning flight data, incurring 8 or 6 credits for the duration of the flight at whatever interval I am polling the endpoint at, which unecessarily drains credits incredibly fast as I have no desire to continue tracking the flight once I know about it.


      I had spoken with the team via support ticket in the past about ways to mitigate this, which if implemented, would probably be efficient enough for me to return to the endpoint. Some technique by which I can pass "exclusion" query paramters (such as fr24's internal flight_id or some other unique identifier) that would exclude flights that have already been returned to me would be ideal here as it would mitigate the issue of spending 8 or 6 credits on flights I have already seen. This exclusion filter could also apply to other endpoints, such as the flight summary light endpoints. If exclusion filters were possible, I would be able to do away with my "rolling window", which has been the root of many of my problems. Any flight that matched my filter parameters at any point in its flight would be returned, I would be notified of it, and would be able to store the flight_id and pass that in subsequent requests.

      Thank you again for your time and response, and look forward to hear any updates about improvements to the API and flight alerting

      Comment

      Working...
      X