How to determine the user's location by IP address

Description

The API endpoint returns the IATA code, the name of the nearest city to the user and additional information.

Request

http://www.travelpayouts.com/whereami?locale=en&ip=95.90.254.107

Request parameters

  • locale — language in which the name of the city is returned (available in, rue, de, fr, it, pl, th);
  • ip — IP address of the user (If the address is not transferred, the system determines the IP from the header of the request).

Response example

iata: "HAM"
name: "Hamburg"
country_name: "Germany"
coordinates: "9.991586:53.553814"

Response parameters

  • iata — the IATA code of the city
  • name — the city name where the user is located
  • country_name — the country name
  • coordinates — airport coordinates

Was this article helpful?

Have more questions? Submit a request