How determining the user's location by IP address

Description

Returns the IATA code and the name of the nearest city from the user.

Request

http://www.travelpayouts.com/whereami?locale=en&callback=useriata&ip=62.105.128.0

Request parameters

  • locale — language in which the name of the city is returned (available: in, rue, de, fr, it, pl, th);
  • callback — specifies the name of the function that contains the response to the request (required parameter);
  • ip — Ip-address of the user (if the address is not transferred, the system determines ip from the header of the request).

Example of response

useriata({"iata":"MOW","name":"Moscow","country_name":"Russia","coordinates":"37.6176:55.7558"});

Response parameters

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

Was this article helpful?

Have more questions? Submit a request