An easy to use IP address lookup

Your IP address

…

Looking you up…

$ curl host.sh

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.

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"

Parameters

ipIPv4 or IPv6 address to look up, or put it in the path: /v2/lookup/8.8.8.8
fieldsOnly these parts of the answer, e.g. fields=geo.country.code,connection.ip
format=textOne field as plain text, e.g. fields=geo.city.name&format=text
langPlace names in en, de, es, fr, ja, pt-BR, ru or zh-CN
hostname=1Add the reverse DNS name
pretty=1Indented JSON
callbackJSONP
ua, alUser-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"}]}