IP to location APIs

country.is

by country.is

IP to location APIs Added on October 31st, 2026 Checked and working on November 15th, 2026
Visit country.is →

What it does

country.is does one thing: it tells you the country of an IP address, as a two-letter country code in a tiny JSON response. Call it without an address to get the country of the visitor, for example to preselect a country in a form. Free and open source, no key needed.
  • API
  • HTTP-GET
  • JSON
  • REST

At a glance

API key
Not needed · More APIs with no key
Pricing
Free and open source, no key needed.
From the browser
Yes (CORS)
Formats
JSON
Interface
REST, HTTP-GET
Provider
country.is
Last checked
Working on November 15th, 2026

More information: https://country.is/

Is this your service? Show that it is listed

Put this badge on your website or in your README; it links to this page. About the badge

Listed on Free Web Services

country.is
country.is

Example request

curl

curl 'https://api.country.is/8.8.8.8'

JavaScript

const response = await fetch("https://api.country.is/8.8.8.8");
const data = await response.json();
console.log(data);

Python

import requests

response = requests.get(
    "https://api.country.is/8.8.8.8",
    timeout=30,
)
print(response.json())

The JavaScript works in a web page as well as in Node.js 18 or newer.

Did it work for you?

Tell us what you found when you tried country.is.