FlyerTalk Forums - View Single Post - API for Calculating Flight Miles
View Single Post
Old Jan 23, 2015 | 8:44 am
  #7  
sbm12
A FlyerTalk Posting Legend
10 Countries Visited20 Countries Visited30 Countries Visited20 Years on Site
 
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