cloudflare worker to scrape flightaware's flight data and aggregate data from adsb.lol and airportdb.
The worker is currently deployed @ avion.notri1.workers.dev
- Bun installed locally
-
Clone the repository:
git clone https://github.com/Paylicier/avion.git cd avion -
Install dependencies:
bun install
-
Set your airportdb api key in src/services/airportdb.ts
-
Start the development server:
bun run dev
The app will be accessible at http://localhost:8787
-
Clone the repository:
git clone https://github.com/Paylicier/avion.git cd avion -
Install dependencies:
bun install
-
Set your airportdb api key in src/services/airportdb.ts
-
run
bunx wrangler deploy -
follow the instructions
Request:
GET /Response:
{ "status": "success" }Request:
GET /flight/:flightId (e.g. /flight/DAL67 or /flight/DAL67-1786766834)Response:
{
"id": "DAL67",
"internalId": "DAL67-1786766834",
"status": "airborne",
"cancelled": false,
"diverted": false,
"airline": {
"name": "Delta Air Lines, Inc.",
"icao": "DAL",
"iata": "DL"
},
"origin": {
"name": "Leonardo da Vinci Int'l (Fiumicino Int'l)",
"icao": "LIRF",
"iata": "FCO",
"lat": 41.8045,
"lon": 12.2508,
"location": "Rome, Italy",
"terminal": "3",
"gate": "E13"
},
"destination": {
"name": "Hartsfield-Jackson Intl",
"icao": "KATL",
"iata": "ATL",
"lat": 33.6367,
"lon": -84.4279,
"location": "Atlanta, GA",
"terminal": "I",
"gate": "F8"
},
"aircraft": {
"type": "A339",
"lifeguard": false,
"heavy": false,
"tail": null,
"owner": null,
"ownerLocation": null,
"owner_type": null,
"canMessage": false,
"friendlyType": "Airbus A330-900 (twin-jet)",
"typeDetails": {
"manufacturer": "Airbus",
"model": "A330-900",
"type": "twin-jet",
"engCount": "2",
"engType": "jet"
}
},
"times": {
"gateDeparture": {
"scheduled": 1786965000,
"estimated": 1786965000,
"actual": 1786966140
},
"takeoff": {
"scheduled": 1786965600,
"estimated": 1786968120,
"actual": 1786968120
},
"landing": {
"scheduled": 1787001780,
"estimated": 1787004120,
"actual": null
},
"gateArrival": {
"scheduled": 1787004960,
"estimated": 1787004720,
"actual": null
}
}
}
}Request:
GET /history/:flightIdResponse:
[
{
"id": "DAL67",
"internalId": "DAL67-1786939631",
"status": "",
"cancelled": false,
"diverted": false,
"airline": {
"name": "Delta Air Lines, Inc.",
"icao": "DAL",
"iata": "DL"
},
"origin": {
"name": "Leonardo da Vinci Int'l (Fiumicino Int'l)",
"icao": "LIRF",
"iata": "FCO",
"lat": 41.8045,
"lon": 12.2508,
"location": "Rome, Italy",
"terminal": "3",
"gate": null
},
"destination": {
"name": "Hartsfield-Jackson Intl",
"icao": "KATL",
"iata": "ATL",
"lat": 33.6367,
"lon": -84.4279,
"location": "Atlanta, GA",
"terminal": "I",
"gate": null
},
"aircraft": {
"type": "A339",
"lifeguard": false,
"heavy": false,
"tail": null,
"owner": null,
"ownerLocation": null,
"owner_type": null,
"canMessage": false,
"friendlyType": "Airbus A330-900 (twin-jet)",
"typeDetails": {
"manufacturer": "Airbus",
"model": "A330-900",
"type": "twin-jet",
"engCount": "2",
"engType": "jet"
}
},
"times": {
"gateDeparture": {
"scheduled": 1787137800,
"estimated": 1787137800,
"actual": null
},
"takeoff": {
"scheduled": 1787138400,
"estimated": 1787138400,
"actual": null
},
"landing": {
"scheduled": 1787177160,
"estimated": 1787177160,
"actual": null
},
"gateArrival": {
"scheduled": 1787177760,
"estimated": 1787177760,
"actual": null
}
}
},
{
"id": "DAL67",
"internalId": "DAL67-1786853230",
"status": "",
"cancelled": false,
"diverted": false,
"airline": {
"name": "Delta Air Lines, Inc.",
"icao": "DAL",
"iata": "DL"
},
"origin": {
"name": "Leonardo da Vinci Int'l (Fiumicino Int'l)",
"icao": "LIRF",
"iata": "FCO",
"lat": 41.8045,
"lon": 12.2508,
"location": "Rome, Italy",
"terminal": "3",
"gate": "E13"
},
"destination": {
"name": "Hartsfield-Jackson Intl",
"icao": "KATL",
"iata": "ATL",
"lat": 33.6367,
"lon": -84.4279,
"location": "Atlanta, GA",
"terminal": "I",
"gate": "E16"
},
"aircraft": {
"type": "A339",
"lifeguard": false,
"heavy": false,
"tail": null,
"owner": null,
"ownerLocation": null,
"owner_type": null,
"canMessage": false,
"friendlyType": "Airbus A330-900 (twin-jet)",
"typeDetails": {
"manufacturer": "Airbus",
"model": "A330-900",
"type": "twin-jet",
"engCount": "2",
"engType": "jet"
}
},
"times": {
"gateDeparture": {
"scheduled": 1787051400,
"estimated": 1787051400,
"actual": null
},
"takeoff": {
"scheduled": 1787052000,
"estimated": 1787052000,
"actual": null
},
"landing": {
"scheduled": 1787089620,
"estimated": 1787089620,
"actual": null
},
"gateArrival": {
"scheduled": 1787091360,
"estimated": 1787090220,
"actual": null
}
}
}
]}
]Request:
GET /flight/:flightId/locationResponse:
{
"status": "airborne",
"speed": 452,
"altitude": 35975,
"route": "PATSS7 PATSS NELIE BIZEX Q75 GSO BURGG Q22 TWOUP Q22 CATLN Q56 SJI MNSTR2",
"origin": "KBOS",
"destination": "KMSY",
"hex": "a358bd",
"lat": 41.134369,
"lon": -73.827271
}}Request:
GET /airport/:icaoCodeResponse:
{
"name": "Charles de Gaulle International Airport",
"iata": "CDG",
"icao": "LFPG",
"city": "Paris",
"country": "FR",
"lat": 49.012798,
"lon": 2.55,
"elevation": "392",
"link": "http://www.aeroportsdeparis.fr/",
"wikipedia": "https://en.wikipedia.org/wiki/Charles_de_Gaulle_Airport",
"image": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/ba/Paris_A%C3%A9roport_logo.svg/1280px-Paris_A%C3%A9roport_logo.svg.png",
"weather": {
"temp": 26.7,
"isRaining": false,
"windSpeed": 20.7,
"windDirection": 309,
"precipitation": 0,
"isDay": true
},
"inbound": [
"AEE452",
"AFR7341",
"EZY7073"
],
"outbound": [
"T7AVB",
"AFR332",
"AFR1822"
]
}
}- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is available under GNU Affero General Public License v3
Please read the license carefully before using this software. If you have any questions about licensing, please open an issue.
Airport data is from ourairport.
Plane location data is from adsb.lol.
Flight data is from flightaware.
Images are from wikipedia.
Weather data from open-meteo.