{"openapi":"3.1.0","info":{"title":"PDF to Text - Markdown, Tables & Scanned PDF OCR","description":"PDF to text, page by page, with metadata; AI reading for scanned pages and clean Markdown with headings and tables.","version":"v1"},"servers":[{"url":"https://pdf-to-text-markdown-tables-scanned-pdf-ocr.p.rapidapi.com","description":"RapidAPI"}],"paths":{"/v1/pdf/extract":{"post":{"tags":["PDF Extraction"],"summary":"Extract the text of a PDF from its URL","description":"Text of every page (or of the pages you choose), the document metadata,\nand Markdown with headings and tables for pages read by the AI. Scanned\npages are read by OCR in 'auto' mode. Credits: 1 per started 20 text-layer\npages, 20 per page read by the AI.","operationId":"extractPdfFromUrl","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfRequest"},"examples":{"Extract PDF from URL":{"summary":"Extract PDF from URL","value":{"url":"https://arxiv.org/pdf/1706.03762","mode":"auto","pages":"1-3"}}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfResponse"},"examples":{"Extract PDF from URL":{"summary":"Extract PDF from URL (real response)","value":{"source":"https://arxiv.org/pdf/1706.03762","page_count":15,"pages_extracted":3,"text_pages":0,"ai_pages":3,"metadata":{"creator":"LaTeX with hyperref","producer":"pdfTeX-1.40.25","created":"2024-04-10T21:11:43+00:00"},"text":"Attention Is All You Need\nAshish Vaswani ...","markdown":"Attention Is All You Need\n...\n## Abstract\n\nThe dominant sequence transduction models ...\n\n---\n\n...","pages":[{"page":1,"method":"ai","text":"Attention Is All You Need ...","markdown":"Attention Is All You Need ..."},{"page":3,"method":"ai","text":"...","markdown":"...\n[Figure: Output Probabilities, Softmax, Linear, Add & Norm, ...]\n..."}]}}}}}},"400":{"description":"Invalid input, or the target could not be processed (see `error.code`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing proxy secret (call through RapidAPI with your key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Invalid proxy secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Daily limit of your plan reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"The AI provider failed (`ai_error`) or capacity is temporarily exhausted (`capacity_exhausted`); retry. Not billed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"x-rapidapi-endpoint":"Extract PDF from URL"}},"/v1/pdf/extract/upload":{"post":{"tags":["PDF Extraction"],"summary":"Extract the text of an uploaded PDF","description":"Same as /extract, for a file sent as multipart/form-data (field `file`).","operationId":"extractUploadedPdf","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_Extract_Uploaded_PDF"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfResponse"},"examples":{"Extract Uploaded PDF":{"summary":"Extract Uploaded PDF","value":{"page_count":15,"pages_extracted":3,"metadata":{},"pages":[{"page":1,"method":"text"}]}}}}}},"400":{"description":"Invalid input, or the target could not be processed (see `error.code`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing proxy secret (call through RapidAPI with your key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Invalid proxy secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Daily limit of your plan reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"The AI provider failed (`ai_error`) or capacity is temporarily exhausted (`capacity_exhausted`); retry. Not billed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"x-rapidapi-endpoint":"Extract Uploaded PDF"}}},"components":{"schemas":{"Body_Extract_Uploaded_PDF":{"properties":{"file":{"type":"string","title":"File","description":"PDF, up to 30 MB.","format":"binary"},"mode":{"type":"string","enum":["auto","text","ai"],"title":"Mode","description":"'text': the PDF's own text layer, no AI (fast, cheapest). 'auto': text layer, and AI OCR for scanned pages only. 'ai': AI on every page, for clean Markdown with headings and tables.","default":"auto"},"pages":{"type":"string","maxLength":200,"title":"Pages","description":"Pages to extract, e.g. '1-5,8,10-12'. All pages when empty."},"password":{"type":"string","maxLength":200,"title":"Password","description":"Password of an encrypted PDF."}},"type":"object","required":["file"],"title":"Body_Extract Uploaded PDF"},"ErrorBody":{"properties":{"status":{"type":"integer","title":"Status","examples":[400]},"code":{"type":"string","title":"Code","examples":["invalid_url"]},"message":{"type":"string","title":"Message","examples":["A website URL is required."]}},"type":"object","required":["status","code","message"],"title":"ErrorBody"},"ErrorEnvelope":{"properties":{"error":{"$ref":"#/components/schemas/ErrorBody"}},"type":"object","required":["error"],"title":"ErrorEnvelope"},"PdfMetadata":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"author":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"creator":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Creator"},"producer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Producer"},"created":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created","description":"ISO 8601 date."},"modified":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Modified","description":"ISO 8601 date."}},"type":"object","title":"PdfMetadata"},"PdfPage":{"properties":{"page":{"type":"integer","title":"Page","description":"Page number in the PDF (1-based).","examples":[1]},"method":{"type":"string","enum":["text","ai"],"title":"Method","description":"'text': from the PDF's text layer; 'ai': read by the AI."},"text":{"type":"string","title":"Text"},"markdown":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Markdown","description":"Layout as Markdown, for pages read by the AI."}},"type":"object","required":["page","method","text"],"title":"PdfPage"},"PdfRequest":{"properties":{"url":{"type":"string","maxLength":2048,"title":"Url","description":"Direct link to a PDF, up to 50 MB.","examples":["https://arxiv.org/pdf/1706.03762"]},"mode":{"type":"string","enum":["auto","text","ai"],"title":"Mode","description":"'text': the PDF's own text layer, no AI (fast, cheapest). 'auto': text layer, and AI OCR for scanned pages only. 'ai': AI on every page, for clean Markdown with headings and tables.","default":"auto"},"pages":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Pages","description":"Pages to extract, e.g. '1-5,8,10-12'. All pages when empty.","examples":["1-3"]},"password":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Password","description":"Password of an encrypted PDF."}},"type":"object","required":["url"],"title":"PdfRequest"},"PdfResponse":{"properties":{"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"File name or final URL."},"page_count":{"type":"integer","title":"Page Count","description":"Pages in the PDF.","examples":[15]},"pages_extracted":{"type":"integer","title":"Pages Extracted","examples":[3]},"text_pages":{"type":"integer","title":"Text Pages","description":"Pages taken from the text layer."},"ai_pages":{"type":"integer","title":"Ai Pages","description":"Pages read by the AI."},"metadata":{"$ref":"#/components/schemas/PdfMetadata"},"text":{"type":"string","title":"Text","description":"All extracted pages, in order."},"markdown":{"type":"string","title":"Markdown","description":"All extracted pages as Markdown (text-layer pages as plain text), separated by '---'."},"pages":{"items":{"$ref":"#/components/schemas/PdfPage"},"type":"array","title":"Pages"}},"type":"object","required":["page_count","pages_extracted","text_pages","ai_pages","metadata","text","markdown","pages"],"title":"PdfResponse"}},"securitySchemes":{"RapidAPIKey":{"type":"apiKey","in":"header","name":"X-RapidAPI-Key"},"RapidAPIHost":{"type":"apiKey","in":"header","name":"X-RapidAPI-Host"}}},"tags":[{"name":"PDF Extraction","description":"PDF to text and Markdown, page by page."}],"security":[{"RapidAPIKey":[],"RapidAPIHost":[]}]}