{"uid":"cap_4KEWEXECtieVT2SDmkQ3Y","slug":"delx-commerce-pdf-header-sniff-a09652c3","name":"Delx Commerce PDF Header Sniff","description":"Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.","url":"https://commerce.delx.ai/api/v1/x402/pdf-header-sniff?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"base64_prefix":{"type":"string","description":"Base64 prefix of a file for sniffing"}}},"responseSchema":{"type":"json","example":{"is_pdf":true,"schema":"delx/util-pdf-header-sniff/v1","decoded_prefix_len":8}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Ginm5pLcMw7Pusk1iElsy","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Detects whether a base64-encoded file prefix represents a valid PDF by inspecting its binary header bytes.","exampleAgentPrompt":"Can you check if this base64 snippet I have is actually a PDF file? Here's the prefix: 'JVBERi0xLjQgJeL...'","exampleUseCases":[{"title":"Pre-validate upload before PDF extraction","prompt":"Before I try to parse this file as a PDF, can you sniff its header to confirm it's actually a valid PDF? Here's the base64 prefix: 'JVBERi0xLjMgJ...'"},{"title":"Filter non-PDF files in document pipeline","prompt":"I'm getting files from users and need to quickly check which ones are PDFs before sending them to my document extractor — can you sniff the file header from this base64 prefix to tell me if it's a PDF?"},{"title":"Detect misnamed PDF attachments","prompt":"Someone sent me a file with a .txt extension but I suspect it might actually be a PDF — can you look at the first few bytes from this base64 prefix and tell me if it's really a PDF?"}],"resultDescription":"Returns a JSON object with a boolean 'is_pdf' indicating whether the file header matches PDF format, the length of the decoded prefix examined, and a schema version string ('delx/util-pdf-header-sniff/v1').","failureModes":["Missing or empty base64_prefix field returns an error","Invalid base64 encoding causes a decode failure","Prefix too short to contain a full PDF magic bytes signature may return false negatives","Payment failure via x402 protocol blocks the request"],"whenToPreferThis":"Use this endpoint when you need a fast, cheap ($0.001 USDC) programmatic check to confirm a file is a PDF before committing to heavier processing like full PDF parsing or extraction. Ideal for agent pipelines that receive arbitrary file uploads and need to gate on file type without downloading or parsing the full file.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T00:53:59.934Z","isFirstParty":false,"canonicalSlug":"delx-commerce-pdf-header-sniff-a09652c3"}