Back

#magic-bytes

2 APIs with this tag

File Type Detection API

Detect the true type of a file from its content — its magic bytes / binary signature — not from its name. Send a file by URL or base64 and get back the real extension and MIME type, recognising 100+ binary formats: images (PNG, JPEG, GIF, WebP, AVIF, HEIC), audio and video (MP3, MP4, WAV, FLAC, MKV), archives (ZIP, GZIP, 7z, RAR, TAR), documents (PDF, DOCX, XLSX), fonts and more. Optionally pass a filename to flag a spoofed extension (e.g. a PNG renamed to .txt). Text formats like TXT, CSV, JSON and SVG have no signature and return detected=false. Detection is local — no key, no third-party service. Live, nothing stored. 2 endpoints. Built for secure upload validation, anti-spoofing checks, content pipelines and forensics. Distinct from an extension-to-MIME lookup.

api.oanor.com/filetype-api

MIME API

A fast, fully-local MIME and file-type toolkit: look up the MIME type, charset and category for a filename or extension, list every file extension registered for a MIME type, and detect a file's real type from its leading magic bytes (over 40 signatures, including RIFF container disambiguation for WEBP, WAV and AVI), accepting hex or base64 input. Every endpoint accepts input via the query string or the request body. Pure server-side compute, no third-party upstream, so responses are instant and always available. Ideal for upload validation, security (verify a file's real type against its claimed extension), CDNs and content pipelines.

api.oanor.com/mime-api