API
Network diagnostics API for scripts and AI agents
No key, no signup. Plain text when you need one value, compact JSON for tool calls, and a full diagnostic when an agent needs context. Machine-readable docs at /openapi.json and /llms.txt.
curl https://ipcheck.trytorchlabs.com/ipcurl "https://ipcheck.trytorchlabs.com/api/v1/me?format=agent"import requests
r = requests.get("https://ipcheck.trytorchlabs.com/api/v1/me", params={"format": "agent"}, timeout=5)
r.raise_for_status()
conn = r.json()
if conn["network_type"] != "residential":
raise RuntimeError(f"unexpected exit network: {conn}")const res = await fetch("https://ipcheck.trytorchlabs.com/api/v1/me?fields=ip,country,asn,isp");
const { ip, country, asn, isp } = await res.json();Agent use cases
- Check an agent’s outbound public IP
GET /ip - Verify the country of an automation worker
GET /country - Check the current ASN
GET /asn - Check the current ISP
GET /isp - Confirm a requested country and ASN through a proxy
curl -x … /api/v1/me?fields=country,asn - Check that a proxy is residential
curl -x … /api/v1/me?fields=network_type,hosting - Look up a customer-reported IP
GET /api/v1/ip/{ip} - Give a support agent full network context
GET /api/v1/diagnostic - Validate a proxy against expectations (planned)
POST /api/v1/proxy/validate - Test sticky-session stability (planned)
POST /api/v1/proxy/session-test
As an agent tool
Wrap the endpoint as a tool. The REST service layer is designed to be exposed through MCP tools later (check_current_ip, lookup_ip, get_connection_diagnostics, and the proxy tools).
{
"name": "check_current_ip",
"description": "Return this agent's public IP, country, ASN, ISP and network type.",
"input_schema": { "type": "object", "properties": {} }
}
// implementation: GET https://ipcheck.trytorchlabs.com/api/v1/me?format=agentContract
- Versioned under
/api/v1. Keys are stable; new keys may be added. - Unknown values are
null, never guessed. - Proxy, VPN, Tor and hosting are estimates. Read certainty from
confidence(/me) orclassification(/diagnostic). - Rate limits per IP per minute: 120 for connection endpoints, 30 for lookups, 5 for proxy endpoints.
- fields allowlist:
ip, ip_version, country, country_name, region, city, postal_code, latitude, longitude, timezone, asn, asn_name, isp, organization, network_type, proxy, vpn, tor, hosting, reverse_dns, user_agent, http_version, client_type, timestamp