Перейти к содержимому
POST AI agent ready /v1/uptime/check

Uptime Check API - Monitor URL Status with History

Sends a HEAD request to the URL, records status and response time, and persists the result for 7 days in edge KV. Returns the current check plus the last 10 history entries for that URL (hashed for storage). Treats 2xx and 3xx as up; 4xx, 5xx, and network errors as down.

Parameters

stringrequired

Full URL to check, http:// or https://.

Code examples

curl -X POST https://api.botoi.com/v1/uptime/check \
  -H "Content-Type: application/json" \
  -d '{"url":"https://api.stripe.com/healthcheck"}'

When to use this API

Build a status page without running a monitor

Schedule this endpoint from a cron job every 5 minutes. The rolling history gives you the last 50 minutes of data without any database on your side. Render it on a status page or Slack board.

Smoke-test deploys

After each production deploy, call the endpoint against 3-5 critical URLs. Fail the deploy pipeline when any of them comes back is_up:false. Catches DNS misroutes and CDN cache issues early.

Third-party dependency tracking

For every external API your service depends on (Stripe, SendGrid, your auth provider), run hourly checks. The 10-check history surfaces intermittent outages that single-point checks miss.

Frequently asked questions

How long is history retained?
Each check is stored for 7 days in Cloudflare KV. The response shows the last 10 checks regardless of age; older entries beyond 10 are kept until their 7-day TTL expires.
Is the history per URL or per caller?
Per URL. The URL is hashed (SHA-256, first 16 chars) and that hash becomes the KV key prefix. Different callers checking the same URL see the same history.
What counts as "up"?
HTTP status codes 200-399 are treated as up (is_up:true). 4xx and 5xx responses plus network failures (timeout, DNS, TLS errors) are is_up:false with status 0 on network errors.
What is the request timeout?
15 seconds per check. response_time_ms reflects actual latency including any retries; if the timeout fires, response_time_ms is ~15000 with is_up:false.
Does HEAD work for every URL?
Most sites support HEAD. Some broken servers return 405 or close the connection; the endpoint does not retry with GET, so those URLs look down here even when they work in a browser.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.