apyhub
Back
▣ DATA EXTRACTION · IMAGE PROCESSING

PDF Page Reader

What it does

PDF Page Reader extracts text and structure from a single PDF page or an image and returns it in Markdown, plain text, or structured JSON. Send a public PDF URL or base64 content for a PDF, or an image URL or base64 image, and get OCR-ready output back.

Use it when you need page-level extraction from scanned documents, forms, receipts, reports, or screenshots. The response includes markdown, text, blocks, tables, and page, so you can work with the reading order, page dimensions, detected tables, and per-block content without building your own OCR pipeline.

For PDFs, you can choose the page to read, set dpi for rendering resolution, switch mode between auto, layout, and plain, and disable chart-to-table conversion with charts. For images, you can use the same mode, charts, format, and include_blocks options. In JSON mode, tables and charts are returned in structured form alongside block-level content and bounding boxes.

PDF Page Reader fits document ingestion, automated indexing, quote extraction, and downstream parsing workflows where you need reliable text plus layout-aware output from a specific page.

▣ ENDPOINT 01 / 02
POST
Read a PDF page
https://api.eu.apyverse.com/rohit/read-pdf-pagedd

QUICKSTART

GUIDE

Quickstart

Read the first page of a PDF from a public URL and return its extracted content as JSON.

curl -X POST "https://api.eu.apyverse.com/rohit/read-pdf-pagedd" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "document": {
      "url": "https://example.com/sample.pdf"
    }
  }'

What you'll get back

Returns a JSON object with markdown and text strings, blocks and tables arrays, and a page object. The page object includes width and height plus optional dpi, count, and index fields.

{
  "markdown": "...",
  "text": "...",
  "blocks": [],
  "tables": [],
  "page": {
    "width": 0,
    "height": 0
  }
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
DocumentRequest*
DocumentSource*
Rendering resolution for the page (capped at 25 megapixels).
auto (default) for varied documents; layout for structured blocks; plain for a single text block.
1-based page to read; the response carries `page.count` so you can loop.

About this endpoint

Read a PDF page

Read one page of a PDF — scanned or digital — into the same Markdown, text, tables and blocks. The response says how many pages there are (page.count, X-Page-Count); request page: 2, 3, … to walk the document. Each page is a separate request. Use a URL or upload the PDF with each page request.


Documentation imported from spec — please review and complete before submitting.

▣ ENDPOINT 02 / 02
POST
Read an image (OCR to Markdown)
https://api.eu.apyverse.com/rohit/read-pdf-pagedd/ocr

QUICKSTART

GUIDE

Quickstart

Extract text from an image or scanned PDF page by sending the image URL in the request body.

curl -X POST "https://api.eu.apyverse.com/rohit/read-pdf-pagedd/ocr" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"image":{"url":"https://upload.wikimedia.org/wikipedia/commons/0/0b/ReceiptSwiss.jpg"}}'

What you'll get back

Returns a JSON object with markdown, text, blocks, tables, and page fields. page is an object with width and height required, and may also include dpi, count, and index; blocks and tables are arrays describing the recognized content.

{
  "markdown": "",
  "text": "",
  "blocks": [],
  "tables": [],
  "page": { "width": 0, "height": 0 }
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
ImageRequest*
ImageSource*
Public http(s) URL of the image (≤ 20 MB). Private and internal addresses are refused.
The image as base64 (a `data:` URI is fine), ≤ 20 MB decoded.
auto (default) for varied documents; layout for structured blocks; plain for a single text block.

About this endpoint

What it does

Converts an input image into OCR output and returns the recognized content as text, Markdown, blocks, tables, and page metadata. The request accepts the image as a public URL or as base64, with options to control output format, chart-to-table conversion, and whether detailed blocks are included.

Request Body

ParameterTypeMandatoryDescription
modeENUMNoOCR mode. Allowed values: auto (default, for varied documents), layout (for structured blocks), plain (for a single text block). Default: auto.
imageObjectYesImage source. Provide either image.url or image.base64.
image.urlStringNoPublic http(s) URL of the image. Must be ≤ 20 MB. Private and internal addresses are refused.
image.base64StringNoThe image as base64, optionally as a data: URI. Must be ≤ 20 MB decoded.
chartsBooleanNoTurn bar, line, and pie charts into data tables. Default: true.
formatENUMNoOutput format. Allowed values: json (Markdown, text, blocks, and tables), markdown (page as text/markdown), text (plain text). Default: json.
include_blocksBooleanNoInclude blocks in the JSON response, with type, order, bounding box, and content. Default: true.

Response

Returns a JSON object with page, text, blocks, tables, and markdown fields. page is an object with page metadata, text and markdown are strings, blocks and tables are arrays of structured OCR results.

ParameterTypeMandatoryDescription
pageObjectYesPage metadata. Includes width and height, and may also include dpi, count, and index as nullable integers.
page.dpiIntegerNoDocuments: rendering resolution used.
page.countIntegerNoDocuments: total pages.
page.indexIntegerNoDocuments: the 1-based page that was read.
page.widthIntegerYesPage width in pixels.
page.heightIntegerYesPage height in pixels.
textStringYesOCR text output.
blocksObject ArrayYesOrdered OCR blocks. Each block includes type, order, bbox, and content; it may also include html, latex, and markdown.
blocks[].bboxInteger ArrayYesBounding box in page pixels, as [x1, y1, x2, y2].
blocks[].htmlStringNoTables and charts: the table as HTML.
blocks[].typeStringYesBlock type, such as title, heading, text, table, formula, chart, image, caption, footnote, header, footer, page_number, code, seal, or other.
blocks[].latexStringNoFormulas: LaTeX.
blocks[].orderIntegerYesReading order, starting from 0.
blocks[].contentStringYesBlock content. For tables, this is Markdown; for formulas, this is LaTeX.
blocks[].markdownStringNoTables and charts: the table as Markdown.
tablesObject ArrayYesExtracted tables, or charts turned into data when chart conversion is enabled. Each table includes order, type, bbox, html, markdown, and rows.
tables[].bboxInteger ArrayYesBounding box for the table in page pixels.
tables[].htmlStringYesTable HTML.
tables[].rowsString ArrayYesCell text by row; merged cells are repeated across their span.
tables[].typeStringYesTable type, or chart when a chart was turned into data.
tables[].orderIntegerYesReading order.
tables[].markdownStringYesTable Markdown.
markdownStringYesOCR output as Markdown.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.