DEV Community

Cover image for Replay a Flight After It Lands: Historical Flight Tracker API
Aviation Edge
Aviation Edge

Posted on

Replay a Flight After It Lands: Historical Flight Tracker API

For developers, historical flight data opens up a more useful layer of analysis. Instead of working with only a final flight status, you can work with timestamped aircraft positions, altitude changes, speed values, route movement, ground status, and aircraft identifiers after the flight is completed.

The Aviation Edge Historical Flight Tracker API provides past flight movement data through a REST API. It returns recorded aircraft positions, altitude, direction, speed, timestamps, airline details, aircraft identifiers, route information, and final flight status.

In this article, we will look at what the API returns, how developers can work with the data, and what you can build with past flight tracker data.

Historical Flight Tracker API


What The API Returns

The Historical Flight Tracking API is built for retrieving detailed position data for past flights.

A response includes:

  • Departure and arrival airport codes
  • Scheduled departure and arrival times
  • Airline IATA and ICAO codes
  • Flight IATA and ICAO numbers
  • Aircraft ICAO24, aircraft type code, and registration number
  • Final flight status
  • Squawk information when available
  • A flightPositions array with recorded movement points

Each item in the flightPositions array represents a point in the aircraft’s journey.

Those position points include:

  • latitude
  • longitude
  • altitude
  • direction
  • horizontal speed
  • vertical speed
  • ground/airborne status
  • timestamp

That makes the API useful for rebuilding a past flight path, plotting aircraft movement on a map, or analyzing how a flight progressed from gate to gate.


Example Request

Here is an example request for historical tracking data for a flight from London Heathrow.

GET https://aviation-edge.com/v2/public/flight_track_history?key=YOUR_API_KEY&depIata=LHR&flightIata=BA203&depDate=2025-10-20
Enter fullscreen mode Exit fullscreen mode

You can review the full parameter list and API specs in the Historical Flight Tracker API documentation.

Example Output

[
  {
    "aircraft": {
      "icao24": "40749B",
      "icaoCode": "B789",
      "regNumber": "G-ZBKR"
    },
    "airline": {
      "iataCode": "BA",
      "icaoCode": "BAW"
    },
    "arrival": {
      "iataNumber": "BOS",
      "icaoNumber": "KBOS",
      "scheduledTime": "2025-10-20T20:10:00.000"
    },
    "departure": {
      "iataNumber": "LHR",
      "icaoNumber": "EGLL",
      "scheduledTime": "2025-10-20T17:35:00.000"
    },
    "flight": {
      "iataNumber": "BA203",
      "icaoNumber": "BAW50G"
    },
    "flightPositions": [
      {
        "altitude": "0.00",
        "direction": "90.00",
        "horizontal_speed": "1.85",
        "isGround": 1,
        "latitude": "51.469400",
        "longitude": "-0.471700",
        "updated": 1760978610,
        "vspeed": "0.00"
      },
      {
        "altitude": "0.00",
        "direction": "90.00",
        "horizontal_speed": "0.00",
        "isGround": 1,
        "latitude": "51.469400",
        "longitude": "-0.471700",
        "updated": 1760978792,
        "vspeed": "0.00"
      },
...
...
      {
        "altitude": "0.00",
        "direction": "33.00",
        "horizontal_speed": "33.34",
        "isGround": 1,
        "latitude": "42.365300",
        "longitude": "-71.012400",
        "updated": 1761004300,
        "vspeed": "0.00"
      },
      {
        "altitude": "0.00",
        "direction": "303.00",
        "horizontal_speed": "11.11",
        "isGround": 1,
        "latitude": "42.373000",
        "longitude": "-71.018500",
        "updated": 1761004451,
        "vspeed": "0.00"
      }
    ],
    "status": "landed",
    "system": {
      "squawk": null,
      "updated": 1761004451
    }
  }
]
Enter fullscreen mode Exit fullscreen mode

The flightPositions array is updated with recorded position points throughout the flight, typically at around 10-minute intervals, and added to the output as part of the historical flight track.

Field Description
latitude / longitude Aircraft position
altitude Aircraft altitude
direction Direction of travel
horizontal_speed Horizontal speed
vspeed Vertical speed
isGround Whether the aircraft is on the ground
updated Unix timestamp for that position point

Fetching Historical Flight Data in JavaScript

Here is a basic Axios example.

const axios = require("axios");

const API_KEY = "YOUR_API_KEY";

const endpoint = `https://aviation-edge.com/v2/public/flight_track_history?key=${API_KEY}&depIata=LHR&flightIata=BA203&depDate=2025-10-20`;

async function fetchHistoricalFlight() {
  try {
    const response = await axios.get(endpoint);
    return response.data;
  } catch (error) {
    console.error("Error fetching historical flight data:", error.message);
    return null;
  }
}

fetchHistoricalFlight().then((data) => {
  if (!data || data.length === 0) {
    console.log("No historical flight data found.");
    return;
  }

  console.log(data[0]);
});
Enter fullscreen mode Exit fullscreen mode

Extracting the Flight Path

To plot the aircraft path on a map, you usually only need latitude and longitude from each position point. The output can be passed into a mapping library such as Leaflet, Mapbox, or Google Maps to draw the route.

function getFlightPath(flight) {
  return flight.flightPositions.map((point) => ({
    lat: Number(point.latitude),
    lng: Number(point.longitude),
    timestamp: point.updated
  }));
}

fetchHistoricalFlight().then((data) => {
  const flight = data[0];
  const path = getFlightPath(flight);

  console.log(path);
});
Enter fullscreen mode Exit fullscreen mode

Finding the Max Altitude

A simple way to find the highest recorded altitude in the position array.

function getMaxAltitude(flight) {
  return Math.max(
    ...flight.flightPositions.map((point) => Number(point.altitude))
  );
}

fetchHistoricalFlight().then((data) => {
  const flight = data[0];

  console.log("Max altitude:", getMaxAltitude(flight));
});
Enter fullscreen mode Exit fullscreen mode

Example Use Cases for Past Flight Track Data

Historical flight tracking data can be used in many aviation and data products.

Flight Replay: Use the latitude, longitude, altitude, speed, and timestamp fields to replay a flight on a map after it has landed and visualize a past flight.

Flight Analytics: Analyze altitude changes, speed changes, route shape, ground movement and airborne movement.

Airline or Airport Dashboards: Build dashboards showing past flight movement data for specific flights, airlines, airports, or aircraft.

Aircraft History Tools: Use aircraft registration number or ICAO24 filters to review past aircraft movement data for a specific aircraft.


Bringing Past Flights Back to Life - All With Data!

The Aviation Edge Historical Flight Tracking API is designed for developers who need more than a static flight record.

It gives you timestamped aircraft movement data that can be mapped, replayed, filtered, stored, and analyzed.

Whether you are building a flight replay tool, an aviation dashboard, an aircraft history feature, or a route analysis product, past flight tracking data gives you the raw movement layer behind a completed flight.

You can explore the Historical Flight Tracker API firsthand by getting your personal API key here.


Aviation Edge

Top comments (0)