FlightAware Discussions

Help for using SetMaximumResultSize

i want to change the default value of howmany to 30 and in the documentation i have to change SetMaximumResultSize with max_size=30 ,and i want to know where i can change this value ,something like this:
$queryParams = array(
‘airport’ => ‘DIAP’,
‘howMany’ => 20,
‘filter’ => ‘airline’,
‘offset’ => 0,
‘max_size’ => 20
);

SetMaximumResultSize does not change the default howMany, it allows for a larger howMany up to the maximum size to be specified in query.

After SetMaximumResultSize is called a larger howMany should be set by your application for each query you want a larger result set for.

Ok thank you but i don’t know where i have to change SetMaximumResultSize , i use departed in my code

$username = “username”;
$apiKey = “myapi”;
$fxmlUrl = “https://flightxml.flightaware.com/json/FlightXML2/”;

//POUR LES DEPARTS
$queryParams = array(
‘airport’ => ‘DIAP’,
‘howMany’ => 20,
‘filter’ => ‘airline’,
‘offset’ => 0,
);

$url = $fxmlUrl . ‘Departed?’ . http_build_query($queryParams);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERPWD, $username . ‘:’ . $apiKey);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);

this my code and i don’t know where i can put setMaximumResultsize with max_size=30

SetMaximumResultSize is a separate endpoint with it’s own query parameters. Once set the value will not change until it is called again with a new value. It should be called before the Departed endpoint is called.

hello,
i try to call SetMaximumResultSize but i can’t have more than 20 queries

$Params = array(
‘max_size’ => 100
);

$url2 = $fxmlUrl .‘SetMaximumResultSize?’ .http_build_query($Params);

$queryParams = array(
‘airport’ => ‘DIAP’,
‘howMany’ => 100

);

$url = $fxmlUrl . ‘Departed?’. http_build_query($queryParams);

Please remember to observe the next_offset value in the response body. If the value is -1 there are no more results.

The Departed endpoint only returns departure events over the last 24 hours from time of query. If less results are returned than the howMany and the next_offset is -1 then there are less actual departures than requested.