I am required to find the next flight from an airport after a specific time. e.g. next flight from Heathrow after 17:10:14. I can get the information using /airports/{id}/flights/departures by setting 17:10:14 as my start time, but because of the sort order, my record is always last.
Let’s say I look for an hour’s worth of departures. My problem is if the airport is busy, I have to go through many pages to get to my record, or if the airport is quiet, I get no results. Increasing or decreasing the time range fixes one problem but exacerbates the other.
Is there an alternative URL, or technique that I have missed?
Do an advanced search with a query of something like: {= orig KLAX} {> edt 1706640998}
Substitute the actual airport and epoch timestamp you need to start listing flights from.
Thank you for replying. The advanced search still has the same problem - the results come with the latest flights first, meaning the flight I seek will always be on the last page, so occasionally, I will waste a few API calls.
I am probably overthinking it. When I am running in real-time, my cutoff time will be much closer, and I probably will always get my flight on the first page.
Unfortunately, there is no current way to change the sort order of the returned results. Paging through the results from either of those functions is probably what you will need to do. If you are able to specify other filtering criteria (such as same ident or same airline portion of the ident) then you might be able to ensure that the results are short enough to returned on the first page of results.