API documentation

LiteIpRegion exposes two JSON endpoints: one looks up an IP you supply, the other resolves the caller's own address. Both return the same envelope and the same location fields.

Data updated: 2026-10-31T08:15:21Z

Look up an IP

POST /api/ip/lookup with a JSON body containing a single ip field. The backend validates the address with Go's netip parser.

POST /api/ip/lookup

curl -s https://ipregion.litelake.cn/api/ip/lookup \
  -H "Content-Type: application/json" \
  -d '{"ip":"8.8.8.8"}'

200

{
  "code": 200,
  "message": "success",
  "data": {
    "ip": "8.8.8.8",
    "country": "United States",
    "country_code": "US",
    "province": "California",
    "province_code": "US-CA",
    "city": "Mountain View",
    "isp": "Google LLC",
    "latitude": 37.3889,
    "longitude": -122.0835,
    "timezone": "America/Los_Angeles"
  }
}

Look up my IP

GET /api/ip/myip resolves the caller's own address. The server uses the gateway-provided client IP, so the result reflects the public address seen by the edge.

GET /api/ip/myip

curl -s https://ipregion.litelake.cn/api/ip/myip

Result

The API returns a stable envelope with code, message and data. The fields are the same ones shown on the query page.

Error codes

Errors use the same envelope: code, message and an optional data field. The HTTP status remains 200 for business errors, with the code carrying the semantic.

codeError codes
200Lookup succeeded.
400Missing or invalid ip, or the address could not be parsed.
404No location was found for this address.
503The dataset is loading or unavailable; retry shortly.

Data sources

Lookups combine ip2region (v4/v6) with MaxMind GeoLite2 City and ASN. Data files are refreshed on a schedule and reloaded in place.

API keys

Normal browser and script usage needs no key. High-volume integrations can request a key from the team; keys are rate limited and never required for the public query page.

Health checks

GET /api/health reports process liveness. GET /api/ready also checks dependencies such as Redis.