0

I am looking for an API that will provide me with a list of possible origins for a given destination within a certain time frame.

For example, if I want to know all flights arriving in London on a specific day, the API should be able to give me a list of up to a hundred flights.

JonathanReez
  • 83,545
  • 81
  • 372
  • 721
user133379
  • 17
  • 1
  • 1
    The question is not the same at all, as the example, the first would relate to something like FlightConnections, but FC doesn't have an API, and the second may be able to be realized by something like FlightAware. FC doesn't display specific flights, but can see way further in the future than FA – Nicolas Formichella Jan 18 '23 at 14:29
  • 3
    It might help to know why you want this – Traveller Jan 18 '23 at 14:53
  • 4
    Do you care about all flights (including cargo, charters, private…) or only those which can be booked? Do you care about the past, present, or future? – jcaron Jan 18 '23 at 14:57
  • Following the comments I will clarify my expectations, I would like an API which is like that of AviationStack in the following way: http://api.aviationstack.com/v1/flights?access_key=&arrival_airport=LHR&arrival_at=2023-01 -19 but either with more queries per month or no limits at all. – user133379 Jan 18 '23 at 18:02
  • 5
    I’m voting to close this question because it's not actually about Travel. It's a request for an API which may or may not even exist. – brhans Jan 18 '23 at 18:11
  • Do you want something for free or are you willing to pay reasonable license fees? – Hilmar Jan 18 '23 at 18:56
  • Preferably free because it is not for the purpose of doing a commercial project but for a university research project – user133379 Jan 18 '23 at 19:15
  • 1
    @Willeke what’s the reason for the answer being deleted? Even though I’m not sure it specifically answers OP’s question, it at least gives pointers to quite a few APIs one may want to explore. – jcaron Jan 19 '23 at 12:04
  • 6
    So what you want is AviationStack, but you don't want to pay for it. Is this an actual research project or a class assignment? Have you tried asking AviationStack if, as a researcher, you can access their data for a reduced rate? – DJClayworth Jan 19 '23 at 14:56
  • 3
    If this is a class project, pay the $49.99 for a month's access. If this is an ongoing research project treat the subscription to AviationStack as a project expense, just like buying hardware or paying the researchers. – DJClayworth Jan 19 '23 at 15:00

1 Answers1

4

It's unlikely that you will find an API for free that has the same level of detail, ease of use and request parameter as the paid options. If you are only interested in the arriving flights at one airport, you could try scraping the website of the airport.

For example, the arrivals page of Heathrow makes the following request to their backend:

https://api-dp-prod.dp.heathrow.com/pihub/flights/arrivals?date=2023-12-10&orderBy=localArrivalTime&excludeCodeShares=true

If the request has the right headers set (cookie, content-type, etc...) this returns a neat JSON with 644 arriving flights with info on the airplane, the route, origin and destinations, etc.

You can find what calls are being made by opening the developer tools of your browser, going to the network tab and hitting refresh on the page of interest. Look for json-type calls or calls with a larger transferred payload:
enter image description here

Advantages:

  • You can develop your webscraping skills (if you're into that)
  • You might get more relevant information out of it than the API's (for your usecase)
  • You don't have to pay money to someone else

Disadvantages:

  • Huge timesink, you will have to reverse engineer the data schema, ensure that the calls keep on working when cookies expire, etc...
  • Their backend API might change anytime
  • You might get blocked due to recurring requests
  • You probably need always on hardware to carry out periodic scraping
  • You need to verify that the data you scrape matches the reality you want to investigate. E.g. if you're only interested in arriving flights you might need to manually exclude cancelled flights.

In summary I would only recommend this if:

  • You don't value your time as much
  • The paid API's don't deliver the data that you're looking for, but the scraped data does
Saaru Lindestøkke
  • 3,908
  • 3
  • 24
  • 43