Go Back  FlyerTalk Forums > Travel&Dining > Travel Tools
Reload this Page >

API for Calculating Flight Miles

Community
Wiki Posts
Search

API for Calculating Flight Miles

Thread Tools
 
Search this Thread
 
Old Jan 12, 2015, 9:46 pm
  #1  
Original Poster
 
Join Date: Jan 2013
Posts: 37
API for Calculating Flight Miles

Does anyone know what service/API sites use to calculate the flight miles between two airports?
jimmyboo is offline  
Old Jan 12, 2015, 10:16 pm
  #2  
Marriott Contributor BadgeAccor 10+ Badge
 
Join Date: Jun 2007
Location: ASIA
Programs: TK Elite, ALL Plus Diamond, Marriott Platinum, Hertz PC
Posts: 3,530
http://www.webflyer.com/travel/mileage_calculator/
gilbertaue is offline  
Old Jan 12, 2015, 10:23 pm
  #3  
FlyerTalk Evangelist
 
Join Date: Dec 2007
Location: BOS/ORH
Programs: AS 75K
Posts: 18,323
Usually based off great circle routing

gcmap.com is an example site
CDKing is offline  
Old Jan 14, 2015, 7:46 am
  #4  
A FlyerTalk Posting Legend
 
Join Date: Sep 2009
Location: Minneapolis: DL DM charter 2.3MM
Programs: A3*Gold, SPG Plat, HyattDiamond, MarriottPP, LHW exAccess, ICI, Raffles Amb, NW PE MM, TWA Gold MM
Posts: 100,404
However, some airlines (such as DL) don't seem to follow any of the standard sources and you need to check the miles on their own website. Differences compared to the great circle routing calculations are not unusual, although the deviations are usually small. Also, the distances according to DL occasionally change, so you can't necessarily go by previous experience.
MSPeconomist is offline  
Old Jan 14, 2015, 10:24 pm
  #5  
Original Poster
 
Join Date: Jan 2013
Posts: 37
Originally Posted by gilbertaue
Thanks good sir. Do you know what the service behind that site is? I'm looking to query the service directly instead of going through this or another website.
jimmyboo is offline  
Old Jan 20, 2015, 8:39 am
  #6  
Accor 10+ BadgeMarriott Contributor Badge
 
Join Date: Jun 2007
Location: ASIA
Programs: TK Elite, ALL Plus Diamond, Marriott Platinum, Hertz PC
Posts: 3,530
Originally Posted by jimmyboo
Originally Posted by gilbertaue
Thanks good sir. Do you know what the service behind that site is? I'm looking to query the service directly instead of going through this or another website.
No idea. Sorry!
gilbertaue is offline  
Old Jan 23, 2015, 8:44 am
  #7  
A FlyerTalk Posting Legend
 
Join Date: Apr 2001
Location: PSM
Posts: 69,232
Originally Posted by jimmyboo
Thanks good sir. Do you know what the service behind that site is? I'm looking to query the service directly instead of going through this or another website.
The formula for doing the math is actually pretty easy and well documented. You need a database of IATA codes, latitude & longitude to feed in to the formula but once you have that then getting the maths part done is easy. Doing a ton of calculations can slow down the server a bit but if it is just a couple per page load that shouldn't be an issue. I have the code in vb.net if you want that. I'll even give you a dump of the airports table from my DB if you want that, too.

I suppose I could set up an API-ish service to just return the distances if you want that rather than doing the calculations on your own server.
sbm12 is offline  
Old May 30, 2022, 7:25 pm
  #8  
 
Join Date: Apr 2022
Programs: ChrisFlyer66
Posts: 1
Originally Posted by sbm12
The formula for doing the math is actually pretty easy and well documented. You need a database of IATA codes, latitude & longitude to feed in to the formula but once you have that then getting the maths part done is easy. Doing a ton of calculations can slow down the server a bit but if it is just a couple per page load that shouldn't be an issue. I have the code in vb.net if you want that. I'll even give you a dump of the airports table from my DB if you want that, too.

I suppose I could set up an API-ish service to just return the distances if you want that rather than doing the calculations on your own server.
how much you charge to do that
didiugo is offline  


Contact Us - Manage Preferences - Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service -

This site is owned, operated, and maintained by MH Sub I, LLC dba Internet Brands. Copyright © 2024 MH Sub I, LLC dba Internet Brands. All rights reserved. Designated trademarks are the property of their respective owners.