TCPLab TCPLab

IP Lookup API

Last updated: 2026-10-15

GET /api/v2/ip/{target}

Looks up the geolocation of an IPv4/IPv6 address. For a domain, the API resolves it first and then looks up the preferred address.

Base URL, response format and rate limits are shared across endpoints — see the API documentation.

Parameter In Description
target path IPv4/IPv6 address or domain name.
lang query en (default) or zh, controls the language of country / region / city names.

Example:

curl "https://tcp.lc/api/v2/ip/8.8.8.8?lang=en"

Response data fields:

Field Description
target The input target (domain or IP).
ip The address the lookup was performed on.
version 4 or 6.
addresses Addresses resolved from a domain (empty for direct IP queries).
source Data source: TCPLab, geocn or geolite2.
isDomestic Whether the address belongs to a Chinese network.
country, countryName ISO 3166-1 alpha-2 country code and localized name.
province, city, district Region names, when available.
isp, type ISP and network type (mainly for Chinese addresses).
adcode Chinese administrative division code.
longitude, latitude, timezone Coordinates and time zone, when available.

Common errors: api.param.ip.invalid, api.param.ip.private, api.param.name.invalid, api.notfound.domain.