A simple API for avgeeks: use the 24-bit ICAO hex code or callsign from your ADS-B receiver to get the aircraft, its route and the airports it flies between. See it in action on the live map.
Press Send to call the API.
Base URL https://hexdb.io/api/v2. Every lookup is a GET on a resource, every response is JSON (errors too), lookups are case-insensitive, and missing values are null rather than empty strings.
Look up an aircraft by its 24-bit ICAO address (Mode-S hex, 6 characters), or search by registration. images is null when there's no photo.
{"hex":"4010EE","registration":"G-EZBZ","manufacturer":"Airbus","type":"A319 111","icao_type_code":"A319","registered_owner":"easyJet Airline","operator_flag_code":"EZY","images":{"full":"https://hexdb.io/static/aircraft-images/G-EZBZ.jpg","thumbnail":"https://hexdb.io/static/aircraft-images/G-EZBZ-thumb.jpg"},"links":{"self":"/api/v2/aircraft/4010EE"}}
{"error":{"status":404,"code":"aircraft_not_found","message":"No aircraft with hex code 000000."}}
{"count":1,"results":[{"hex":"4010EE","registration":"G-EZBZ","...":"..."}]}
A registration search always returns a list (empty if nothing matches), because a registration can be reused by more than one airframe.
Redirects (302) straight to the photo, so you can use the URL as an image source. Returns a JSON 404 when there's no photo.
<img src="https://hexdb.io/api/v2/aircraft/4010EE/image/thumbnail">
Look up an airport by its 4-letter ICAO code or 3-letter IATA code. The code type is worked out from its length.
{"icao":"EGLL","iata":"LHR","name":"Heathrow Airport","country_code":"GB","region":"England","latitude":51.4706,"longitude":-0.461941}
{"error":{"status":404,"code":"airport_not_found","message":"No airport with ICAO code AAAA."}}
Look up the route flown under an ICAO callsign (as broadcast over ADS-B, e.g. EIN17A). Each airport comes with both its ICAO and IATA codes. airports lists every stop in order, for multi-leg routes.
{"callsign":"EIN17A","origin":{"icao":"EIDW","iata":"DUB","name":"Dublin Airport","country_code":"IE","region":"Dublin","latitude":53.4213,"longitude":-6.27007},"destination":{"icao":"EGLL","iata":"LHR","name":"Heathrow Airport","country_code":"GB","region":"England","latitude":51.4706,"longitude":-0.461941},"airports":[{"icao":"EIDW","iata":"DUB","...":"..."},{"icao":"EGLL","iata":"LHR","...":"..."}],"updated_at":"2014-04-20T11:02:19Z"}
{"error":{"status":404,"code":"route_not_found","message":"No route for callsign ABC123."}}
Errors use the HTTP status code and the same JSON shape. code is stable and safe to match on; message is for humans.
| Status | When |
|---|---|
| 400 | The value isn't valid, e.g. a hex code that isn't 6 hex characters |
| 404 | Nothing found, or the path doesn't exist |
| 405 | Anything other than GET |
{"error":{"status":400,"code":"invalid_hex_code","message":"'XYZ' is not a valid hex code."}}
v1 and the legacy endpoints keep working. Here's where each one lives in v2.
| Old | v2 |
|---|---|
| /api/v1/aircraft/{hex} | /api/v2/aircraft/{hex} |
| /hex-reg, /hex-type, /hex-airline | registration, type, registered_owner in /api/v2/aircraft/{hex} |
| /reg-hex | /api/v2/aircraft?registration={reg} |
| /hex-image, /hex-image-thumb | /api/v2/aircraft/{hex}/image[/thumbnail] |
| /api/v1/airport/icao|iata/{code} | /api/v2/airports/{code} |
| /icao-iata, /iata-icao, /icao-airport, /iata-airport | icao, iata, name in /api/v2/airports/{code} |
| /api/v1/route/icao|iata/{callsign} | /api/v2/routes/{callsign} |
| /callsign-route, /callsign-origin_*, /callsign-des_* | origin, destination in /api/v2/routes/{callsign} |
Still supported. Every response is JSON and unknown values return a 404. New projects should use v2. Also served without the version, e.g. /api/aircraft/{hex}.
Look up an aircraft by its 24-bit ICAO / Mode-S hex code.
{"ICAOTypeCode":"A319","Manufacturer":"Airbus","ModeS":"4010EE","OperatorFlagCode":"EZY","RegisteredOwners":"easyJet Airline","Registration":"G-EZBZ","Type":"A319 111"}
{"status":"404","error":"Aircraft not found."}
Look up a flight's route from its callsign, with the airports as ICAO or IATA codes.
{"flight":"EIN17A","route":"EIDW-EGLL","updatetime":1397991739}
{"status":"404","error":"Route not found."}
Look up an airport by its ICAO or IATA code.
{"airport":"Heathrow Airport","country_code":"GB","iata":"LHR","icao":"EGLL","latitude":51.4706,"longitude":-0.461941,"region_name":"England"}
{"status":"404","error":"Airport not found."}
The original endpoints. Each returns a single plain-text value, or n/a with a 404 when nothing is found. Still supported (including the old .php URLs), but new projects should use v2.
Various conversions using the ICAO / Mode-S hex.
Convert a callsign to its flight route (e.g. EGLL-LEBL), with ICAO or IATA airport codes.
Convert between IATA and ICAO airport codes, or get the airport name.
Return the URL of an aircraft's photo as plain text.