An easy to use IP address lookup
Your IP address
…
IPv4 …
Looking you up…
Location
Network
Flags
Approximate location, not a street address.
Look up any IP
Looking up other IPs needs an API token. Your token stays in this tab only and is sent straight to api.host.sh.
Location
Network
Raw JSON
The full API response for the last lookup
{}
API
No token: your own IP
From a terminal, over HTTP or HTTPS. Limited to 10 requests a minute.
curl host.sh # your IP details curl host.sh/json # same, as JSON curl host.sh/ip # just your IP curl host.sh/city # one field, plain text curl host.sh/help # all fields
Fields: ip, hostname, city, region, region_code, country, country_code, continent, continent_code, latitude, longitude, time_zone, offset, utc_offset, local_time, postal, flag, is_eu, currency, calling_code, isp, asn, asn_org, org.
With a token: any IP
JSON out. Send your token as a query parameter, a JSON body field, or a Bearer header.
curl -H "Authorization: Bearer YOUR_TOKEN" \ https://api.host.sh/v2/lookup/8.8.8.8 curl "https://api.host.sh/v2/lookup/?token=YOUR_TOKEN&ip=8.8.8.8"
Tokens are invite only for now.
Parameters
| ip | IPv4 or IPv6 address to look up, or put it in the path: /v2/lookup/8.8.8.8 |
|---|---|
| fields | Only these parts of the answer, e.g. fields=geo.country.code,connection.ip |
| format=text | One field as plain text, e.g. fields=geo.city.name&format=text |
| lang | Place names in en, de, es, fr, ja, pt-BR, ru or zh-CN |
| hostname=1 | Add the reverse DNS name |
| pretty=1 | Indented JSON |
| callback | JSONP |
| ua, al | User-Agent and Accept-Language strings to parse |
Batch
Up to 100 addresses in one request, answered in the same order.
curl -H "Authorization: Bearer YOUR_TOKEN" \ -d '["8.8.8.8", "1.1.1.1"]' https://api.host.sh/v2/lookup/batch/
Full reference: OpenAPI spec. Just your IP as text: curl api.host.sh/v2/ip/ (or ipv4.host.sh/v2/ip/ for IPv4).
Response
Example for 8.8.8.8. Which sections you get depends on your token's plan.
{
"geo": {
"continent": { "code": "NA", "name": "North America" },
"country": { "code": "US", "name": "United States", "flag": "🇺🇸",
"is_eu": false, "calling_code": "+1", "capital": "Washington D.C.",
"currency": { "code": "USD", "symbol": "$" } },
"subdivision": { "code": "CA", "name": "California" },
"city": { "name": "Mountain View" },
"postal_code": "94043",
"latitude": 37.4, "longitude": -122.1, "radius": 1000,
"timezone": { "name": "America/Los_Angeles", "offset": 420, "utc_offset": "-07:00",
"is_dst": true, "current_time": "2026-10-22T11:05:00-07:00" }
},
"connection": {
"ip": "8.8.8.8", "version": 4, "bogon": false,
"isp": { "asn": 15169, "name": "Google", "organization": "Google" },
"type": "Corporate",
"anonymity": { "vpn": { "score": 0 }, "tor": { "score": 0 }, … },
"usage": { … }
}
}
Errors
{"errors":[{"code":400,"message":"Bad request","reason":"INVALID_IP_ADDRESS",
"detail":"ip must be an IPv4 or IPv6 address"}]}