Appearance
API reference
Base URL: https://ipconfig.io (plain http:// works too). No authentication, no API key, no signup.
How responses are chosen
A single endpoint serves three audiences. The response format is decided by content negotiation, in this order:
| You send | You get |
|---|---|
A /json path, or Accept: application/json | JSON |
A browser (Accept: text/html) | The HTML dashboard |
Anything else (curl, scripts, Accept: */*) | Plain text |
So curl ipconfig.io returns the bare IP, a browser returns the page, and curl ipconfig.io/json (or an Accept: application/json header) returns the record. Plain-text endpoints always return text regardless of client.
The ?ip= parameter
Every geolocation endpoint defaults to the caller's address. Append ?ip=<address> (IPv4 or IPv6) to look up any other address instead:
sh
curl ipconfig.io/json?ip=1.1.1.1
curl ipconfig.io/country?ip=2606:4700:4700::1111?ip= applies to /, /ip, /json, /country, /country-iso, /city, /coordinates, /asn, and /asn-org. It does not apply to /port or /health.
Plain-text endpoints
Each returns a single value as text/plain, with a trailing newline. A field is returned empty when the database has no value for that address.
| Method & path | Returns | Example (?ip=1.1.1.1) |
|---|---|---|
GET / | Your IP | 1.1.1.1 |
GET /ip | Your IP | 1.1.1.1 |
GET /country | Country name | Australia |
GET /country-iso | ISO 3166-1 alpha-2 | AU |
GET /city | City | (empty for 1.1.1.1) |
GET /coordinates | latitude,longitude | 0.000000,0.000000 |
GET /asn | Autonomous system number | AS13335 |
GET /asn-org | AS organization | Cloudflare, Inc. |
Anycast & infrastructure IPs
Addresses like 1.1.1.1 resolve to a country and ASN but often have no city or coordinates — they're anycast, not pinned to one place. Geolocation precision always depends on the address.
GET /json
The full record as one flat JSON object. Also returned from / when the request carries Accept: application/json.
sh
curl ipconfig.io/json?ip=1.1.1.1json
{
"ip": "1.1.1.1",
"ip_decimal": 16843009,
"country": "Australia",
"country_iso": "AU",
"country_eu": false,
"asn": "AS13335",
"asn_org": "Cloudflare, Inc.",
"hostname": "one.one.one.one",
"user_agent": {
"product": "curl",
"version": "8.20.0",
"raw_value": "curl/8.20.0"
}
}Fields
Geolocation fields are present only when known for the address — the 1.1.1.1 sample above omits city, latitude, and friends because they're unknown for an anycast address.
| Field | Type | Notes |
|---|---|---|
ip | string | The resolved address |
ip_decimal | number | Integer form of the IP |
country | string | Country name |
country_iso | string | ISO 3166-1 alpha-2 code |
country_eu | boolean | Whether the country is in the EU |
region_name | string | First-level subdivision (e.g. state); when known |
region_code | string | Subdivision code; when known |
zip_code | string | Postal code; when known |
city | string | City; when known |
latitude | number | When known |
longitude | number | When known |
metro_code | number | US metro / DMA code; when known |
time_zone | string | IANA time zone (e.g. America/Chicago); when known |
asn | string | Autonomous system number, AS<n> |
asn_org | string | AS organization name |
hostname | string | Reverse-DNS (PTR) name, when resolvable |
user_agent | object | Parsed request User-Agent (product, version, raw_value) |
GET /port/{port}
Checks whether a TCP port is reachable on the caller's IP right now. Returns JSON. (Does not accept ?ip=.)
sh
curl ipconfig.io/port/443json
{
"ip": "203.0.113.42",
"port": 443,
"reachable": false
}| Field | Type | Notes |
|---|---|---|
ip | string | The address that was probed (yours) |
port | number | The port from the path |
reachable | boolean | Whether the probe connected |
GET /health
Liveness check for monitoring.
sh
curl ipconfig.io/healthjson
{ "status": "OK" }Notes
- Caching. Responses are served behind Cloudflare and an in-process cache, so repeated lookups are cheap. Treat values as accurate to within a refresh cycle, not real-time.
- Geolocation data comes from MaxMind GeoLite2, refreshed nightly. It's approximate — country and ASN are reliable; city and coordinates are best-effort.
- No rate-limit headers are published. Be a good citizen: cache your own IP rather than polling on a tight loop.