All endpoints are served from https://ipconfig.sh. Responses are UTF-8 encoded.
The server detects CLI clients by User-Agent and returns plain-text responses by default. Browser clients receive HTML or plain text depending on the endpoint. A format override parameter is available on most endpoints.
All public endpoints are rate-limited. Exceeding limits returns a 429 status with a Retry-After header indicating when to retry. Respect the header and back off.
All endpoints are public and require no authentication.
Standard HTTP status codes are used. See individual endpoint documentation for details.
/
Returns the client's public IP address.
| Parameter | In | Type | Req | Description |
|---|---|---|---|---|
fmt | query | string | No | Overrides the User-Agent detected default format:text (default for CLI)jsonhtml (default for browsers) |
Rate limit group:global
Status:200, 429
curl ipconfig.sh
curl "ipconfig.sh/?fmt=json"import requests
# Plain text
ip = requests.get("https://ipconfig.sh").text.strip()
# JSON
data = requests.get("https://ipconfig.sh",
params={"fmt": "json"}).json()# Plain text
(Invoke-WebRequest ipconfig.sh).Content
# JSON
Invoke-RestMethod "ipconfig.sh/?fmt=json"# Plain text
203.0.113.42
# JSON
{"ip": "203.0.113.42"}
/whoami
Returns the client's IP, hostname, provider, ASN, and route.
| Parameter | In | Type | Req | Description |
|---|---|---|---|---|
fmt | query | string | No | Overrides the User-Agent detected default format:text (default)json |
Rate limit group:global
Status:200, 429
curl ipconfig.sh/whoami
curl "ipconfig.sh/whoami?fmt=json"import requests
info = requests.get("https://ipconfig.sh/whoami",
params={"fmt": "json"}).json()
print(info["provider"], info["asn"])Invoke-RestMethod "ipconfig.sh/whoami?fmt=json"# Plain text
IP: 203.0.113.42
Hostname: host.example.com
Provider: Example ISP
Network: AS12345 - 203.0.113.0/24
Country: CH
# JSON
{
"status": "ok",
"ip": "203.0.113.42",
"hostname": "host.example.com",
"provider": "Example ISP",
"provider_group": "Example Group",
"asn": "AS12345",
"route": "203.0.113.0/24",
"country_code": "CH"
}
/calc/<ip>/<prefix>
Calculate subnet information for an IPv4 or IPv6 network.
| Parameter | In | Type | Req | Description |
|---|---|---|---|---|
ip | path | string | Yes | IPv4 or IPv6 address |
prefix | path | integer | Yes | CIDR prefix (0-32 for v4, 0-128 for v6) |
fmt | query | string | No | Overrides the User-Agent detected default format:text (default for CLI)jsonhtml (default for browsers) |
split | query | integer | No | Split subnet at this prefix length |
Rate limit group:calc
Status:200, 400, 429
curl ipconfig.sh/calc/10.0.0.0/24
curl "ipconfig.sh/calc/10.0.0.0/24?fmt=json"
curl "ipconfig.sh/calc/10.0.0.0/24?split=26"import requests
calc = requests.get(
"https://ipconfig.sh/calc/10.0.0.0/24",
params={"fmt": "json"}).json()Invoke-RestMethod `
"ipconfig.sh/calc/10.0.0.0/24?fmt=json"# Plain text (excerpt)
Network: 10.0.0.0/24
Netmask: 255.255.255.0
Broadcast: 10.0.0.255
First: 10.0.0.1
Last: 10.0.0.254
Hosts: 254
/scan/<query>
Threat intelligence lookup for an IP, domain, subnet, or URL.
| Parameter | In | Type | Req | Description |
|---|---|---|---|---|
query | path | string | Yes | IP, domain, subnet, or URL (max 2000 chars) |
fmt | query | string | No | Overrides the User-Agent detected default format:text (default if omitted)jsonhtml |
Rate limit group:threat_intel
Status:200, 400, 429
curl ipconfig.sh/scan/8.8.8.8
curl "ipconfig.sh/scan/example.com?fmt=json"
curl ipconfig.sh/scan/192.168.0.0/16import requests
# Plain text
print(requests.get(
"https://ipconfig.sh/scan/8.8.8.8").text)
# JSON
threat = requests.get(
"https://ipconfig.sh/scan/example.com",
params={"fmt": "json"}).json()
print(threat["threat_level"])# Plain text
(Invoke-WebRequest `
"ipconfig.sh/scan/8.8.8.8").Content
# JSON
Invoke-RestMethod `
"ipconfig.sh/scan/example.com?fmt=json"# JSON (excerpt)
{
"query": "8.8.8.8",
"input_type": "ip",
"threat_level": 0,
"verdict": {
"category": null,
"label": "clean"
},
"geoip": {
"country_code": "US",
"country_name": "United States"
},
"dns": {"ptr": ["dns.google"]},
"raw_entries": [],
"sources": []
}