API Method ip_info. Get country code by IP address

The API method ip_info() returns a 2 letter country code (US, UK, CN and etc) for an IP address. You can specify a list for IP address to find countries for each IP address by one API call.


Call required GET params:

  • method_name - must be 'ip_info',
  • ip - an IPv4 address to obtain 2 letter country code.


Optional POST params:

  • data - list of IP addresses separated by comma (,).




API returns JSON string, for example:

 {"data":{"":{"country_code":"US","country_name":"United States"}}}


Response explanation:

  • data - array with checked records,
    • record - array with details per record,
      • country - a 2 letter country code for the IP address.



If you get calls limit, API returns error notice. Example:

{"error_message":"Calls limit exceeded.","error_no":10}

Current calls limit is 10 per 60 seconds.

If you get data elements limit in spam_check method, API returns error notice. Example:

{"error_message":"Received 1001 records to check, maximum 1000 records check per call.","error_no":8}

Current data elements limit is 1000.


Recommended timeout is no more than 180 seconds.


Perhaps it would also be interesting

By using this site, you consent to the use services cookies. This is necessary for the normal functioning of the site. Close