API Documentation
Last updated: 2026-10-19
The TCPLab API offers the same network lookups as the web tools, without an API key. Pick an endpoint below for its parameters and response fields.
Endpoints
| Endpoint | Method | Description |
|---|---|---|
| IP lookup | GET /api/v2/ip/{target} |
Geolocation for an IPv4/IPv6 address or domain. |
| My IP | GET /api/v2/myip |
Geolocation of the caller's own IP. |
| DNS lookup | POST /api/v2/dns/query |
Query A, AAAA, CNAME, TXT, MX and NS records. |
| WHOIS lookup | GET whois.tcp.lc/v1/whois/{domain} |
Registrar, dates, statuses and nameservers for a domain, over RDAP/WHOIS. |
| ICP filing lookup | GET /api/v2/icp/query?domain={domain} |
ICP filing number, registrant, entity type and approval date for a domain. |
| SSL certificate check | POST /api/v2/tls/check |
Certificate validity, expiry, issuer, SANs, TLS version and HTTP/2 support. |
| Plain-text API | GET / · GET /text |
The caller's IP and location as text/plain, for the command line. |
General
Applies to the /api/v2/ JSON endpoints. WHOIS lookup and the plain-text API differ in host and conventions — see their pages.
- Base URL:
https://tcp.lc; JSON endpoints live under/api/v2/. - Every JSON response uses HTTP status 200. Read the
codefield instead:200means success,-1000means failure. - On failure,
msgis a stable error identifier (such asapi.param.ip.invalid) anddata.argsmay carry details. - Cross-origin requests are allowed (
Access-Control-Allow-Origin: *).
Rate limits
Limits are per client IP; every request counts, including ones that fail, unless the endpoint notes otherwise. The plain-text endpoints return text/plain and are not rate limited.
| Endpoint | Limit |
|---|---|
| IP lookup | 60 requests / minute and 1000 requests / day |
| My IP | 60 requests / minute and 1000 requests / day |
| DNS lookup | 50 requests / day |
| ICP filing lookup | 20 requests / day (cache hits are not counted) |
| SSL certificate check | 10 requests / minute and 100 requests / day |
| WHOIS lookup | 10 requests / minute |
When a limit is exceeded, the /api/v2/ endpoints return code: -1000 with msg set to api.rate.limited or api.rate.limitedDaily, plus a Retry-After header in seconds; daily quotas reset at 00:00 UTC+8. WHOIS lookup instead returns HTTP 429.