api.adsbdb.com
public aircraft & flightroute api
Built in Rust for Docker, using PostgreSQL & Redis
See typescript branch for original typescript version
check adsbdb twitter for any status updates
Please report any incorrect data to the issues page, with the Data tag.
With thanks to;
Routes
https://api.adsbdb.com/v[semver.major]/aircraft/[MODE_S]
{
"response":{
"aircraft":{
"type": string,
"icao_type": string,
"manufacturer": string,
"mode_s": string,
"n_number": string,
"registered_owner_country_iso_name": string,
"registered_owner_country_name": string,
"registered_owner_operator_flag_code": string,
"registered_owner": string,
"url_photo":string || null,
"url_photo_thumbnail":string || null
}
}
}
Unknown aircraft return status 404 with
{ "response": "unknown aircraft"}
Convert from MODE-S string to N-Number string https://api.adsbdb.com/v[semver.major]/mode-s/[MODE_S]
{
"response": string
}
Convert from N-Number string to Mode_S string https://api.adsbdb.com/v[semver.major]/n-number/[N-NUMBER]
{
"response": string
}
https://api.adsbdb.com/v[semver.major]/callsign/[CALLSIGN]
{
"response": {
"flightroute":{
"callsign": string,
"origin": {
"country_iso_name": string,
"country_name": string,
"elevation": number,
"iata_code": string,
"icao_code": string,
"latitude": number,
"longitude": number,
"municipality": string,
"name": string,
},
"destination": {
"country_iso_name": string,
"country_name": string,
"elevation": number,
"iata_code": string,
"icao_code": string,
"latitude": number,
"longitude": number,
"municipality": string,
"name": string,
}
}
}
}
For a small number of flightroutes, midpoints are also included
{
"midpoint": {
"country_iso_name": string,
"country_name": string,
"elevation": number,
"iata_code": string,
"icao_code": string,
"latitude": number,
"longitude": number,
"municipality": string,
"name": string,
}
}
Unknown callsign return status 404 with
{ "response": "unknown callsign"}
https://api.adsbdb.com/v[semver.major]/aircraft/[MODE_S]?callsign=[CALLSIGN]
{
"response": {
"aircraft":{
"type": string,
"icao_type": string,
"manufacturer": string,
"mode_s": string,
"n_number": string,
"registered_owner_country_iso_name": string,
"registered_owner_country_name": string,
"registered_owner_operator_flag_code": string,
"registered_owner": string,
"url_photo":string || null,
"url_photo_thumbnail":string || null
},
"flightroute":{
"callsign": string,
"origin": {
"country_iso_name": string,
"country_name": string,
"elevation": number,
"iata_code": string,
"icao_code": string,
"latitude": number,
"longitude": number,
"municipality": string,
"name": string,
},
"destination": {
"country_iso_name": string,
"country_name": string,
"elevation": number,
"iata_code": string,
"icao_code": string,
"latitude": number,
"longitude": number,
"municipality": string,
"name": string,
}
}
}
}
If an unknown callsign is provided as a query param, but the aircraft is known, response will be status 200 with just aircraft
Download
See releases
download (x86_64_musl one liner)
wget https://www.github.com/mrjackwills/adsbdb/releases/latest/download/adsbdb_linux_x86_64_musl.tar.gz &&
tar xzvf adsbdb_linux_x86_64_musl.tar.gz adsbdb
Run
Operate docker compose containers via
./run.sh
Tests
Requires postgres & redis to both be operational and seeded with valid data
# Watch
cargo watch -q -c -w src/ -x 'test -- --test-threads=1 --nocapture'
# Run all
cargo test -- --test-threads=1 --nocapture