API Reference
Server-backed tools call one same-origin diagnostics endpoint. Each request runs a single tool by slug and returns a small JSON envelope.Endpoint
| Method | Path | Purpose |
|---|---|---|
POST | /api/tools/[slug] | Run one diagnostics tool |
Request body
input is a string. The expected format depends on the tool.
Response envelope
Every response uses the same top-level shape:error instead of data:
Available slugs
| Slug | Input | Returns | | --- | --- | |dns-lookup | Domain name | A, AAAA, MX, TXT, CNAME, NS, and SOA records |
| http-headers | HTTP or HTTPS URL | Status, response time, and response headers |
| ssl-checker | Hostname or host:port | TLS authorization, protocol, cipher, and certificate summary |
| uptime | HTTP or HTTPS URL | Online flag, status, status text, and response time |
| port-checker | host:port | TCP reachability, resolved address, and timing |
| my-ip | Empty string | Public IP inferred from request headers |
| ip-geolocation | Public IP address | RDAP network summary, country, and ASN data |
| asn-lookup | Public IP address or ASN | Team Cymru ASN records |
| whois-lookup | Domain or public IP address | RDAP registration and network summary |
| redirect-checker | HTTP or HTTPS URL | Redirect chain up to eight hops |
| robots-sitemap | HTTP or HTTPS URL | robots.txt preview, declared sitemaps, and sitemap.xml status |
Example
Validation and limits
| Rule | Details |
|---|---|
| Input length | Inputs longer than 2,048 characters are rejected |
| URLs | Only HTTP and HTTPS URLs are supported |
| Credentials | URLs with embedded credentials are rejected |
| Address safety | Private, local, reserved, and multicast IP addresses are rejected for outbound checks |
| Fetch timeout | HTTP and RDAP provider requests time out after 8 seconds |
| TCP timeout | Port and TLS checks time out after 7 seconds |
| Body size | Request bodies over 4 KiB are rejected |
| Cross-origin requests | Browser requests with a foreign Origin header are rejected |
| Rate limiting | Requests are limited by client identity, tool slug, and target |
| Short cache | DNS responses cache for 60 seconds; RDAP caches for 1 hour; ASN responses cache for 30 minutes |
Providers and attribution
RDAP-backed responses use rdap.org for domain and IP registration data. ASN responses use Team Cymru’s DNS-based ASN service. Provider outages return a502 error in the standard response envelope, while timeouts return 504.
Proxy IP behavior
my-ip only trusts visitor IP headers when TRUST_PROXY_HEADERS=true, or when TRUSTED_PROXY_PLATFORM is set to vercel, netlify, or cloudflare. In trusted mode, header precedence is:
cf-connecting-ipx-real-ip- the first value in
x-forwarded-for
my-ip returns an unavailable state instead of echoing spoofable headers.
Worker-required tools
These slugs exist in the product catalog but return a friendly501 disabled response from the shared API until ENABLE_WORKER_TOOLS=true and DIAGNOSTICS_WORKER_URL point to a healthy container or VM worker:
| Slug | Why |
|---|---|
ping | ICMP ping requires raw socket permissions |
packet-loss | Packet-loss sampling requires ICMP support |
traceroute | Traceroute requires traceroute privileges |
POST /api/tools/[slug]; the Next.js route proxies internally to worker endpoints such as POST /api/ping.