Skip to content

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 sendYou get
A /json path, or Accept: application/jsonJSON
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 & pathReturnsExample (?ip=1.1.1.1)
GET /Your IP1.1.1.1
GET /ipYour IP1.1.1.1
GET /countryCountry nameAustralia
GET /country-isoISO 3166-1 alpha-2AU
GET /cityCity(empty for 1.1.1.1)
GET /coordinateslatitude,longitude0.000000,0.000000
GET /asnAutonomous system numberAS13335
GET /asn-orgAS organizationCloudflare, 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.1
json
{
  "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.

FieldTypeNotes
ipstringThe resolved address
ip_decimalnumberInteger form of the IP
countrystringCountry name
country_isostringISO 3166-1 alpha-2 code
country_eubooleanWhether the country is in the EU
region_namestringFirst-level subdivision (e.g. state); when known
region_codestringSubdivision code; when known
zip_codestringPostal code; when known
citystringCity; when known
latitudenumberWhen known
longitudenumberWhen known
metro_codenumberUS metro / DMA code; when known
time_zonestringIANA time zone (e.g. America/Chicago); when known
asnstringAutonomous system number, AS<n>
asn_orgstringAS organization name
hostnamestringReverse-DNS (PTR) name, when resolvable
user_agentobjectParsed 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/443
json
{
  "ip": "203.0.113.42",
  "port": 443,
  "reachable": false
}
FieldTypeNotes
ipstringThe address that was probed (yours)
portnumberThe port from the path
reachablebooleanWhether the probe connected

GET /health

Liveness check for monitoring.

sh
curl ipconfig.io/health
json
{ "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.

Geolocation by MaxMind GeoLite2. No tracking, no keys.