HTTP Headers API - inspect response headers
Need to inspect HTTP response headers from a script, a CI job, or an API call - without opening DevTools or running curl locally? Use the TinyUtils HTTP Headers API.
The problem
Inspecting response headers outside the browser is harder than it looks. You need to handle redirects manually, deal with TLS, follow Location headers, and parse the raw response - before you even get to the header you care about.
The TinyUtils HTTP Headers API handles all of that in a single GET request and returns clean JSON - ready to use in scripts, automation, or monitoring.
Quick solution
Send a GET request to /api/http-headers with the URL you want to inspect. You get back the final URL, status code, and all response headers in one structured response.
curl
curl "https://tinyutils.dev/api/http-headers?url=https://example.com"
Example response
{
"ok": true,
"input_url": "https://example.com",
"final_url": "https://www.example.com/",
"status": 200,
"headers": {
"content-type": "text/html; charset=UTF-8",
"cache-control": "max-age=604800",
"etag": "\"3147526947+ident\"",
"expires": "Fri, 10 Apr 2026 07:59:29 GMT",
"last-modified": "Thu, 17 Oct 2019 07:18:26 GMT",
"server": "ECAcc (dcb/7F84)",
"vary": "Accept-Encoding",
"x-cache": "HIT"
},
"headers_truncated": false,
"meta": {
"responseTimeMs": 123,
"cached": false,
"rateLimitedScope": "global"
},
"error": null
}JavaScript (fetch)
const res = await fetch(
"https://tinyutils.dev/api/http-headers?url=https://example.com"
);
const data = await res.json();
if (data.ok) {
console.log("Content-Type:", data.headers["content-type"]);
console.log("Cache-Control:", data.headers["cache-control"]);
console.log("Final URL:", data.final_url);
}Use cases
- •Debug caching - check Cache-Control, ETag, and Expires headers
- •Inspect Content-Type before processing a remote resource
- •Validate CORS headers from a script or CI job
- •Check CDN behaviour - detect Cloudflare, Varnish, or Fastly headers
- •Verify security headers like Strict-Transport-Security and X-Frame-Options
- •Monitor header changes across your infrastructure automatically
Code examples
curl - check cache headers
curl -s "https://tinyutils.dev/api/http-headers?url=https://example.com" \ | jq '.headers["cache-control"]'
JavaScript - validate Content-Type
const res = await fetch(
"https://tinyutils.dev/api/http-headers?url=https://api.example.com/data"
);
const { ok, headers, error } = await res.json();
if (!ok) {
console.error("Failed:", error);
} else if (!headers["content-type"]?.includes("application/json")) {
console.warn("Unexpected content-type:", headers["content-type"]);
}See also
Try the HTTP Headers tool
Enter any URL and inspect its response headers instantly.
Open HTTP Headers →