FlightAware has many ways to access its API. The fastest we've found is by using client-side scripting (JavaScript). However, since that is entirely viewable in the browser, the API key needs to be hidden. The code to accomplish this is simple PHP utilizing the cURL library. This project is entirely open source and you may use the publicly available JavaScript on your own site in combination with the PHP below, replacing YOURAEROAPIKEY with your FlightAware API key.
$query = $_SERVER["QUERY_STRING"];
$query = substr($query,6);
function queryAeroAPI($url) {
$headers = [
'X-ApiKey : YOURAEROAPIKEY',
'Content-Type: application/json',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $url);
$response = curl_exec($ch);
return $response;
}
$arrJSON = queryAeroAPI("https://aeroapi.flightaware.com/aeroapi/" . $query);
print_r($arrJSON);