ipify API
Dead-simple API that returns your public IP address — no key.
What it does
ipify is a tiny, single-purpose API that returns the public IP address the request came from. It has a plain-text, JSON and JSONP mode and separate hostnames for forcing IPv4 or allowing IPv6.
Base URL
Authentication
None. No key, no sign-up, no rate limit — the author explicitly supports unlimited use.
Code examples
curl https://api.ipify.org # 203.0.113.7
curl "https://api.ipify.org?format=json" # {"ip":"203.0.113.7"}
curl https://api64.ipify.org # may return an IPv6 addressimport requests
ip = requests.get("https://api.ipify.org", params={"format": "json"}, timeout=5).json()["ip"]
print(ip)Rate limits & quotas
None advertised. It is designed to absorb very high volume; still, cache the result for the lifetime of a process rather than calling it on every request.
Key response fields
| (text mode) | The bare IP address string |
| ip | JSON mode: {"ip": "…"} |
| api.ipify.org | IPv4 only |
| api64.ipify.org | IPv6 if the client has it, else IPv4 |
Common errors
| (rare) | 5xx only during an outage — fall back to another echo service. |
| Timeouts | Treat a missing response as ‘unknown IP’ and retry later. |
When to use it (and alternatives)
Perfect when a script, container or IoT device needs to learn its own outbound IP — for allow-listing, dynamic DNS, or logging. If you also want geolocation or network details from that IP, use ip-api or ipinfo. httpbin’s /ip returns the same thing.
FAQ
Is ipify really unlimited?
Yes — the project states there is no rate limit and no need for a key. Be a good citizen and cache; you almost never need to re-fetch your own IP mid-process.
How do I force IPv4?
Use api.ipify.org. Use api64.ipify.org to get IPv6 when available.
Can I get it as JSONP for a browser?
Yes — ?format=jsonp&callback=fn. For modern browsers a plain fetch with ?format=json and CORS is simpler.
New to APIs?
Short guides for working with this API — and any other.