SetMaximumResultSize method not working


#1

I’m trying to set the maximum records returned for a query using following code (c# .net) But it’s not working.

It’s always returning the 15 records for Scheduled and Arrived queries But I want to get all records in single query.

Please help me to resolve the issue or let me know if there’s any other way I can achieve it?

        string url = string.Format("http://flightxml.flightaware.com/json/FlightXML2/SetMaximumResultSize?max_size={0}", 24);

        WebRequest webRequest = WebRequest.Create(url);

        webRequest.Credentials = new NetworkCredential("****", "*******");

        WebResponse response = webRequest.GetResponse();

#2

Our database indicates that “24” is currently your max_result_size setting, so the call is succeeding.

Note that when you call Scheduled and Arrived (or any other function that takes a howMany argument), you must still actually specify the number of results you want. If you leave that argument blank, then the default of 15 will generally still be enforced.


#3

Thanks It’s resolved now But now I’ve another issue

flightxml.flightaware.com/json/F … 0&offset=0

flightxml.flightaware.com/json/F … 0&offset=0

I get timeout exception when 2nd query is fired after 1st - Can you please have a look into it?

{“The operation has timed out”}


#4

Does it only occur when it follows the first query? You might have a problem with your WebRequest object being reused for the second request. Try destroying and recreating the WebRequest, or disable “keep alive”?


#5

Yes it occurs when it follows the first query…First query is Departure and 2nd query for Arrival for same airport and doen’t matter which order two queries are fired it’s always timeout on second one.

I create the new Webrequest object each time - looks like some issue from server …do I need to wait before firing second request or anything n the code preventing it?


#6

We do not intentionally limit the query frequency. I still suspect this is an unintentional interaction with connection re-use.

Can you try adding a HTTP header to the request of “Connection: close” and see if that makes a difference? I agree this shouldn’t be necessary, but I don’t think we’ve seen any other similar reports to this before.


#7

Thanks for the help

That issue is resolved But I have another problem now …as part of ArrivalFlightStruct and ScheduledFlightStruct for origin and destination the API send back ICAO airport code But I need IATA code.

Is there anyway I can get that or covert from ICAO to IATA?


#8

We standardize on ICAO codes since there is less ambiguity and no duplicate code assignments around the world that way.

However, you can download the complete airport list with both ICAO and IATA codes from here, and then use that in a local database to translate the codes on your side: flightaware.com/commercial/data


#9

I’ve another issues now for some of the flights for arrival query API gives me departure time instead of arrival time in actualarrivaltime filed

for example :
FlightNumber DepartureAirport ArrivalAirport ArrvialDate time

BBC27 VGEG OMAA 13/01/2015 15:17 UTC (BDT - 6) or 09:17PM BDT

Arrival time should be 11:15PM GST OR 19:15 PM UTC

The link flightaware.com/live/flight/BBC27 shows correct information.

Please have a look and let me know


#10

The significance of flights with actualarrivaltime==actualdeparturetime is actually a special case of flights that we have detected a departure, but have not received enough criteria to trigger an arrival but enough time has passed beyond its expected arrival time and we are not receiving position information for it anymore.

Our website handles such flights by displaying the “Status” as “result unknown”. If you look at the flight status for BBC27, you’ll see a “(?)” next to the arrival column in the bottom and “result unknown” in the status.


#11

How can I filter those flights from API call results?


#12

If you want to ignore those results you must do that within your application code. They are still technically valid flights that did fly–we just have incomplete information to say with certainty that they landed.