{"uid":"cap_GzKxLqVXXXH39Cx361mG_","slug":"convert-guru-file-type-detection-dc7a399e","name":"Convert.Guru File Type Detection","description":"Detects the likely real file format from filename, file creation time, file size, and the first 200 bytes of the file. Identifies common formats such as PDF, DOCX, XLSX, CSV, JPG/JPEG, PNG, WEBP, HEIC, TXT, HTML, MP3, WAV, MP4, AVI, MPEG, and WEBM, as well as about 15,000 other file types.","url":"https://convert.guru/api/x402/v1/detect-file-type?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"filename":{"type":"string","description":"Original filename, e.g. document.pdf, report.docx, data.csv, image.png"},"created_at":{"type":"string","description":"File creation timestamp in ISO 8601 format"},"size_bytes":{"type":"integer","description":"Total size of the file in bytes"},"header_first_200_bytes_base64":{"type":"string","description":"Base64 encoded first 200 bytes of the file"}}},"responseSchema":{"type":"json","example":{"payment":{"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x222c4F009c63E24cE9176C0f7f3b64E7Da0f0699","amount":{"amount":"0.002000","currency":"USDC","decimals":6,"atomic_units":"2000"},"scheme":"exact","network":"eip155:8453","tx_hash":"0x...","protocol":"x402","transaction_id":"0x...","settlement_status":"settled"},"detected":true,"convertible_to":["docx","txt","png","jpg","html"],"input_filename":"document.001","detected_format":{"format":"pdf","confidence":0.99,"description":"PDF document","confidence_percent":99,"canonical_extension":"pdf"},"suggested_filename":"document.pdf","convert_file_compatibility":{"reason":"The header matches PDF, but only the first 200 bytes were inspected.","status":"likely","confidence":0.8}}},"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":{"p10Cents":"0.2000","medianCents":"0.2000","p90Cents":"0.2000","minCents":"0.2000","maxCents":"0.2000","p95Cents":"0.2000","sampleCount":1,"varies":false,"failureChargeRate":1},"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_B1rL8nYX30FxH_yUgUfk2","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 file type of an uploaded file and returns format info, confidence score, and a list of compatible conversion targets","exampleAgentPrompt":"I have a file called 'document.001' and I'm not sure what format it actually is — can you detect its file type and tell me what formats it can be converted to?","exampleUseCases":[{"title":"Identify mystery file format","prompt":"Someone sent me a file with no extension and I have no idea what it is — can you figure out what type of file it is and whether I can do anything useful with it?"},{"title":"Validate file before conversion","prompt":"I have a file that's supposed to be a Word document but I'm not confident it's actually in the right format — can you check what it really is and confirm whether it can be converted to PDF?"},{"title":"Find available output formats","prompt":"I've got a CAD drawing I need to share with my team but I'm not sure what formats it can be exported to — can you detect what kind of file it is and list all the conversion options available?"}],"resultDescription":"Returns a JSON object with: whether the file was detected successfully, the detected format (e.g. 'pdf'), a confidence score (0-1 and percent), a human-readable format description, the canonical file extension, a suggested renamed filename, a list of formats the file can be converted to, and a compatibility status (with reason and confidence) indicating how reliably the file can be converted.","failureModes":["File bytes missing or malformed — detection fails with no format match","File header too short (only first 200 bytes inspected) — may return 'likely' rather than confirmed status","Unknown or unsupported file format — detected=false with empty convertible_to list","Payment not settled — x402 payment required before result is returned","File is corrupted or truncated — low confidence score returned"],"whenToPreferThis":"Use this endpoint when you need to identify an unknown file's format before attempting conversion, validate that a file matches its claimed extension, or determine which output formats are available for a given input file. Prefer this over guessing by file extension alone, especially for files with non-standard or missing extensions.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T06:41:27.973Z","isFirstParty":false,"canonicalSlug":"convert-guru-file-type-detection-dc7a399e"}