{"uid":"cap_iVbj93KnAztdcaUiNOV_O","slug":"x402-pdf-document-extraction-5142ae46","name":"X402 PDF Document Extraction","description":"Pay-per-request data tools for AI agents.","url":"https://x402.feld-feder.at/v1/document/pdf","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","title":"DocumentPdfRequest","required":["url"],"properties":{"url":{"type":"string","title":"Url","maxLength":4096,"minLength":1},"mode":{"enum":["auto","text","structured"],"type":"string","title":"Mode","default":"auto","description":"Auto uses pypdf for useful machine text; structured forces the private layout/OCR worker."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST","PUT","PATCH"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","title":"ResponseEnvelope[DocumentPdfResult]","required":["data"],"properties":{"ok":{"type":"boolean","const":true,"title":"Ok","default":true},"data":{"type":"object","title":"DocumentPdfResult","required":["processor","page_count","processing_time_ms"],"properties":{"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text","default":null},"format":{"type":"string","const":"pdf","title":"Format","default":"pdf"},"markdown":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Markdown","default":null},"processor":{"enum":["pypdf","docling"],"type":"string","title":"Processor"},"page_count":{"type":"integer","title":"Page Count"},"processing_time_ms":{"type":"number","title":"Processing Time Ms"}},"additionalProperties":false},"cache":{"anyOf":[{"type":"object","title":"CacheInfo","required":["hit"],"properties":{"hit":{"type":"boolean","title":"Hit"},"age_seconds":{"type":"integer","title":"Age Seconds","default":0,"minimum":0}}},{"type":"null"}],"default":null},"source":{"anyOf":[{"type":"object","title":"SourceInfo","required":["requested_url","final_url","retrieved_at"],"properties":{"final_url":{"type":"string","title":"Final Url"},"status_code":{"anyOf":[{"type":"integer","maximum":599,"minimum":100},{"type":"null"}],"title":"Status Code","default":null},"content_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Hash","default":null},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type","default":null},"retrieved_at":{"type":"string","title":"Retrieved At","format":"date-time"},"requested_url":{"type":"string","title":"Requested Url"},"redirect_count":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Redirect Count","default":null}}},{"type":"null"}],"default":null},"_payment":{"anyOf":[{"type":"object","title":"PaymentInfo","required":["amount_usdc","network"],"properties":{"network":{"type":"string","title":"Network"},"amount_usdc":{"anyOf":[{"type":"number","minimum":0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Amount Usdc"},"transaction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction","default":null}}},{"type":"null"}],"default":null},"warnings":{"type":"array","items":{"type":"object","title":"WarningInfo","required":["code","message"],"properties":{"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"}}},"title":"Warnings"},"provenance":{"type":"array","items":{"type":"string"},"title":"Provenance"}}}}}}},"responseSchema":{"type":"json","example":{"ok":true,"data":{"text":"Example","format":"pdf","markdown":null,"processor":"pypdf","page_count":1,"processing_time_ms":1}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.015","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"down","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.015/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.015","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.015","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_WDk73Rsxm971LOoomwqnR","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.015","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Fetches a PDF from a URL and extracts its text content, returning plain text or structured output using pypdf or OCR-based layout analysis.","exampleAgentPrompt":"Can you grab the PDF at https://example.com/report.pdf and extract all the text from it? Use structured mode so the layout is properly handled.","exampleUseCases":[{"title":"Research paper text extraction","prompt":"Extract the full text from this academic PDF so I can summarize it: https://arxiv.org/pdf/2301.00001.pdf — use auto mode."},{"title":"Scanned invoice OCR processing","prompt":"This PDF invoice at https://files.mycompany.com/invoice-2024-05.pdf is probably scanned, so use structured mode to extract the text from it so I can parse out the line items."},{"title":"Legal contract content retrieval","prompt":"Pull the text out of this contract PDF at https://legal.example.com/contract.pdf and give me the full contents so I can review the terms."}],"resultDescription":"A JSON object with an 'ok' flag and a 'data' object containing: the extracted 'text' (plain string or null), 'markdown' (formatted or null), 'format' (always 'pdf'), 'processor' (either 'pypdf' for machine-readable PDFs or 'docling' for OCR/layout), 'page_count' (integer), and 'processing_time_ms'. May also include cache hit info and source URL metadata.","failureModes":["URL unreachable or returns non-PDF content — likely returns an error envelope with no text","PDF is password-protected or encrypted — extraction may fail or return empty text","Very large PDFs may time out or incur higher latency","Scanned PDFs in auto mode may return empty text if pypdf is selected instead of docling","Malformed URL input (too long, empty) — schema validation error","Payment failure via x402 protocol — request blocked before processing"],"whenToPreferThis":"Choose this endpoint when you need to extract text from a PDF document available at a public URL, especially when you want automatic fallback between fast pypdf extraction and full OCR/layout analysis. It is pay-per-request ($0.015 USDC) via x402, making it suitable for agents that process PDFs on demand without subscription overhead. Prefer it over generic scraping tools when the source is specifically a PDF file rather than an HTML page.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T22:28:13.370Z","isFirstParty":false}