I have a PHP script to use the API process with CURL as follows -:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, ‘https://aeroapi.flightaware.com/aeroapi/airports/EGKK/flights/departures?max_pages=10’);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, ‘GET’);
$headers = array();
$headers = ‘Accept: application/json; charset=UTF-8’;
$headers = ‘X-Apikey: bbbbbbbbbbbbbbbbbbbbbbb’;
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo ‘Error:’ . curl_error($ch);
}
curl_close($ch);
$data = json_decode($result, true);
// Use the data here
print_r($data);
and the results show this at the end
[links] => Array
(
[next] => /airports/EGKK/flights/departures?max_pages=10&cursor=cee74946540b8ee
)
[num_pages] => 10
In PHP how do I process next set of pages is it another CURL call using the &cursor parameter