How to check if a URL is valid and reachable
You have a URL and you need to know if it actually works - not just whether it's formatted correctly, but whether it responds. Here's how to do it with a single API call.
The problem
Validating URLs with a regex tells you almost nothing. A URL can be perfectly formatted and still return a 404, redirect to a completely different domain, or time out entirely. You need to actually send a request.
But making outbound HTTP requests from your application adds complexity: timeout handling, redirect following, error categorisation, and rate limiting. TinyUtils handles all of that for you.
Quick solution
Send a GET request to /api/url-check with the URL you want to validate. You get back a structured response telling you exactly what happened.
curl
curl "https://tinyutils.dev/api/url-check?url=https://example.com"
Response
{
"reachable": true,
"status": 200,
"final_url": "https://example.com/",
"response_time_ms": 215,
"error": null
}JavaScript (fetch)
const res = await fetch(
"https://tinyutils.dev/api/url-check?url=https://example.com"
);
const { reachable, status, final_url } = await res.json();
if (!reachable) {
console.error("URL is not reachable");
}Use cases
- •Validate user-submitted URLs before saving to your database
- •Check if webhook URLs are live before enabling them
- •Verify outbound links in your CMS aren't broken
- •Audit imported datasets for dead URLs
- •Test integration endpoints in staging environments
Checking multiple URLs at once
Use the batch endpoint to check up to 10 URLs in a single request.
curl -X POST "https://tinyutils.dev/api/url-check/batch" \
-H "Content-Type: application/json" \
-d '{"urls":["https://example.com","https://broken.example.com"]}'Try the URL Check tool
Paste any URL and see live results - no setup, no auth.
Open URL Check →