{"uid":"cap_YDd1rlK3Vuw-lbPGu-XG2","slug":"fastx402-file-signature-detector-2bd19916","name":"FastX402 File Signature Detector","description":"200 pay-per-call tools for AI agents, from $0.001 per request in USDC on Base or Solana with x402. No account, no API key.","url":"https://fastx402.tools/file-signature-detect?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["data","encoding"],"properties":{"data":{"type":"string","description":"A short byte prefix encoded as hexadecimal or base64"},"encoding":{"type":"string","description":"The data encoding: hex or base64"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"mime":{"type":"string"},"extensions":{"type":"array","items":{"type":"string"}}}}}}}},"responseSchema":{"type":"json","example":{"mime":"image/png","extensions":["png"]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_1BDyqh1Foh5v2T5qsm4V1","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Detects the MIME type and file extensions of a file by analyzing its magic byte prefix (hex or base64 encoded)","exampleAgentPrompt":"I have a file whose first bytes are '89504e47' in hex — can you detect what MIME type and file extension that corresponds to?","exampleUseCases":[{"title":"Validate uploaded file type","prompt":"I received a file upload but I don't trust the extension — the first bytes in hex are 'ffd8ffe0'. Can you tell me what MIME type and extensions that byte signature actually matches?"},{"title":"Identify mystery binary blob","prompt":"I've got a base64-encoded file header 'iVBORw0KGgo=' and I need to know what file format this is before I process it — what MIME type does that correspond to?"},{"title":"Enforce content policy on agent pipeline","prompt":"Before storing this file, check its magic bytes — the hex prefix is '25504446' — and tell me if it's a PDF so I can route it to the right handler."}],"resultDescription":"A JSON object containing the detected MIME type string (e.g. 'image/png') and an array of associated file extensions (e.g. ['png']). If the byte sequence matches a known format, both fields are populated; otherwise the response may indicate an unknown type.","failureModes":["Unrecognized byte prefix returns no match or empty result","Invalid encoding parameter (neither 'hex' nor 'base64') causes a bad request error","Malformed or truncated hex/base64 string may produce incorrect detection or an error","Byte prefix too short to match any magic signature returns ambiguous result","Payment failure via x402 results in 402 response before the tool is invoked"],"whenToPreferThis":"Use this endpoint when you need lightweight, stateless file-type detection from raw bytes without uploading an entire file or relying on file extensions or content-type headers. It is ideal for agent pipelines that receive binary blobs, user uploads, or network streams and need to validate or route files by their true format. Prefer it over full-file parsing libraries when only the magic byte prefix is available or when cost-efficiency at $0.002/call matters.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T07:00:15.596Z","isFirstParty":false,"canonicalSlug":"fastx402-file-signature-detector-2bd19916"}