Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flightradar24-client-ts

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flightradar24-client-ts

A client for the Flightradar24 API written in TypeScript

  • 1.2.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

FAQs

Package last updated on 19 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc