{"openapi":"3.1.0","info":{"title":"File Type Detection API","version":"1.0.0","description":"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.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/filetype-api","description":"oanor gateway"}],"tags":[{"name":"Detect"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/detect":{"get":{"operationId":"get_v1_detect","tags":["Detect"],"summary":"Detect file type from content","description":"","parameters":[{"name":"file","in":"query","required":true,"description":"Base64 file content (or use url)","schema":{"type":"string"},"example":"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg=="},{"name":"url","in":"query","required":false,"description":"File URL to fetch instead of base64","schema":{"type":"string"}},{"name":"filename","in":"query","required":false,"description":"Claimed filename to check for a spoofed extension","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"ext":"png","mime":"image/png","detected":true,"size_bytes":70},"meta":{"timestamp":"2026-06-02T16:51:55.594Z","request_id":"493a33aa-063d-4cc6-afc6-75f66de2e84c"},"status":"ok","message":"Detect file type from content","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"auth":"none upstream; this gateway requires x-api-key","name":"File Type Detection API","note":"Detect the true file type from its content (magic bytes), not its name. Pass ?url= a file URL or ?file= base64. Recognises 100+ binary formats (images, audio, video, archives, documents, fonts, …). Optionally pass ?filename= to flag a spoofed extension. Text formats (txt, csv, svg, json) have no signature and return detected=false. Distinct from mime-api (extension lookup). Live, nothing stored.","source":"Local magic-byte detection (file-type) — no key, no upstream","endpoints":2},"meta":{"timestamp":"2026-06-02T16:51:55.704Z","request_id":"158d85cb-88a0-45b6-9407-7f739a16a6b6"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":1320,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":500,"monthly_call_quota":19000,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2460,"monthly_call_quota":164000,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":6060,"monthly_call_quota":840000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/filetype-api"}