Skip to content

Quickstart

ipconfig.io answers in whatever format fits the caller. There's nothing to install and no key to set up — just make a request.

Get your public IP

sh
curl ipconfig.io
# 203.0.113.42

That's the load-bearing contract: a terminal gets the bare IP plus a newline, so curl ipconfig.io drops straight into a script.

Get the full record as JSON

The same data — IP, geolocation, ASN, reverse DNS — comes back as one flat object from /json (or from / with an Accept: application/json header).

sh
curl ipconfig.io/json
js
const res = await fetch('https://ipconfig.io/json')
const info = await res.json()
console.log(info.ip, info.country, info.asn_org)
sh
http https://ipconfig.io/json
powershell
Invoke-RestMethod https://ipconfig.io/json

Grab a single field

Every value in the JSON also has its own plain-text endpoint — handy when you want exactly one thing and no parser.

sh
curl ipconfig.io/country      # United States
curl ipconfig.io/city         # San Francisco
curl ipconfig.io/asn          # AS13335
curl ipconfig.io/asn-org      # Cloudflare, Inc.

Parse JSON in a shell

Pipe /json into jq for scripting:

sh
curl -s ipconfig.io/json | jq -r '.asn_org'
# Cloudflare, Inc.

# stash your IP in a variable
MYIP=$(curl -s ipconfig.io)
echo "$MYIP"

Look up any address

Append ?ip= to any endpoint to query an address other than your own:

sh
curl ipconfig.io/json?ip=1.1.1.1
curl ipconfig.io/country?ip=8.8.8.8

http and https both work

curl http://ipconfig.io and curl https://ipconfig.io both return your IP. The plain-http form is supported on purpose so it works everywhere, including minimal images without a CA bundle.

Next: the API reference lists every endpoint, the ?ip= parameter, and the full JSON field set.

Geolocation by MaxMind GeoLite2. No tracking, no keys.