JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 23
  • Score
    100M100P100Q69463F
  • License MIT

A client for the Flightradar24 API written in TypeScript

Package Exports

  • flightradar24-client-ts
  • flightradar24-client-ts/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (flightradar24-client-ts) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Getting started

flightradar24-client-ts

npm package Downloads semantic-release Commitizen friendly

Install

npm install flightradar24-client-ts

Usage

Basic Usage

import { FlightRadarApi } from "flightradar24-client-ts";

const flightRadarApi = new FlightRadarApi()
// airports
const airports = await api.fetchAirports();
// airlines
const airlines = await api.fetchAirlines();
// details of a single flight
const flightDetail = await api.fetchFlight("<flight code (ICAO or IATA)>")
// Radar
// get major zones
const zones = await api.fetchZones();
// get flights in a zone
const flights = await api.fetchFromRadar({
  zone: zones[0]
});
// multi-zone flight fetch
const multizoneFlights = await api.fetchFromRadarMultiZone(zones);

Filtering live flights

import { FlightRadarApi } from "flightradar24-client-ts";

const flightRadarApi = new FlightRadarApi();

interface LiveFilters {
  /**
   * The airline ICAO code to fetch aircraft from (e.g. AFR for Air France)
   */
  airline?: string[];
  /**
   * The call signs to fetch aircraft from (e.g.SFR850)
   */
  callsign?: string[];
  /**
   * The flight numbers to fetch aircraft from (e.g. FA850)
   */
  flight?: string[];
  /**
   * The aircraft registration numbers to fetch aircraft from (e.g. F-GZNP)
   */
  reg?: string[];
  /**
   * The aircraft model codes to fetch aircraft from (e.g. A320)
   */
  type?: string[];
  /**
   * The Airports ICAO codes to fetch aircraft from (e.g. LFPG)
   */
  airport?: string[];
}

export interface RadarOptions {
  /**
   * The zone to fetch aircraft from. If not specified, the entire world is used.
   */
  zone?: ZoneData;
  /**
   * Whether to fetch inactive aircraft
   */
  inactive?: boolean;
  /**
   * Whether to fetch aircraft on ground
   */
  onGround?: boolean;
  /**
   * Whether to fetch gliders
   */
  gliders?: boolean;
  /**
   * Whether to fetch aircraft from the MLAT data source
   */
  MLAT?: boolean;
  /**
   * Whether to fetch aircraft from the FAA data source
   */
  FAA?: boolean;

  /**
   * Whether to fetch aircraft from the satellite data source
   */
  satellite?: boolean;
  /**
   * Whether to fetch vehicles
   */
  vehicles?: boolean;
  /**
   * Whether to fetch estimated positions
   */
  estimatedPositions?: boolean;
  /**
   * Whether to fetch aircraft from the FLARM data source
   */
  FLARM?: boolean;
  /**
   * Whether to fetch aircraft from the ADS-B data source
   */
  ADSB?: boolean;
  /**
   * Whether to fetch airborne aircraft
   */
  inAir?: boolean;
  /**
   * The filters to apply to the aircraft data
   */
  filters?: LiveFilters;
}


const radarOptions: RadarOptions = {
  // Filters
};
const flights = flightRadarApi.fetchFromRadar({
  radarOptions
});
  • Example: Filtering Flights related to JFK Airport
import { defaultRadarOptions, FlightRadarApi } from "flightradar24-client-ts";

const flightRadarApi = new FlightRadarApi();
const flightsJFK = flightRadarApi.fetchFromRadar({
  ...defaultRadarOptions,
  filters: {
    airport: ["JFK"]
  }
});

API

Api docs can be found here

Example Project

Flight Tracker

img.png This project uses the flightradar24-client-ts to fetch flights from the radar and display them on a 3d globe. It can also filter the flights based on the user's input.