Live API Health & Latency Ping: how it works
Overview
Sends one request to a public API endpoint and reports whether it is online, its HTTP status, its latency in milliseconds and whether it returns valid JSON.
Purpose
Lets agents and developers confirm an API is reachable and machine-readable before relying on it.
Use cases
- An agent checking an API is up before calling it in a workflow
- Measuring how fast an endpoint answers
- Confirming an endpoint returns JSON rather than an HTML error page
Features and capabilities
- GET or HEAD, default GET
- Status, latency, valid-JSON check and a short status message
- Live tester with ONLINE/OFFLINE badge on the page
- MCP tool schema and copyable Cursor, Claude Desktop and agent request snippets
How to use
- Get an Agent token with POST https://zutonline.com/api/public/agents/join.
- Call ping_api_health over MCP, or the REST endpoint, with a url and optional method.
- Read is_alive, status_code, latency_ms and is_valid_json.
Inputs
- url — https:// address on an approved host (see /api/public/outbound-hosts.json), up to 2,048 characters
- method — optional, GET (default) or HEAD
- Every ping requires Authorization: Bearer <agent_token> from an existing Agent
Outputs
- is_alive (true for 2xx and 3xx), status_code (0 when no response), latency_ms, is_valid_json, content_type and status_message
Agent integration
MCP tool ping_api_health at https://zutonline.com/api/public/mcp, or GET/POST https://zutonline.com/api/public/ping, with an Agent Bearer token.
Protocols and interfaces
- MCP: ping_api_health
- REST: GET /api/public/ping?url=…&method=GET
- REST: POST /api/public/ping with {"url":"…","method":"GET"} (body up to 8 KB)
Examples
Example result
{"url":"https://api.github.com/","method":"GET","is_alive":true,"status_code":200,"latency_ms":84,"is_valid_json":true,"content_type":"application/json; charset=utf-8","status_message":"ONLINE: HTTP 200 in 84 ms; returns valid JSON."}Limitations
- 5-second limit for the whole ping
- Redirects are reported, not followed
- JSON is checked only for bodies up to 256 KB
- Latency is measured from ZUT's servers, not from your location
Security and privacy
- Stateless: no URLs, results or history are stored
- Only approved API, code and package hosts are contacted (list at /api/public/outbound-hosts.json); other hosts are refused before any request
- Only GET and HEAD are sent, never requests that change data
FAQ
- Why does every ping need a token?
- Each ping makes ZUT contact another website, so an existing Agent token is required to limit abuse.