13

How can I have just the IATA codes with Google Maps? I just found out how to get the address and city, but I need to grab just the IATA code, like NYC or JFK etc. How can I do that?

Thanks for your help.

dda
  • 6,030
  • 2
  • 25
  • 34
thegrede
  • 492
  • 1
  • 6
  • 18

3 Answers3

8

You could use the Global Airport Database. It has GPS coordinates.

dda
  • 6,030
  • 2
  • 25
  • 34
6

You can try use this service:

GET Request Params: http://iatageo.com/getCode/{lat}/{lng}

GET Request Example: http://iatageo.com/getCode/-15.4343434/-47.323232

This will return a JSON, for example:

{
  "code": "BSB",
  "distance_meters": "127763.232556459"
}
      
  • 2
    Whilst this may theoretically answer the question, [it would be preferable](//meta.stackoverflow.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Rohit Gupta Oct 11 '15 at 06:14
3

The Google geocoder will not return the IATA code if you reverse geocode a location. It does return a location if you give it an IATA code.

You can geocode KJFK at https://google-developers.appspot.com/maps/documentation/javascript/examples/geocoding-simple (it places a marker at 40.64384360,-73.78230350).

If you reverse-geocode that location with https://developers.google.com/maps/documentation/javascript/examples/geocoding-reverse you get lots of data but neither three-letter nor four-letter code are included. (The formatted address includes "JFK" but that can't be guaranteed: you would need it as an identifiable data item)

If you want to find an IATA code for a particular location, you will need to use another resource.

Andrew Leach
  • 12,945
  • 1
  • 40
  • 47