GET /api/url-check

URL Check

Check if a URL is reachable, follow redirects, and measure response time. Returns reachability even for 4xx/5xx responses - only network failures count as unreachable.

Query parameters

urlrequiredThe URL to check. Scheme may be http or https; if omitted, https is assumed.

Example request

curl

curl "https://tinyutils.dev/api/url-check?url=https://vercel.com"

JavaScript (fetch)

const res = await fetch(
  "https://tinyutils.dev/api/url-check?url=https://vercel.com"
);
const data = await res.json();

Example response

{
  "reachable": true,
  "status": 200,
  "final_url": "https://vercel.com/",
  "response_time_ms": 312,
  "error": null
}

Error response

{
  "reachable": false,
  "status": null,
  "final_url": null,
  "response_time_ms": 2500,
  "error": "TIMEOUT"
}

Error codes

INVALID_URLThe URL is malformed or uses an unsupported protocol.
BLOCKED_HOSTThe target resolves to a private or reserved address.
RATE_LIMITEDYou have exceeded the daily request limit.
TIMEOUTThe request exceeded the 2.5s timeout.
TLS_ERRORTLS certificate validation failed.
NETWORK_ERRORCould not reach the host (DNS failure, connection refused, etc.).
UNKNOWN_ERRORAn unexpected error occurred.

Rate limiting

Requests are rate-limited via a global pool shared with dns-lookup and url-resolve. When the limit is exceeded, the endpoint returns HTTP 429 with RATE_LIMITED.

Batch endpoint

Check up to 10 URLs in a single request.

MethodPOST
Path/api/url-check/batch

curl

curl -X POST "https://tinyutils.dev/api/url-check/batch" \
  -H "Content-Type: application/json" \
  -d '{"urls":["https://example.com","https://openai.com"]}'

JavaScript (fetch)

const res = await fetch("https://tinyutils.dev/api/url-check/batch", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ urls: ["https://example.com", "https://openai.com"] }),
});
const data = await res.json();

See also

Looking for use-case guidance? Check if a URL is valid walks through common validation scenarios and integration patterns.