4

I know there is Google API for distance where we can calculate the driving distance but similar to that I want to pass two city names and I want it to give me just the duration like 4 hours 30 minutes.

Is there anyway I can achieve it. I want to pass my values into the API and get the travel times.

2
  • 1
    Welcome to gis.SE. I'm not aware of anything general, but perhaps you can provide some more details. Are you only interested in airline travel? Are you only interested in no-stopover flights? If not, do you only want the air time or the total travel time? Are you willing to pay for the info, or does it need to be freely available?
    – BradHards
    Sep 18, 2015 at 11:20
  • Like I want the total travel time. I would prefer it to be available for free. I am not concerned of stop over flights, yes and am only interested in airline travel. All i want is an average time like new york to Chicago I want time result something like 2 hrs 15 mins or 2 hrs 25 mins . I dont have an issue with difference of 5-10 mins but I would prefer the average time taken to travel Sep 22, 2015 at 21:49

4 Answers 4

1

Only thing I found so far is http://www.greatcirclemapper.net. Haven't tried it yet.

1
  • This is for great circle distance and flight times. It doesn't really address OP's question.
    – lambertj
    Oct 18, 2018 at 16:29
1

IMO, flight travel time is directly correlated to distance. This is because flights are mostly directlines between source and destination. Thus, you can use the Google API Distance matrix to calculate distance between points, then divide by the average speed of commercial flights, which is ~550mph. then, you get your flight time.

obviously, US W->E and S->N flights generally have a faster speed. But, there there are so many variables. For my purposes, the explained in the first paragraph has worked for me.

also, obviously, not every source and destination have an airport.

1

In case you are not only interested in the geographic distance but in the actual travel time (e.g. because airlines take into account jetstreams when they schedule their flights) or interested in the existence of a direct connection between two airports, then the flightstats API might help you: https://developer.flightstats.com The main drawback is that this solution is neither free nor open - you will have to request a free evaluation account here: https://developer.flightstats.com/signup

The only community-based solution I could find is www.adsbexchange.com, but it works using the actual detection of plane transponders and not airline schedules. To get 'free' data access, one needs to contribute with a receiver (https://www.adsbexchange.com/data). Paid access does also exist (https://rapidapi.com/adsbx/api/adsbexchange-com1).

0

This article "10 Best Flight Data API for Your Amazing Application" (January 6, 2020) gives a nice list of options: https://geekflare.com/flight-data-api/

Alternatively check DistanceAPI https://docs.distance.to/

4
  • 1
    Use this static API for Covid Pandemic Adjusted times: { flighttime: undefined }. SCNR :-)
    – til_b
    May 11, 2020 at 8:06
  • where have you found/seen it?
    – Taras
    May 11, 2020 at 8:20
  • 1
    It was a joke. Sorry.
    – til_b
    May 11, 2020 at 8:20
  • I though it was indeed somewhere written, as you said =)
    – Taras
    May 11, 2020 at 8:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.