Git Product home page Git Product logo

flightradar24-client's Introduction

flightradar24-client

Fetch aircraft data from Flightradar24. Inofficial.

npm version ISC-licensed minimum Node.js version support me via GitHub Sponsors chat with me on Twitter

Installing

npm install flightradar24-client

Usage

radar(north, west, south, east)

The four parameters represent a geographical bounding box (in decimal degrees) with:

  • north: Northern edge latitude
  • west: Western edge longitude
  • south: Southern edge latitude
  • east: Eastern edge longitude
import {fetchFromRadar} from 'flightradar24-client'

const flights = await fetchFromRadar(53, 13, 52, 14)
console.log(flights)
[
	{
		id: '10a6b765',
		registration: 'EI-EGD',
		flight: 'FR8544',
		callsign: 'RYR9XK', // ICAO ATC call signature
		origin: 'STN', // airport IATA code
		destination: 'SXF', // airport IATA code

		latitude: 52.7044,
		longitude: 13.4576,
		altitude: 8800, // in feet
		bearing: 106, // in degrees
		speed: 290, // in knots
		rateOfClimb: -1216, // in ft/min
		isOnGround: false,

		squawkCode: '0534', // https://en.wikipedia.org/wiki/Transponder_(aeronautics)
		model: 'B738', // ICAO aircraft type designator
		modeSCode: '4CA8AF', // ICAO aircraft registration number
		radar: 'T-EDDT1', // F24 "radar" data source ID
		isGlider: false,

		timestamp: 1520538174,
	}
	// …
]

flight(id)

You may use the id from one of the results above to query more details. The output will roughly look like the Friendly Public Transport Format.

import {fetchFlight} from 'flightradar24-client'

const flight = await fetchFlight('e3147c6')
console.log(flight)
{
	id: 'e314807',
	callsign: 'BER839C',
	liveData: true,
	model: 'A320',
	registration: 'D-ABDT',
	airline: 'AB',
	origin: {
		id: 'TXL',
		name: 'Berlin Tegel Airport',
		coordinates: {latitude: 52.560001, longitude: 13.288, altitude: 122},
		timezone: 'Europe/Berlin',
		country: 'DEU',
	},
	destination: {
		id: 'GOT',
		name: 'Gothenburg Landvetter Airport',
		coordinates: {latitude: 57.66283, longitude: 12.27981, altitude: 506},
		timezone: 'Europe/Stockholm',
		country: 'SWE',
	},
	departure: '2017-07-22T17:15:00+02:00',
	scheduledDeparture: '2017-07-22T17:15:00+02:00',
	departureTerminal: null,
	departureGate: 'C40',
	arrival: '2017-07-22T18:35:00+02:00',
	scheduledArrival: '2017-07-22T18:35:00+02:00',
	arrivalTerminal: null,
	arrivalGate: '19A',
	delay: 1757,
}

Related

Contributing

If you have a question or have difficulties using flightradar24-client, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.

flightradar24-client's People

Contributors

dependabot[bot] avatar derhuerst avatar e3v3a avatar greenkeeper[bot] avatar khassel avatar unclephil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flightradar24-client's Issues

An in-range update of tap-min is breaking the build 🚨

The devDependency tap-min was updated from 1.2.2 to 1.3.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

tap-min is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 3 commits.

  • 8a72530 1.3.0
  • 54a776c Tim Eulitz as contributor, minor changes
  • 3481671 Make error output of tap-min more verbose

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of moment-timezone is breaking the build 🚨

Version 0.5.21 of moment-timezone was just published.

Branch Build failing 🚨
Dependency [moment-timezone](https://github.com/moment/moment-timezone)
Current Version 0.5.20
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

moment-timezone is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 2 commits.

  • d711935 Bugfix: revert breaking change
  • 29b5a71 Bugfix: revert breaking change

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Response code 418 from request

Trying to use this library within a React app, and making calls from the app running on localhost yields a 418 response code. Am I missing some setup step, or why is this happening?

An in-range update of tap-min is breaking the build 🚨

Version 1.2.2 of tap-min just got published.

Branch Build failing 🚨
Dependency tap-min
Current Version 1.2.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As tap-min is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 1 commits.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

clarify the meaning of north, west, south, east

Please write more clearly that those numbers actually represent!
I think they mean the bounding box of:

  • Northern edge latitude
  • Western edge longitude
  • Southern edge latitude
  • Easter edge longitude
# radar(north, west, south, east)
const radar = require('flightradar24-client/lib/radar')
radar(53, 13, 52, 14)

The fun part is of course converting distance (in km) to the correct (lat,lon)'s.

An in-range update of moment-timezone is breaking the build 🚨

Version 0.5.15 of moment-timezone was just published.

Branch Build failing 🚨
Dependency moment-timezone
Current Version 0.5.14
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

moment-timezone is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes 0.5.15

0.5.15 2018-04-17

  • Updated data to IANA TZDB 2018d. #596
Commits

The new version differs by 3 commits.

  • e07aa0c Updated version to 0.5.15, added release notes
  • dbfb397 Updated data to IANA TZDB 2018d
  • 9b6555c Update changelog for 0.5.14

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of fetch-ponyfill is breaking the build 🚨

Version 5.0.1 of fetch-ponyfill was just published.

Branch Build failing 🚨
Dependency fetch-ponyfill
Current Version 5.0.0
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

fetch-ponyfill is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 15 commits.

  • 3ed5da4 5.0.1
  • 5956d71 Merge pull request #69 from duclet/typescript-typings
  • 3ac11d1 Merge pull request #74 from qubyte/greenkeeper/eslint-4.18.0
  • ca0e11d chore(package): update eslint to version 4.18.0
  • a66b84e Merge pull request #73 from qubyte/greenkeeper/browserify-16.1.0
  • 882a129 chore(package): update browserify to version 16.1.0
  • 924efed Merge pull request #72 from qubyte/greenkeeper/sinon-4.3.0
  • 2b82525 chore(package): update sinon to version 4.3.0
  • 8aa1e1a Merge pull request #71 from qubyte/greenkeeper/webpack-3.11.0
  • 41b56da chore(package): update webpack to version 3.11.0
  • 584fca5 Simplifying
  • 29ee2a6 Merge pull request #70 from qubyte/greenkeeper/browserify-16.0.0
  • 3182275 chore(package): update browserify to version 16.0.0
  • 06d22c8 Adding Typescript definition file
  • 53419dd Updates history.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

README -- add shebang and command to run the code

Please add some instructions how to use this.
I.e. The steps from git clone, to terminal json output. Perhaps like this:

$  npm install flightradar24-client
...
$ # Edit the file below so that:
$ cat getplanes.js

#!/usr/bin/node
const radar = require('flightradar24-client/lib/radar')
radar(53, 13, 52, 14)
.then(console.log)
.catch(console.error)

$ # Run with:
$ ./getplanes.js

[ { id: '103b6cbc',
    registration: 'D-AKNT',
    flight: 'EW8102',
    callsign: 'EWG8102',
    origin: 'TXL',
    destination: 'BRU',
    latitude: 52.5271,
    longitude: 13.0341,
    altitude: 8450,
    bearing: 254,
    speed: 252,
    model: 'A319',
    modeSCode: '3C6DD4',
    radar: 'F-EDDT2' },
...

Everything else is great. Thanks!

Installation issue

Following your README we get the following error:

$ npm install flightradar24-client
npm WARN saveError ENOENT: no such file or directory, open '/home/pi/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.

+ [email protected]
added 17 packages in 15.042s

Maybe add these files...

An in-range update of pinkie-promise is breaking the build 🚨

Version 2.0.2 of pinkie-promise was just published.

Branch Build failing 🚨
Dependency pinkie-promise
Current Version
</td>
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

pinkie-promise is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

add Typescript types declaration file (.d.ts)

Hey, thank you for your client!

I would like to use it for a TS-based project, but unfortunately since there are no published types, the typescript server throws errors. As a local fix, I manually added a flightradar24-client.d.ts file. Of course, it would be nicer if the types were recognised automatically.

Would you be willing to convert this client to TS or would you accept a PR that does this? As an interim solution, it would also be possible to add this .d.ts file manually, which could look something like this:

{
        "name": "flightradar24-client",
	"files": [
		"index.js",
		"lib"
	],
+	"typings": "types.d.ts",
	"keywords": [
		"aviation",
		"airplanes",
		"flights",
		"flightradar24"
	]
}
// types.d.ts
declare module 'flightradar24-client' {
  function fetchFlight(flight: string): Promise<{
    id: string | null;
    callsign: string | null;
    liveData: boolean;
    model: string | null;
    registration: string | null;
    airline: string | null;
    origin: {
      id: string | null;
      name: string | null;
      coordinates: {
        latitude: number | null;
        longitude: number | null;
        altitude: number | null;
      };
      timezone: string | null;
      country: string | null;
    };
    destination: {
      id: string | null;
      name: string | null;
      coordinates: {
        latitude: number | null;
        longitude: number | null;
        altitude: number | null;
      };
      timezone: string | null;
      country: string | null;
    };
    departure: string | null;
    scheduledDeparture: string | null;
    departureTerminal: string | null;
    departureGate: string | null;
    arrival: string | null;
    scheduledArrival: string | null;
    arrivalTerminal: string | null;
    arrivalGate: string | null;
    delay: number | null;
  }>;

  function fetchFromRadar(
    north: number,
    west: number,
    south: number,
    east: number,
    when?: number,
    opt?: Partial<{
      FAA: boolean;
      FLARM: boolean;
      MLAT: boolean;
      ADSB: boolean;
      inAir: boolean;
      onGround: boolean;
      inactive: boolean;
      gliders: boolean;
      estimatedPositions: boolean;
    }>
  ): Promise<
    {
      id: string;
      registration: string | null;
      flight: string | null;
      callsign: string | null;
      origin: string | null;
      destination: string | null;
      latitude: number;
      longitude: number;
      altitude: number;
      bearing: number;
      speed: number | null;
      rateOfClimb: number;
      isOnGround: boolean;
      squawkCode: string;
      model: string | null;
      modeSCode: string | null;
      radar: string;
      isGlider: boolean;
      timestamp: number | null;
    }[]
  >;
}

api calls are failing with 'forbidden'

I'm not sure if this project is still maintained but since a few days it doesn't work anymore.

Api calls using radar come back with forbidden error.

I think they put your User-Agent header on a black list, when changing this to another value it works again ...

Improvement: Process additional JSON fields

I propose to also process the additional fields given in the JSON.
Currently only these fields are processed:

aircraft.push({
				// 10: timestamp, not needed
				// todo: 6, 14
				id,
				registration: d[9] || null,
				flight: d[13] || null,
				callsign: d[16] || null,
				origin: d[11] || null,
				destination: d[12] || null,
				latitude: d[1],
				longitude: d[2],
				altitude: d[4], // in feet
				bearing: d[3], // in degrees
				speed: d[5], // in knots
				model: d[8] || null,
				modeSCode: d[0] || null,
				radar: d[7]
})

But there are 18 fields (0-17) in total:

,"10572608":[
  "800B9C", 13.3638, 73.6369,
  91, 29500, 450,
  "6231", "F-VOCL1", "B738",
  "VT-GHD",1517871136,"DXB",
  "IXE","IX814",0,
  -2112, "AXB814", 0
]

Of these there are a few additional ones known:

  • d[10] is the Unix Timestamp in Epoch format, which is useful for determining exactly when the data was obtained.
  • d[6] is the 4-digit ATC Squawk code. Very useful for determining if aircraft is a military, in emergency etc.
  • d[15] is the vertical speed in [ft/min].

Then there are two unknowns:

  • d[14] which seem to be either "0|1".
  • d[17] which is always 0 AFAICT.

An in-range update of tape is breaking the build 🚨

Version 4.9.0 of tape was just published.

Branch Build failing 🚨
Dependency tape
Current Version 4.8.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

tape is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 27 commits.

  • ea6d91e v4.9.0
  • 6867840 [Deps] update object-inspect, resolve
  • 4919e40 [Tests] on node v9; use nvm install-latest-npm
  • f26375c Merge pull request #420 from inadarei/global-depth-env-var
  • 17276d7 [New] use process.env.NODE_TAPE_OBJECT_PRINT_DEPTH for the default object print depth.
  • 0e870c6 Merge pull request #408 from johnhenry/feature/on-failure
  • 00aa133 Add "onFinish" listener to test harness.
  • 0e68b2d [Dev Deps] update js-yaml
  • 10b7dcd [Fix] fix stack where actual is falsy
  • 13173a5 Merge pull request #402 from nhamer/stack_strip
  • f90e487 normalize path separators in stacks
  • b66f8f8 [Deps] update function-bind
  • cc69501 Merge pull request #387 from fongandrew/master
  • bf5a750 Handle spaces in path name for setting file, line no
  • 3c2087a Test name with spaces

There are 27 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of tape is breaking the build 🚨

Version 4.9.1 of tape was just published.

Branch Build failing 🚨
Dependency tape
Current Version 4.9.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

tape is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 10 commits.

  • 050b318 v4.9.1
  • 73232c0 [Dev Deps] update js-yaml
  • 8a2d29b [Deps] update has, for-each, resolve, object-inspect
  • c6f5313 [Tests] add eclint and eslint, to enforce a consistent style
  • 45788a5 [Dev Deps] update concat-stream
  • ec4a71d [fix] Fix bug in functionName regex during stack parsing
  • 7261ccc Merge pull request #433 from mcnuttandrew/add-trb
  • 6cbc53e Add tap-react-browser
  • 9d501ff [Dev Deps] use ~ for dev deps; update to latest nonbreaking
  • 24e0a8d Fix spelling of "parameterize"

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of tape is breaking the build 🚨

Version 4.8.0 of tape just got published.

Branch Build failing 🚨
Dependency tape
Current Version 4.7.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As tape is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 4 commits.

  • 342c89a v4.8.0
  • c82c593 [Dev Deps] update js-yaml
  • b50084c [Deps] update resolve, object-inspect
  • bd6db7b updates README.md and adds tap-html

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of moment-timezone is breaking the build 🚨

Version 0.5.18 of moment-timezone was just published.

Branch Build failing 🚨
Dependency [moment-timezone](https://github.com/moment/moment-timezone)
Current Version 0.5.17
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

moment-timezone is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 10 commits.

  • 1c465b7 Added more node.js versions to .travis.yml
  • ccb4174 Fix grunt version to 1.0.2
  • a237e9a Updated version to 0.5.18
  • c3598f4 prefer nodejs to amd declaration
  • 66d8f40 Move moment to peerDependencies
  • 8a35aff Return error if timezone name is not a string
  • ae6eaaa Return more self-explaining error messages when timezone name is not a string
  • 05a93be Ignore latest unpacked data
  • cce8fa6 Update changelog.md
  • 9307dfe Ignore .idea files

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

API call again forbidden

RAAAH !!!
Code installed 7 days ago, and from yesterday (14/07/23) it's again "forbidden".
But they change the detection method.
If I change the user agent i'm still dropped in NodeRed, but if i take a browser with the same public IP , it's ok.
Investigating.

TypeError: Cannot read property 'id' of undefined

Tried to run the example.js with different lat/lon and get the following error:

$ ./testradar.js
TypeError: Cannot read property 'id' of undefined
    at radar.then (/home/pi/testradar.js:10:31)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7)

Legal prosecutions 🤦🏻‍♂️

Hi there, thanks for developing this software @derhuerst.

While investigating how this API works, I found this message:

The contents of this file and all derived data are the property of Flightradar24 AB for use exclusively by its products and applications. Using, modifying or redistributing the data without the prior written permission of Flightradar24 AB is not allowed and may result in prosecutions.

I planned to use FR24 data to enrich information in my platform (feature in development yet). The point is that using this software could make you waste too much money 💸 .

It is perfect for small local tests (and enough).

Also, I contacted FR24 for asking permission for using their data. This is their response:

Thank you for contacting us.

You're right that it's not permitted to scrape our website for integration into other tools - thank you for taking note of this.

We are in the process of developing an API, which should be available towards the end of the year. Please keep an eye on our website for further details.

So be careful guys 😕

can it be used with react-native ?

Hello there,

is this library compatible to be used with react native?
are you planning to implement the UI for flight radar when tracking a flight ?

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.