{"openapi":"3.0.3","info":{"title":"DocParse API","version":"1.0.0","description":"Turn documents into clean text your pipeline can actually use.\n\n**PDF** endpoints return the full text and per page text of a PDF, its metadata and page count without extracting text, or just the pages you ask for (?pages=1,3,5-7). Text is cleaned: unicode dashes and quotes normalised, trailing spaces removed, blank lines collapsed, paragraph breaks kept. Input can be a multipart upload, a base64 field, or a url.\n\n**DOCX** returns paragraph text where headings carry their # level, list items become - entries and tables become pipe tables. Word's XML is parsed, nothing else.\n\n**HTML** turns a page or fragment into readable text (nav, header, footer, aside, scripts and styles stripped) or into markdown with headings, emphasis, links, images, lists, blockquotes, fenced code blocks and pipe tables.\n\nEvery limit is documented and enforced: 8 MB input, 100 pages per PDF request, 5 MB of fetched HTML, 1,000,000 characters per response. Timeouts on outbound fetches are 12 s.\n\n**Honest scope:** text based PDFs only. Scanned pages return little or no text because no OCR engine is bundled. Encrypted PDFs return 422. Legacy .doc, .rtf and .odt files are not supported. DOCX images, headers, footers and footnotes are not extracted.\n\n**Built for:** RAG ingestion, invoice and contract parsing, resume parsing, note-taking tools, documentation pipelines.","termsOfService":"https://example.com/terms","contact":{"name":"Ayam Labs","url":"https://github.com/ayam04","email":"ayamullahkhan04@gmail.com"}},"servers":[{"url":"https://docparse.ayamk.in","description":"Direct origin"},{"url":"https://rapidapi.com","description":"RapidAPI marketplace"}],"tags":[{"name":"Extraction","description":"Text and structure out of PDF and DOCX files"},{"name":"Conversion","description":"HTML to readable text or markdown"},{"name":"Reference","description":"Supported formats, caps and limits"}],"x-provider":"Ayam Labs","components":{"schemas":{"PdfTextResult":{"type":"object","properties":{"text":{"type":"string","example":"Attention Is All You Need\nAshish Vaswani...","description":"Full extracted text, cleaned and with paragraph breaks preserved."},"pages":{"type":"array","items":{"type":"string"},"description":"Per page text, in page order. One entry per extracted page."},"pageCount":{"type":"integer","example":15,"description":"Pages in the document as reported by the PDF itself."},"pagesReturned":{"type":"integer","example":15,"description":"Pages included in the pages array (capped at 100)."},"truncated":{"type":"boolean","example":false,"description":"True when the PDF had more than 100 pages, or the text exceeded 1,000,000 characters."},"characters":{"type":"integer","example":41230,"description":"Characters in text."},"words":{"type":"integer","example":6731,"description":"Words in text."},"metadata":{"$ref":"#/components/schemas/PdfMetadata"},"encrypted":{"type":"boolean","example":false,"description":"True when the file carries an /Encrypt dictionary. Text is only returned when it opened without a password."},"fileSizeBytes":{"type":"integer","example":2213424,"description":"Size of the decoded document."},"source":{"type":"string","enum":["file","base64","url"],"example":"file","description":"Where the document bytes came from: multipart upload, base64 field, or a fetched url."},"durationMs":{"type":"integer","example":631,"description":"Server side handling time for the whole call, including any download."}},"required":["text","pages","pageCount","pagesReturned","truncated","characters","words","metadata","encrypted","fileSizeBytes","source","durationMs"]},"PdfMetadata":{"type":"object","properties":{"title":{"type":"string","nullable":true,"example":"Attention Is All You Need","description":"Title from the PDF information dictionary, when present."},"author":{"type":"string","nullable":true,"example":"Ashish Vaswani et al.","description":"Author string from the PDF information dictionary."},"producer":{"type":"string","nullable":true,"example":"pdfTeX-1.40.17","description":"Producer reported by the tool that wrote the PDF."},"creator":{"type":"string","nullable":true,"example":"LaTeX with hyperref","description":"Creator application reported by the PDF."},"creationDate":{"type":"string","nullable":true,"example":"2017-06-12T00:00:00.000Z","description":"Creation (or modification) date converted to ISO 8601 UTC. Unparseable PDF dates are returned as the raw trimmed string."}},"required":["title","author","producer","creator","creationDate"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"INVALID_INPUT","description":"Stable machine-readable error code."},"message":{"type":"string","example":"Request validation failed","description":"Human-readable explanation."},"details":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},{"type":"object","additionalProperties":{"nullable":true}}],"description":"Optional structured details (usually field-level validation issues)."},"hint":{"type":"string","example":"Pass the email address in the \"email\" query parameter."}},"required":["code","message"]},"requestId":{"type":"string","example":"8f14e45f-ceea-467f-a8e7-9b5e4f0e2a31"},"timestamp":{"type":"string","example":"2026-11-21T10:15:30.000Z"}},"required":["error","requestId","timestamp"]},"DocumentInput":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"description":"Public http(s) URL of the PDF or DOCX. Fetched through the SSRF guard, 12 s timeout, 8 MB cap. Provide exactly one of url, base64 or a multipart 'file' part.","example":"https://arxiv.org/pdf/1706.03762"},"base64":{"type":"string","maxLength":12500000,"description":"Base64 or data: URL encoded document, 8 MB maximum after decoding. Rejected with 413 above that, before decoding. Prefer multipart or url for large files.","example":"JVBERi0xLjcKJeLjz9MKMSAwIG9iago8PC9UeXBlL0NhdGFsb2c+PgplbmRvYmoK"}}},"PdfInfoResult":{"type":"object","properties":{"pageCount":{"type":"integer","example":15,"description":"Pages in the document."},"metadata":{"$ref":"#/components/schemas/PdfMetadata"},"pdfVersion":{"type":"string","nullable":true,"example":"1.5","description":"PDF header version such as 1.4 or 1.7, or null when the header is malformed."},"encrypted":{"type":"boolean","example":false,"description":"True when the PDF is encrypted (pdf-lib reports it authoritatively)."},"fileSizeBytes":{"type":"integer","example":2213424,"description":"Size of the decoded document."},"source":{"type":"string","enum":["file","base64","url"],"example":"file","description":"Where the document bytes came from: multipart upload, base64 field, or a fetched url."},"durationMs":{"type":"integer","example":44,"description":"Server side handling time. No text is extracted on this path."}},"required":["pageCount","metadata","pdfVersion","encrypted","fileSizeBytes","source","durationMs"]},"PdfPagesResult":{"type":"object","properties":{"pageCount":{"type":"integer","example":15,"description":"Pages in the document."},"requested":{"type":"string","example":"1,3,5-7","description":"Normalised selection that was processed."},"pages":{"type":"array","items":{"$ref":"#/components/schemas/PdfPageText"},"description":"Extracted pages, ascending by page number."},"outOfRange":{"type":"array","items":{"type":"integer"},"example":[],"description":"Requested page numbers past the end of the document. These are skipped, never padded."},"characters":{"type":"integer","example":9412,"description":"Characters across all returned pages."},"words":{"type":"integer","example":1502,"description":"Words across all returned pages."},"fileSizeBytes":{"type":"integer","example":2213424,"description":"Size of the decoded document."},"source":{"type":"string","enum":["file","base64","url"],"example":"file","description":"Where the document bytes came from: multipart upload, base64 field, or a fetched url."},"durationMs":{"type":"integer","example":240,"description":"Server side handling time for the whole call."}},"required":["pageCount","requested","pages","outOfRange","characters","words","fileSizeBytes","source","durationMs"]},"PdfPageText":{"type":"object","properties":{"page":{"type":"integer","example":5,"description":"1-based page number."},"characters":{"type":"integer","example":2871,"description":"Characters extracted from this page."},"text":{"type":"string","example":"3. Model Architecture","description":"Text of this page, cleaned."}},"required":["page","characters","text"]},"DocxTextResult":{"type":"object","properties":{"text":{"type":"string","example":"# Quarterly report\n\nRevenue grew 12% year on year.\n\n- North region\n- South region","description":"Extracted text. Headings become #/## prefixes, list items become '- ', tables become pipe tables."},"paragraphs":{"type":"integer","example":42,"description":"Paragraph blocks found in word/document.xml (excluding table cells)."},"headings":{"type":"integer","example":5,"description":"Paragraphs that used a Heading/Title style."},"listItems":{"type":"integer","example":9,"description":"Paragraphs that carried Word list numbering."},"tables":{"type":"integer","example":2,"description":"Tables rendered as pipe tables."},"words":{"type":"integer","example":810,"description":"Words in text."},"characters":{"type":"integer","example":5204,"description":"Characters in text."},"truncated":{"type":"boolean","example":false,"description":"True when the document exceeded the block or character cap."},"fileSizeBytes":{"type":"integer","example":34211,"description":"Size of the .docx upload."},"source":{"type":"string","enum":["file","base64","url"],"example":"file","description":"Where the document bytes came from: multipart upload, base64 field, or a fetched url."},"durationMs":{"type":"integer","example":39,"description":"Server side handling time for the whole call."}},"required":["text","paragraphs","headings","listItems","tables","words","characters","truncated","fileSizeBytes","source","durationMs"]},"HtmlTextResult":{"type":"object","properties":{"url":{"type":"string","nullable":true,"example":"https://example.com","description":"Page that was fetched (after redirects), or null when the html field was posted."},"source":{"type":"string","enum":["html","url"],"example":"url","description":"Where the markup came from."},"title":{"type":"string","nullable":true,"example":"Example Domain","description":"Document title from <title>, falling back to the first <h1>."},"byline":{"type":"string","nullable":true,"example":"This domain is for use in illustrative examples in documents.","description":"First substantial paragraph, capped at 400 characters. Intended as a summary or byline hint."},"text":{"type":"string","example":"Example Domain\n\nThis domain is for use in illustrative examples...","description":"Readable main text. Chrome (nav, header, footer, aside), scripts, styles and forms are stripped."},"characters":{"type":"integer","example":412,"description":"Characters in text."},"words":{"type":"integer","example":71,"description":"Words in text."},"links":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/HtmlLink"},"description":"Outbound links, only present when ?includeLinks=true. Null otherwise."},"truncated":{"type":"boolean","example":false,"description":"True when the extracted text exceeded 1,000,000 characters."},"inputTruncated":{"type":"boolean","example":false,"description":"True when the fetched page exceeded the 5 MB download cap, so only part of it was converted."},"durationMs":{"type":"integer","example":96,"description":"Server side handling time for the whole call."}},"required":["url","source","title","byline","text","characters","words","links","truncated","inputTruncated","durationMs"]},"HtmlLink":{"type":"object","properties":{"text":{"type":"string","example":"Pricing","description":"Anchor text, collapsed and truncated to 200 characters."},"href":{"type":"string","example":"https://example.com/pricing","description":"Absolute http(s), mailto or tel URL. Relative links are resolved against the page URL."}},"required":["text","href"]},"HtmlInput":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"description":"Public http(s) URL of an HTML page. Fetched through the SSRF guard, 12 s timeout, 5 MB text cap; only html, xhtml, xml and text/plain responses are accepted.","example":"https://example.com"},"html":{"type":"string","maxLength":500000,"description":"Markup to convert, up to 500,000 characters. Scripts, styles, nav, header, footer and aside blocks are stripped. Provide exactly one of html or url.","example":"<h1>Invoice 1042</h1><p>Total: <strong>49.00 EUR</strong></p>"}}},"HtmlMarkdownResult":{"type":"object","properties":{"url":{"type":"string","nullable":true,"example":"https://example.com","description":"Page that was fetched, or null when the html field was posted."},"source":{"type":"string","enum":["html","url"],"example":"url","description":"Where the markup came from."},"title":{"type":"string","nullable":true,"example":"Example Domain","description":"Document title from <title>, falling back to the first <h1>."},"markdown":{"type":"string","example":"# Example Domain\n\nThis domain is for use in illustrative examples. [More information...](https://www.iana.org/domains/example)","description":"Markdown with headings, emphasis, links, images, lists, blockquotes, fenced code blocks, pipe tables and paragraphs. No HTML tags."},"characters":{"type":"integer","example":388,"description":"Characters in markdown."},"words":{"type":"integer","example":71,"description":"Words in markdown."},"truncated":{"type":"boolean","example":false,"description":"True when the markdown exceeded 1,000,000 characters."},"inputTruncated":{"type":"boolean","example":false,"description":"True when the fetched page exceeded the 5 MB download cap."},"durationMs":{"type":"integer","example":101,"description":"Server side handling time for the whole call."}},"required":["url","source","title","markdown","characters","words","truncated","inputTruncated","durationMs"]},"FormatsResult":{"type":"object","properties":{"formats":{"type":"array","items":{"$ref":"#/components/schemas/InputFormat"}},"limits":{"$ref":"#/components/schemas/FormatLimits"},"endpoints":{"type":"array","items":{"$ref":"#/components/schemas/EndpointSummary"}},"notSupported":{"type":"array","items":{"type":"string"},"example":["Scanned PDF pages and images (no OCR engine is bundled)"],"description":"Things this API deliberately does not do, so nobody buys it for the wrong job."}},"required":["formats","limits","endpoints","notSupported"]},"InputFormat":{"type":"object","properties":{"format":{"type":"string","example":"PDF"},"extensions":{"type":"array","items":{"type":"string"},"example":[".pdf"]},"contentType":{"type":"string","example":"application/pdf"},"endpoints":{"type":"array","items":{"type":"string"},"example":["/v1/pdf/text","/v1/pdf/info","/v1/pdf/pages"]},"maxInputBytes":{"type":"integer","example":8388608},"notes":{"type":"string","example":"Text based PDFs only; scanned pages return little or no text (no OCR)."}},"required":["format","extensions","contentType","endpoints","maxInputBytes","notes"]},"FormatLimits":{"type":"object","properties":{"maxDocumentBytes":{"type":"integer","example":8388608,"description":"Largest accepted PDF or DOCX, after base64 decoding."},"maxBase64Chars":{"type":"integer","example":12500000,"description":"Longest accepted base64 string in a JSON body."},"maxPdfPages":{"type":"integer","example":100,"description":"Pages extracted by /v1/pdf/text before truncation."},"maxSelectedPages":{"type":"integer","example":100,"description":"Pages one /v1/pdf/pages call may select."},"maxPageRangeTokens":{"type":"integer","example":64,"description":"Comma separated tokens accepted in the pages parameter."},"maxHtmlJsonChars":{"type":"integer","example":500000,"description":"Characters accepted in the html field."},"maxFetchedHtmlBytes":{"type":"integer","example":5000000,"description":"Bytes downloaded when converting a page by url."},"maxTextChars":{"type":"integer","example":1000000,"description":"Characters returned in a single text or markdown response."},"maxLinks":{"type":"integer","example":200,"description":"Links returned when includeLinks=true."},"maxUrlLength":{"type":"integer","example":2048,"description":"Longest accepted url field."},"fetchTimeoutMs":{"type":"integer","example":12000,"description":"Outbound fetch timeout for user supplied URLs."}},"required":["maxDocumentBytes","maxBase64Chars","maxPdfPages","maxSelectedPages","maxPageRangeTokens","maxHtmlJsonChars","maxFetchedHtmlBytes","maxTextChars","maxLinks","maxUrlLength","fetchTimeoutMs"]},"EndpointSummary":{"type":"object","properties":{"method":{"type":"string","example":"POST"},"path":{"type":"string","example":"/v1/pdf/text"},"summary":{"type":"string","example":"Extract full text and per-page text from a PDF"}},"required":["method","path","summary"]}},"parameters":{}},"paths":{"/v1/pdf/text":{"post":{"tags":["Extraction"],"summary":"Extract full text and per-page text from a PDF","description":"Returns cleaned text, per page text, page count, words, characters and the PDF metadata dictionary. Accepts a multipart/form-data body with a 'file' part, or JSON with either a 'url' or a 'base64' field. Text extraction stops at 100 pages and the response reports truncated=true. Text based PDFs only: scanned pages return little or no text. A request body is required in practice: it is listed as optional because two content types are accepted (multipart upload or JSON).","requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentInput"}},"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"The PDF or DOCX file itself. Maximum 8 MB; the signature is checked before parsing."}}}}}},"responses":{"200":{"description":"Extracted PDF text and metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfTextResult"}}}},"400":{"description":"Invalid request (bad parameters or unparsable input)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Payload or document exceeds the documented size limits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Content type is neither application/json nor multipart/form-data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document could not be parsed (corrupt, encrypted or not the expected format)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Upstream dependency failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"504":{"description":"Upstream dependency timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/pdf/info":{"post":{"tags":["Extraction"],"summary":"Read PDF metadata, page count, version and size without extracting text","description":"Fast path: parses the document structure and returns pageCount, the metadata dictionary, the PDF header version, the encryption flag and the file size. No text is extracted. Accepts the same multipart, base64 or url input as /v1/pdf/text. A request body is required in practice: it is listed as optional because two content types are accepted (multipart upload or JSON).","requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentInput"}},"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"The PDF or DOCX file itself. Maximum 8 MB; the signature is checked before parsing."}}}}}},"responses":{"200":{"description":"PDF structure and metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfInfoResult"}}}},"400":{"description":"Invalid request (bad parameters or unparsable input)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Payload or document exceeds the documented size limits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Content type is neither application/json nor multipart/form-data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document could not be parsed (corrupt, encrypted or not the expected format)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Upstream dependency failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"504":{"description":"Upstream dependency timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/pdf/pages":{"post":{"tags":["Extraction"],"summary":"Extract only the pages you select from a PDF","description":"Extracts text from the pages named in ?pages=1,3,5-7 (single pages, inclusive ranges, comma separated, up to 100 pages). Only the selected pages are parsed, so a 500 page contract costs one page of work. Page numbers past the end of the document are listed in outOfRange and never padded. Body is a multipart 'file' part or JSON with 'url' or 'base64'. A request body is required in practice: it is listed as optional because two content types are accepted (multipart upload or JSON).","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":500,"example":"1,3,5-7","description":"Page selection. Single pages and inclusive ranges, comma separated. Up to 100 pages and 64 tokens per call, page numbers 1-10000."},"required":true,"description":"Page selection. Single pages and inclusive ranges, comma separated. Up to 100 pages and 64 tokens per call, page numbers 1-10000.","name":"pages","in":"query"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentInput"}},"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"The PDF or DOCX file itself. Maximum 8 MB; the signature is checked before parsing."}}}}}},"responses":{"200":{"description":"Text of the selected pages","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfPagesResult"}}}},"400":{"description":"Invalid request (bad parameters or unparsable input)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Payload or document exceeds the documented size limits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Content type is neither application/json nor multipart/form-data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document could not be parsed (corrupt, encrypted or not the expected format)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Upstream dependency failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"504":{"description":"Upstream dependency timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/docx/text":{"post":{"tags":["Extraction"],"summary":"Extract headings, list items, tables and paragraphs from a DOCX","description":"Unzips the .docx, reads word/document.xml and converts it to text: Heading and Title styles become #/## prefixes, numbered and bulleted paragraphs become '- ' items, tables become pipe tables, everything else becomes a paragraph. Returns paragraph, heading, list and table counts plus word and character totals. Accepts multipart, base64 or url input, 8 MB maximum. A request body is required in practice: it is listed as optional because two content types are accepted (multipart upload or JSON).","requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentInput"}},"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"The PDF or DOCX file itself. Maximum 8 MB; the signature is checked before parsing."}}}}}},"responses":{"200":{"description":"Extracted DOCX text and structure counts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocxTextResult"}}}},"400":{"description":"Invalid request (bad parameters or unparsable input)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Payload or document exceeds the documented size limits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Content type is neither application/json nor multipart/form-data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document could not be parsed (corrupt, encrypted or not the expected format)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Upstream dependency failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"504":{"description":"Upstream dependency timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/html/text":{"post":{"tags":["Conversion"],"summary":"Extract readable main text, title and byline from HTML","description":"Strips scripts, styles, nav, header, footer, aside and forms, then returns the readable text with paragraph breaks, the document title, a byline-ish first paragraph and word count. Pass ?includeLinks=true to also get the outbound links (up to 200, http/https/mailto/tel only, relative links resolved). Send either an 'html' field (500,000 characters) or a 'url' (5 MB, 12 s timeout).","parameters":[{"schema":{"type":"string","enum":["true","false"],"example":"true","description":"When true, the response also lists the outbound links of the page (up to 200, http, https, mailto and tel only)."},"required":false,"description":"When true, the response also lists the outbound links of the page (up to 200, http, https, mailto and tel only).","name":"includeLinks","in":"query"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HtmlInput"}}}},"responses":{"200":{"description":"Readable text, title and optional links","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HtmlTextResult"}}}},"400":{"description":"Invalid request (bad parameters or unparsable input)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Payload or document exceeds the documented size limits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Content type is neither application/json nor multipart/form-data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document could not be parsed (corrupt, encrypted or not the expected format)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Upstream dependency failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"504":{"description":"Upstream dependency timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/html/markdown":{"post":{"tags":["Conversion"],"summary":"Convert HTML to clean markdown","description":"Converts HTML to markdown with HTMLRewriter: ATX headings, bold/italic/strike, inline code, fenced code blocks with a language hint, links, images, ordered and unordered lists, blockquotes, horizontal rules, pipe tables and paragraphs. Scripts, styles and page chrome are dropped, javascript: and data: URLs are removed, and the output contains no HTML tags. Send either an 'html' field (500,000 characters) or a 'url' (5 MB, 12 s timeout).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HtmlInput"}}}},"responses":{"200":{"description":"Markdown conversion","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HtmlMarkdownResult"}}}},"400":{"description":"Invalid request (bad parameters or unparsable input)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Payload or document exceeds the documented size limits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Content type is neither application/json nor multipart/form-data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document could not be parsed (corrupt, encrypted or not the expected format)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Upstream dependency failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"504":{"description":"Upstream dependency timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/formats":{"get":{"tags":["Reference"],"summary":"List supported formats and limits","description":"Documentation as data: the input formats this API accepts, the endpoint for each, every enforced size and page limit, and the list of things it deliberately does not do. Call this once at integration time instead of hard coding limits.","responses":{"200":{"description":"Formats, limits and endpoints","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormatsResult"}}}},"400":{"description":"Invalid request (bad parameters or unparsable input)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Upstream dependency failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"504":{"description":"Upstream dependency timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}