I am trying to use FlightAware’s API to get the flights (or scheduled flights) departing from a single airport within a defined time period.
Example: Get all flights departing from OEDF from Monday 9 AM UTC to Monday 11 AM UTC (Period of 2 hours).
I thought the API: AirlineFlightSchedules is suitable. When I call it, I get unexpected results (flights from outside this time period).
The time I provide is correct.
What does this mean “timestamp of earliest flight departure to return”?
Is the API I am using suitable? Should I be using another API?
Hi, there might be a problem with the timestamps you are using. Could you please tell me what your parameters are?
For example here are some examples to get the timestamps:
Monday 23, 11:00 local time GMT+3 =>(convert with UTC, not with GMT+3) => startDate = 1464001200
Monday 23, 13:00 local time GMT+3 =>(convert with UTC, not with GMT+3) => endDate = 1464008400
Yes, the times you get are UTC, so they may not be within the range you provide because startDate and endDate are local times, but converted to timestamps using UTC timezones. They are sort of fake timestamps. If you explain what local times you want to use, I can show you another conversion.
It is a bit confusing but it is an old call that could be improved.
Just to clarify your original intent, the AirlineFlightSchedules provides data regarding airline schedules that are published months in advance and does not capture up-to-the-minute flight data. However, if you are looking for flights that are still more than 48 hours from departure then this will be your only option. The AirlineFlightSchedules data is updated infrequently (once per month) and so long-running applications using it typically will capture data for whole days ahead of time a further filter results locally rather than for just a narrow numbers of hours.
If you you instead are looking for flights less than 48 hours in the future, then using the Scheduled/Enroute/Arrived/Departed functions are probably the ones you should be looking at, since it includes more recent flight plans that may not have scheduled by airlines that far in advance, and can incorporate cancellations and delay information. You will need to perform local filtering of the results to limit the data just the specific timeframe however,