npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

flightradar24-client-ts

v1.3.2

Published

A client for the Flightradar24 API written in TypeScript

Downloads

35

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.

  • link to the project: https://gitlab.com/dev6645326/react-flight-tracker
  • link to the live demo: https://react-flight-tracker.apoorva64.com/