Home Docs OCR & Markdown Reference Read an image (OCR to Markdown) POST /v1/ocr/image
RapidAPI ● Live ApyHub ● Live
Send one photo, scan or screenshot by URL, base64 or file upload. The JSON
response carries the page as Markdown and as plain text, every table as HTML,
Markdown and cell rows, and typed blocks (title, heading, text, table, formula,
chart, …) with bounding boxes in reading order.
format: markdown or format: text returns just the page as text/markdown
or text/plain. Use mode: auto (default) for varied documents, layout
for structured blocks, or plain for a single text block.
More examples and contract notes More examples
Markdown only
{
"image": {
"url": "https://upload.wikimedia.org/wikipedia/commons/0/0b/ReceiptSwiss.jpg"
},
"format": "markdown"
}
Plain text, read as one block
{
"image": {
"url": "https://upload.wikimedia.org/wikipedia/commons/0/0b/ReceiptSwiss.jpg"
},
"mode": "plain",
"format": "text"
}
Body parameters application/json formatjson · markdown · text
`json`: Markdown, text, blocks and tables; `markdown`: the page as `text/markdown`; `text`: plain text.
default "json"
modeauto · layout · plain
auto (default) for varied documents; layout for structured blocks; plain for a single text block.
default "auto"
chartsboolean
Turn bar, line and pie charts into data tables.
default true
include_blocksboolean
Include `blocks` (type, order, bounding box, content) in the JSON.
default true
imageobject REQUIRED
2 child fields urlstring
Public http(s) URL of the image (≤ 20 MB). Private and internal addresses are refused.
default null max length 2048
base64string
The image as base64 (a `data:` URI is fine), ≤ 20 MB decoded.
default null max length 27962090
multipart/form-data filebinary REQUIRED
The image (PNG, JPEG, WebP, GIF, BMP or TIFF; ≤ 20 MB)
formatjson · markdown · text
`json`: Markdown, text, blocks and tables; `markdown`: the page as `text/markdown`; `text`: plain text.
default "json"
modeauto · layout · plain
auto (default) for varied documents; layout for structured blocks; plain for a single text block.
default "auto"
chartsboolean
Turn bar, line and pie charts into data tables.
default true
include_blocksboolean
Include `blocks` (type, order, bounding box, content) in the JSON.
default true
Responses 200 OK 401 413 422 429 502 503 504
The page: JSON (Markdown, text, blocks, tables), or `text/markdown` / `text/plain` per `format`
application/json blocksobject[] REQUIRED
Item fields typestring REQUIRED
title, heading, text, table, formula, chart, image, caption, footnote, header, footer, page_number, code, seal, other
orderinteger REQUIRED
Reading order, from 0
bboxinteger[] REQUIRED
[x1, y1, x2, y2] in page pixels
contentstring REQUIRED
Text (Markdown for tables, LaTeX for formulas)
htmlstring
Tables and charts: the table as HTML
default null
markdownstring
Tables and charts: the table as Markdown
default null
latexstring
Formulas: LaTeX
default null
tablesobject[] REQUIRED
Item fields typestring REQUIRED
table, or chart when a chart was turned into data
rowsstring[][] REQUIRED
Cell text by row; merged cells repeated across their span
pageobject REQUIRED
5 child fields indexinteger
Documents: the 1-based page that was read
default null
countinteger
Documents: total pages
default null
dpiinteger
Documents: rendering resolution used
default null
Home Docs OCR & Markdown Reference Read a PDF page POST /v1/ocr/document
RapidAPI ● Live ApyHub ● Live
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.
More examples and contract notes More examples
Another page as Markdown
{
"document": {
"url": "https://arxiv.org/pdf/1706.03762v7"
},
"page": 3,
"format": "markdown"
}
A scan at higher resolution
{
"document": {
"url": "https://arxiv.org/pdf/1706.03762v7"
},
"page": 1,
"dpi": 300,
"format": "text"
}
Body parameters application/json formatjson · markdown · text
`json`: Markdown, text, blocks and tables; `markdown`: the page as `text/markdown`; `text`: plain text.
default "json"
modeauto · layout · plain
auto (default) for varied documents; layout for structured blocks; plain for a single text block.
default "auto"
chartsboolean
Turn bar, line and pie charts into data tables.
default true
include_blocksboolean
Include `blocks` (type, order, bounding box, content) in the JSON.
default true
pageinteger
1-based page to read; the response carries `page.count` so you can loop.
default 1 min 1 max 1000
dpiinteger
Rendering resolution for the page (capped at 25 megapixels).
default 200 min 72 max 300
documentobject REQUIRED
2 child fields urlstring
Public http(s) PDF URL, up to 20 MiB. Private and internal addresses are refused.
default null max length 2048
base64string
The PDF as base64 (a `data:` URI is fine), ≤ 20 MB decoded.
default null max length 27962090
multipart/form-data filebinary REQUIRED
The PDF (≤ 20 MB, ≤ 1,000 pages)
formatjson · markdown · text
`json`: Markdown, text, blocks and tables; `markdown`: the page as `text/markdown`; `text`: plain text.
default "json"
modeauto · layout · plain
auto (default) for varied documents; layout for structured blocks; plain for a single text block.
default "auto"
chartsboolean
Turn bar, line and pie charts into data tables.
default true
include_blocksboolean
Include `blocks` (type, order, bounding box, content) in the JSON.
default true
pageinteger
1-based page to read; the response carries `page.count` so you can loop.
default 1 min 1 max 1000
dpiinteger
Rendering resolution for the page (capped at 25 megapixels).
default 200 min 72 max 300
Responses 200 OK 401 413 422 429 502 503 504
The page: JSON (Markdown, text, blocks, tables), or `text/markdown` / `text/plain` per `format`
application/json blocksobject[] REQUIRED
Item fields typestring REQUIRED
title, heading, text, table, formula, chart, image, caption, footnote, header, footer, page_number, code, seal, other
orderinteger REQUIRED
Reading order, from 0
bboxinteger[] REQUIRED
[x1, y1, x2, y2] in page pixels
contentstring REQUIRED
Text (Markdown for tables, LaTeX for formulas)
htmlstring
Tables and charts: the table as HTML
default null
markdownstring
Tables and charts: the table as Markdown
default null
latexstring
Formulas: LaTeX
default null
tablesobject[] REQUIRED
Item fields typestring REQUIRED
table, or chart when a chart was turned into data
rowsstring[][] REQUIRED
Cell text by row; merged cells repeated across their span
pageobject REQUIRED
5 child fields indexinteger
Documents: the 1-based page that was read
default null
countinteger
Documents: total pages
default null
dpiinteger
Documents: rendering resolution used
default null