Free IP Address API
Get your public IP and location from any terminal, script or app. One request, no sign-up.
$ curl ipchecker.io
203.0.113.42
Loading…
Endpoints
| Path | Returns | Example |
|---|---|---|
/ | Your IP as plain text (for curl, wget, PowerShell) | 203.0.113.42 |
/json | Everything as JSON: IP, city, region, country, ASN, ISP, time zone, coordinates | {"ip":"203.0.113.42", …} |
/ip | Your IP as plain text (works in browsers too) | 203.0.113.42 |
/country | Two-letter country code | NP |
/city | City name | Kathmandu |
/region | Region or province | Bagmati |
/asn | Autonomous system number | AS17501 |
/org | ISP or network operator | WorldLink Communications |
/timezone | IANA time zone | Asia/Kathmandu |
/loc | Latitude and longitude | 27.7172,85.3240 |
/postal | Postal code | 44600 |
/headers | The HTTP request headers you sent, as JSON | {"user-agent": …} |
Examples
MY_IP=$(curl -s ipchecker.io) curl -s ipchecker.io/json | jq .country_code
(Invoke-RestMethod https://ipchecker.io/json).ip irm ipchecker.io/country
const r = await fetch("https://ipchecker.io/json");
const { ip, city, org } = await r.json();import requests
print(requests.get("https://ipchecker.io/json").json()["ip"])Fair use
The API is free for personal projects, scripts and apps. Responses are never cached, so you always get the caller's current address. Location comes from Cloudflare's network data and is accurate to the city at best. Please don't send more than a few requests per second from one machine.
Frequently asked questions
How do I get my IP address from the command line?
Run curl ipchecker.io in any terminal. It prints your public IP as plain text. Use curl ipchecker.io/json for location and ISP details.
Is the IP API free?
Yes. There's no sign-up and no API key. It's meant for scripts, apps and everyday use.
Can I call the API from a web page?
Yes. Every endpoint sends CORS headers, so you can fetch https://ipchecker.io/json directly from browser JavaScript.
Does it support IPv6?
Yes. The API returns whichever address you connected with. Force one with curl -4 ipchecker.io or curl -6 ipchecker.io.