Api IpLocation

Outgoing parameters:

method Function that returns the correct answer
format The format of the answer. Valid JSON and XML. The parameter is not required by default for the answer in the form of JSON
apiKey This is a string of 35 miscellaneous characters. Your unique key for working with Api. You can receive it in personal khanate after registration.
ip Ip address format is Ipv4, Ipv6, domain names. Example value: 10.1.22.55 or 2804:7f1:xxx:2f95:xxxx:2b6a:37dd:65c4 or www.google.com

To get the current IP address, you need to generate a request:

Defining guest data.
When the query returns:
  • ip - IP address in IPv4 or Ipv6 format
  • user_agent - Information about the guest which is part of the HTTP request.
  • browser - User's browser
  • browser_version - Browser version
  • os - Operating system
  • os_version - Operating system version
  • is_robot - Determine whether the guest is a robot
  • robot_belongs - If the guest is a robot then determine who he is
  • is_mobile - Is the guest from a mobile device
  • phone - If a guest from a mobile device, then determine the type of device

To get a location, you need to generate a query:

Method Description
country The easiest and fastest method for determining a country. Date of last database update: September 2018.

When prompted, returns:
  • country_code - Two-character country code based on ISO 3166
  • country_name - Country name based on ISO 3166
city Full version of geolocation of cities. Includes maximum information. Please use this method if you really need all the information about geolocation. Date of last database update: December 2018.

When prompted, returns:
  • country_code - Two-character country code based on ISO 3166
  • country_name - Country name based on ISO 3166
  • region_name - Region or state name
  • city_name - City name
  • latitude - City latitude. Default to capital city latitude if city is unknown
  • longitude - City longitude. Default to capital city longitude if city is unknown
  • zip_code - ZIP/Postal code
  • time_zone - UTC time zone
lite-asn A simplified version of the Internet providers. The database is not complete and is constantly updated.Date of last database update: July 2018.

When prompted, returns:
  • cidr - IP address range in CIDR
  • asn - Autonomous system number (ASN)
  • as - Autonomous system (AS) name
vpn-city Ip addresses of the Ipv4 format that are used through anonymous VPNs, Web proxies, connection wiring, and intermediate addresses. The database is assembled on the algorithm of companies and is used in open access, use information.Date of last database update: July 2018.

When prompted, returns:
  • proxy_type - Type of proxy
  • country_code - Two-character country code based on ISO 3166
  • country_name - Country name based on ISO 3166
  • region_name - Region or state name
  • city_name - City name
  • isp - Internet Service Provider or company's name

Example query

https://ip-location.icu/api/v1/city/?apiKey={apiKey}&ip=www.google.com

    {
        "country_code":"US",
        "country_name":"United States",
        "region_name":"California",
        "city_name":"Mountain View",
        "latitude":"37.405992",
        "longitude":"-122.078515",
        "zip_code":"94043",
        "time_zone":"-07:00"
    }
     

Example scripts

Download examples of ready classes

Possible errors when using the API

If at API query an answer returned you with "error" that a query was not successful and a method returned an error. With decoding of errors it is possible to familiarize in a table below.

error value
Format {format} does not exist. Available formats json and xml. The specified format differs from the allowed.
Required parameters are missing apiKey. Missing required parameter apiKey.
Required parameters are missing ip. Missing required ip parameter.
Invalid key. The apiKey does not exist, check that the key is correct personal account.
Monthly connection limit exceeded. You can increase the limit by the link. The monthly connection limit has ended. Increase the connection limit depending on your needs.
Invalid ip address or no fond. The wrong address or information is missing from the database. You can send us data for verification.
An unexpected error, we already know about it and try to solve it in the near future. An unknown error, our developers already know about the problem and solve it. Also you can send a request to us by email support@ip-location.icu to clarify the details by mistake.
We blocked your key in connection with exceeding the connection limit for a second more than 3 times, tomorrow your key will be active again. Please read our API Terms and Conditions. Error exceeding the connection limit. Limit maximum 3 per second. Lock for 1 day.

Warning

For blocking of spam and smooth division of queries between all users we have a limit on connecting of amount of queries in a second no more than 3, if you exceed this limit we block your key on 1 day.Please, not exceed this limit because you must remember that we avouch for users a rapid answer and all is need a place on connecting. If for you arrays of records and you need to process for example through a cycle use that delay of implementation of scripts for example by the functions of sleep (), usleep () or other useful functions. If zablokirovali you by mistake or by chance in the moment of testing write that us we on possibility deblock you. Thank you for understanding.