Your API Key

Email:

Password:

Password again:

Your Name:

What is 1 plus 87:


Email:

Password:

Email:

Pricing

This service allows free 100 request per API key each day. If your requests exceed 100 in a given day, API will return error message unless you purchase one of the matching plans below. Free plan is considered for development phase and we recommend all users to upgrade to a paid plan for production website.

  • Unverified email: 0req/day - $0/mo
  • Free: 100req/day - $0/mo
  • Basic: 2000req/day - $5/mo
  • Deluxe: 10000req/day - $20/mo
  • Pro: 50000req/day - $80/mo
  • Ultimate: 100000req/day - $150/mo
  • Platinum: 500000req/day - $500/mo

FAQ

Please use registration form above or login if you are already registered, and you will see your API code. You need to verify your email address or purchase a plan in order to activate the API code.
You can try our front-end IP locator in our homepage to try the service. we provide 99% accuracy for country level and 65% accuracy on city level worldwide, and 85% accuracy for user-agent decoding.
This service is being served via multiple server in multiple geographic areas and utilizing instant failover if a server fail. We aim to have 99.99%/mo uptime.

Use right side guide on how to build your query and send to our server. We accept IP and Key paramters for geographic API and UA parameter for user-agent decoder API. Response returned will be JSON format. If there is an error (API limit exceed, API key invalid, ...) status field will be "Error" and msg field will provide error details, otherwise status will return "OK" and msg will be empty.

When a response contain status "OK", you may gather your information from it by decoding json string. Decoding json is supported natively in most programming languages. As example:

PHP:

//Set a default country name
$country="Unknown";
//Request from geolocation API
if ($response=@file_get_contents("https://ip.city/api.php?ip=[IP]&key=[YOUR_API_KEY]")&&$response){
    //Convert json to array
    $response_result=(array) json_decode($response,true);
    //check if response status is OK
    if ($response_result['status']=='OK'){
        //Get country name
        $country=$response_result['countryName'];
    }
}
        

Geolocation API

This API receive IP address and return country name, country code, city name, longitude and latitude related by that IP address. IP database is updated on monthly basis. We support both IPv4 and IPv6.


https://ip.city/api.php?ip=[IP]&key=[YOUR_API_KEY]
{
    status: "OK",
    countryName: "United States",
    countryCode: "US",
    city: "Ashburn",
    region: "Virginia",
    organisation: "Amazon.com",
    lat: "39.0469",
    long: "-77.4903",
    msg: ""
}

User-agent decode API

This API receive user-agent string and give you specification of the device which uses that user-agent string. This service is being updated and maintained regularly as new browser or OS version is released.


https://ip.city/api.php?ua=[UA]&key=[YOUR_API_KEY]
{
    status: "OK",
    os: "",
    browser: "",
    browserv: "",
    device: "pc", //pc,tablet,phone
    os_icon: "https://ip.city/img/pc/na.png",
    browser_icon: "https://ip.city/img/pc/na.png",
    msg: ""
}