DocParse API reference
Turn documents into clean text your pipeline can actually use.
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.
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.
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.
Every 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.
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.
Built for: RAG ingestion, invoice and contract parsing, resume parsing, note-taking tools, documentation pipelines.
Auth
Two headers on every call. The marketplace rejects requests without them before they reach the API.
X-RapidAPI-Key: YOUR_KEY
X-RapidAPI-Host: docparse.p.rapidapi.com
Errors
Every failure returns the same envelope, with a requestId you can quote to support.
{ "error": { "code": "INVALID_INPUT", "message": "...", "hint": "..." }, "requestId": "uuid", "timestamp": "ISO-8601" }
7 endpoints
Extract full text and per-page text from a PDF
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).
Request body
{}
curl example
curl -s -X POST 'https://docparse.ayamk.in/v1/pdf/text' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: docparse.p.rapidapi.com' \
-H 'Content-Type: application/json' \
-d '{}'
Read PDF metadata, page count, version and size without extracting text
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).
Request body
{}
curl example
curl -s -X POST 'https://docparse.ayamk.in/v1/pdf/info' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: docparse.p.rapidapi.com' \
-H 'Content-Type: application/json' \
-d '{}'
Extract only the pages you select from a PDF
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).
| Parameter | In | Type | Description |
|---|---|---|---|
| pages | query | string (required) | Page selection. Single pages and inclusive ranges, comma separated. Up to 100 pages and 64 tokens per call, page numbers 1-10000. |
Request body
{}
curl example
curl -s -X POST 'https://docparse.ayamk.in/v1/pdf/pages' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: docparse.p.rapidapi.com' \
-H 'Content-Type: application/json' \
-d '{}'
Extract headings, list items, tables and paragraphs from a DOCX
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).
Request body
{}
curl example
curl -s -X POST 'https://docparse.ayamk.in/v1/docx/text' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: docparse.p.rapidapi.com' \
-H 'Content-Type: application/json' \
-d '{}'
Extract readable main text, title and byline from HTML
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).
| Parameter | In | Type | Description |
|---|---|---|---|
| includeLinks | query | string | When true, the response also lists the outbound links of the page (up to 200, http, https, mailto and tel only). |
Request body
{}
curl example
curl -s -X POST 'https://docparse.ayamk.in/v1/html/text' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: docparse.p.rapidapi.com' \
-H 'Content-Type: application/json' \
-d '{}'
Convert HTML to clean markdown
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).
Request body
{}
curl example
curl -s -X POST 'https://docparse.ayamk.in/v1/html/markdown' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: docparse.p.rapidapi.com' \
-H 'Content-Type: application/json' \
-d '{}'
List supported formats and limits
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.
curl example
curl -s -X GET 'https://docparse.ayamk.in/v1/formats' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: docparse.p.rapidapi.com'
Generated from docparse.ayamk.in/openapi.json on 2026-11-22. If the page and the spec ever disagree, the spec is right.