An easy to use IP address lookup
Your IP address
…
IPv4 …
Looking you up…
$ curl host.sh
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 # one field, plain text curl host.sh/city
Fields: ip, hostname, city, region, region_code, country, country_code, continent, continent_code, latitude, longitude, time_zone, offset, postal, isp, asn, asn_org, org.
With a token: any IP
One endpoint, JSON out. Send your token as a query parameter, a JSON body field, or a Bearer header.
curl "https://api.host.sh/v2/lookup/?token=YOUR_TOKEN&ip=8.8.8.8" curl -H "Authorization: Bearer YOUR_TOKEN" \ "https://api.host.sh/v2/lookup/?ip=8.8.8.8"
Tokens are invite only for now.
Token API parameters
| ip | IPv4 or IPv6 address to look up |
|---|---|
| ua | User-Agent string to parse (needs the UA permission) |
| al | Accept-Language header value |
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" },
"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 }
},
"connection": {
"ip": "8.8.8.8",
"isp": { "asn": 15169, "name": "Google", "organization": "Google" },
"type": "Corporate",
"anonymity": { "vpn": { "score": 0 }, "tor": { "score": 0 }, … },
"usage": { … }
}
}
Errors
{"errors":[{"message":"Forbidden","code":403}]}