Content-Type Header Validator
Pricing
Pay per usage
Content-Type Header Validator
Fetches URLs and validates the Content-Type header (MIME type + optional charset). Flags missing/mismatched types and recommends X-Content-Type-Options: nosniff. Outputs per-URL results plus SUMMARY and REPORT.
Pricing
Pay per usage
Rating
0.0
(0)
Developer

Bikram Adhikari
Actor stats
0
Bookmarked
2
Total users
1
Monthly active users
11 hours ago
Last modified
Categories
Share
Validate whether a website returns the expected Content-Type header (MIME type + optional charset) and optionally warn if X-Content-Type-Options: nosniff is missing.
This is useful for:
- SEO / crawling correctness (HTML should typically be
text/html) - API correctness (JSON should typically be
application/json) - Security hardening (recommend
nosniff)
What the Actor does
For each URL it:
- Fetches headers using the selected strategy (HEAD then optional GET fallback)
- Parses
Content-TypeintomediaTypeandcharset - Infers or uses the configured expected kind (HTML/JSON/XML/PDF/IMAGE/TEXT)
- Produces a per-URL result item + aggregate
SUMMARYandREPORT
Input
- Start URLs (
startUrls): Request List Sources format - Request strategy (
requestStrategy): HEAD-only, GET-only, or HEAD→GET fallback - Expected kind (
expectedKind): AUTO (infer from file extension) or a fixed kind - Require charset (
requireCharset): warn when charset is missing for text/* - Warn if no nosniff (
warnIfNoNosniff): warn whenX-Content-Type-Options: nosniffis missing
Plus: maxUrls, timeoutSecs, followRedirects, maxRedirects, maxConcurrency, and proxyConfiguration.
Output
Dataset (per-URL results)
Each item includes:
startUrl,finalUrl,statusCode,redirected,checkedAtcontentTypeRaw,mediaType,charsetexpectedKind,sniffedKind(best-effort when GET is used)xContentTypeOptions(value ofX-Content-Type-Options)score(0–100 heuristic),issues,warningCount,errorCount,ok
Key-value store
SUMMARY: aggregate counts and top issue codesREPORT: same as summary (structured JSON)
Example input
{"startUrls": [{"url":"https://example.com"},{"url":"https://httpbin.org/json"}],"maxUrls": 2,"timeoutSecs": 20,"requestStrategy": "HEAD_THEN_GET","expectedKind": "AUTO","warnIfNoNosniff": true,"maxConcurrency": 2,"proxyConfiguration": {"useApifyProxy": false}}
Quick start
Store page: https://apify.com/scrappy_garden/content-type-header-validator
Paste this into Input and click Run:
{"startUrls": [{"url": "https://example.com/"}],"proxyConfiguration": {"useApifyProxy": false}}
Outputs (what you get)
- Dataset: Dataset items typically include fields like:
startUrl,finalUrl,statusCode,contentTypeRaw,mediaType,charset,expectedKind,sniffedKind,xContentTypeOptions,score. - Key-value store:
REPORT,SUMMARY
Tips (trust + predictable results)
- Start with 1–3 URLs to validate behavior, then scale up.
- If a target blocks requests, enable Proxy and/or slow down concurrency in Input.
- Use the
SUMMARY/REPORTkeys (when present) for automation pipelines and monitoring.
Related actors
- security-headers-checker (https://apify.com/scrappy_garden/security-headers-checker)
- hsts-header-checker (https://apify.com/scrappy_garden/hsts-header-checker)
- cache-control-checker (https://apify.com/scrappy_garden/cache-control-checker)
- x-frame-options-header-checker (https://apify.com/scrappy_garden/x-frame-options-header-checker)
Search keywords
content type header validator, content-type header validator - check mime type, charset, nosniff, website audit, seo, http headers