Skip to Content
NexPDF

Extraction

Get the text and structure of a document as Markdown, HTML or JSON.

English

Extraction gives you the content of a document in a form code can use: Markdown for search indexes and LLMs, HTML for display, JSON for its structure.

Scanned documents have no text to extract; add an ocr action first.

Cost: Markdown and HTML, 1 unit per file; JSON, 1 unit per page.

Markdown

POST /v1/extract/markdown keeps headings, lists, tables and links.

curl https://api.nexpdf.dev/v1/extract/markdown \
  -H "Authorization: Bearer $NEXPDF_API_KEY" \
  -F document=@paper.pdf

JSON

With a build and output: { type: "json" }.

curl https://api.nexpdf.dev/v1/build \
  -H "Authorization: Bearer $NEXPDF_API_KEY" \
  -F doc=@invoice.pdf \
  -F 'instructions={
    "parts": [
      {
        "file": "doc"
      }
    ],
    "output": {
      "type": "json"
    }
  }' \
  -o invoice.json

On this page