Free IP address API
Get your public IP, location and network from any script or app. No key, no sign-up, CORS on, answered at the Cloudflare edge close to you.
curl ip.tooljar.devcurl ip.tooljar.dev/jsonEndpoints
Every address works over https:// and, for old scripts, plain http://. Each text answer ends with a new line. When a value is not known, the address returns status 404 with an empty body.
| Address | Returns |
|---|---|
ip.tooljar.dev | Your IP as plain text for scripts and terminals (browsers get this web page) |
ip.tooljar.dev/ip | Your IP as plain text, always |
ip.tooljar.dev/json | All fields below as JSON |
ip.tooljar.dev/city | City |
ip.tooljar.dev/region | Region or state |
ip.tooljar.dev/country | Two-letter country code, like DE |
ip.tooljar.dev/postal | Postal code |
ip.tooljar.dev/loc | Latitude and longitude, like 52.52,13.40 |
ip.tooljar.dev/timezone | Time zone, like Europe/Berlin |
ip.tooljar.dev/asn | Network number, like AS3320 |
ip.tooljar.dev/org | Network owner, usually your internet provider |
ip.tooljar.dev/hostname | Reverse DNS name of your IP |
ip.tooljar.dev/ua | Your user agent |
ip.tooljar.dev/headers | Your request headers as JSON (browsers get a page) |
JSON fields
This is your own answer right now (hostname is filled in by the real API):
{
"ip": "216.73.216.102",
"version": 4,
"hostname": null,
"city": "Columbus",
"region": "Ohio",
"region_code": "OH",
"country": "US",
"country_name": "United States",
"continent": "NA",
"postal_code": "43215",
"latitude": 39.96118,
"longitude": -82.99879,
"timezone": "America/New_York",
"asn": 16509,
"org": "Anthropic, PBC",
"is_eu": false,
"user_agent": "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
}
hostname, and any field we can't fill, is null. asn is a number. version is 4 or 6.
Examples
Shell
IP=$(curl -s ip.tooljar.dev)
echo "My IP is $IP"
JavaScript (browser or Node.js)
const res = await fetch("https://ip.tooljar.dev/json");
const { ip, city, country } = await res.json();
Python
import requests
data = requests.get("https://ip.tooljar.dev/json", timeout=5).json()
print(data["ip"], data["country"])
PowerShell
(Invoke-RestMethod https://ip.tooljar.dev/json).ip
IPv4 or IPv6
The API answers with the IP your connection used. To ask for one version on purpose, use curl -4 ip.tooljar.dev or curl -6 ip.tooljar.dev.
Asking for JSON on any address
Send Accept: application/json and the home address answers in JSON too: curl -H "Accept: application/json" ip.tooljar.dev.
Open source
The whole site is one small Cloudflare Worker. Read the code, report a problem or run your own copy: github.com/tooljar-dev/ip.
Questions people ask
Do I need an API key?
No. There is no key, no sign-up and no cost. Just call the address.
Is there a rate limit?
Please keep it reasonable: fetch your IP when you need it, not in a tight loop. A single address that sends a burst of many requests in a few seconds gets HTTP 429 (too many requests) for a short time.
Can I look up someone else's IP address?
No. The API only answers about the IP that is calling it. The location data comes with each request from Cloudflare, so there is no database to search.
Can I use it in my app or company?
Yes, for free, including commercial use. The code is open source under the MIT license, so you can also run your own copy on Cloudflare Workers.
Will the addresses and fields change?
No. The paths and JSON field names are stable. We may add new fields, but we won't rename or remove existing ones.