Free IP Address API
A free, key-less public IP API. Send one request and get the caller's public IP address plus geolocation, ISP and ASN. No signup, no API key, no rate-limit dashboard — and we never log your IP.
Endpoint
https://www.what-is-my-ip.best/api/ip
Returns the public IP of whoever calls it. Responses are sent with Access-Control-Allow-Origin: * and Cache-Control: no-store, so you can call it directly from browser JavaScript on any domain.
Quick start
curl https://www.what-is-my-ip.best/api/ip
curl https://www.what-is-my-ip.best/api/ip?format=text
JSON response
{
"ip": "203.0.113.42",
"version": "IPv4",
"city": "Amsterdam",
"region": "North Holland",
"country": "Netherlands",
"country_code": "NL",
"latitude": 52.3676,
"longitude": 4.9041,
"timezone": "Europe/Amsterdam",
"asn": "AS3320",
"org": "Deutsche Telekom AG"
}Geolocation is an estimate based on IP registration data and may be null for some addresses. It is not GPS.
Formats
?format=json— full JSON object (default)?format=text— the IP address as plain text, ideal forcurland shell scripts?format=jsonp&callback=fn— JSONP for legacy cross-origin use
Code examples
const res = await fetch("https://www.what-is-my-ip.best/api/ip");
const data = await res.json();
console.log(data.ip); // "203.0.113.42"import requests
data = requests.get("https://www.what-is-my-ip.best/api/ip").json()
print(data["ip"])const res = await fetch("https://www.what-is-my-ip.best/api/ip");
const { ip, country, org } = await res.json();
console.log(ip, country, org);MY_IP=$(curl -s https://www.what-is-my-ip.best/api/ip?format=text) echo "$MY_IP"
Rate limits & fair use
The API is rate-limited to roughly 60 requests per minute per IP — generous for real use. Exceeding it returns HTTP 429 with a Retry-After header. Please cache responses where you can. The service is free; abuse spoils it for everyone.
Privacy
Your IP is used in-memory to build the response and is never logged, stored, or sold. See our Privacy Policy.
Want a drop-in widget instead?
Embed a live “your IP” badge on any site in one line.
Get the embed code →