How to determine the user's location by IP address
Description
Returns the IATA code and the name of the nearest city to 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 the 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.