ADSBexchange.com API Data Access Points
All aircraft X nautical miles from a point ( 100NM maximum )
https://adsbexchange.com/api/aircraft/lat/51.5005/lon/-0.1145/dist/100/
Aircraft by mode-s code
https://adsbexchange.com/api/aircraft/icao/123abc/
Aircraft by call sign
https://adsbexchange.com/api/aircraft/call/DAL1234/
CODE SAMPLES
C (libcurl)
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://adsbexchange.com/api/aircraft/lat/51.5005/lon/-0.1145/dist/100/"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "api-auth: your-uuid"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
Go (New Request)
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://adsbexchange.com/api/aircraft/lat/51.5005/lon/-0.1145/dist/100/" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("api-auth", "your-uuid") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
PHP (HTTP v2)
$client = new http\Client; $request = new http\Client\Request; $request->setRequestUrl('https://adsbexchange.com/api/aircraft/lat/51.5005/lon/-0.1145/dist/100/'); $request->setRequestMethod('GET'); $request->setHeaders(array( 'api-auth' => 'your-uuid', )); $client->enqueue($request)->send(); $response = $client->getResponse(); echo $response->getBody()
PHP (cURL)
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://adsbexchange.com/api/aircraft/lat/51.5005/lon/-0.1145/dist/100/", CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "api-auth: your-uuid" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
Python (requests)
import requests headers = { 'api-auth': "your uuid" } response = requests.get('https://adsbexchange.com/api/aircraft/lat/51.5005/lon/-0.1145/dist/100/', headers = headers) data = response.text
R / Math
library(httr)
library(jsonlite)
library(dplyr)
uuid <- "your-uuid" query_all <- "https://adsbexchange.com/api/aircraft/lat/51.5005/lon/-0.1145/dist/100/"
all_aircraft <- GET(query_all, add_headers("api-auth" = uuid)) %>% content(as="text") %>% fromJSON() all_aircraft.details <- all_aircraft$ac %>% as_tibble() %>% mutate(postime = postime %>% as.numeric %>% (function(x){x/1000}) %>% as.POSIXct(tz="UTC", origin="1970-01-01 00:00"))