API · Documents
Pictures of a completed document
/api/v1/documents/{id}/images
The pictures Northdoc took from the document (every document, unless it was sent with images: false): figures cropped from their pages, and whole pages that are mostly picture or have fewer than 25 words, such as scans and signed pages. Logos, tiny figures and blank pages are left out.
This lists them, in page order, with their metadata and a url; fetch each url for the PNG (figures) or JPEG (pages) itself. The first [FIGURE] marker in a page's text is the image with that page and figure_index: 0, the second is figure_index: 1, and so on.
Path parameters
-
idstring requiredThe document's id.
Query parameters
-
pagestring optionalOne page (
3) or an inclusive range (1-3).Example:
page=2-4 -
includestring optionaldataadds each image's bytes as base64data, so the list is the pictures themselves (at most 25 MB of them; narrow withpageor download each from itsurl).Example:
include=data
Returns 200
The document's pictures.
-
objectstringAlways
list. -
dataarray of ImageIn page order, figures in their order on the page.
13 fields
-
idstringThe image's id.
-
objectstringAlways
image. -
bboxobjectFor a figure, where it sits on the page:
left,top,widthandheightas fractions of the page (0 to 1).nullfor a whole page. -
byte_sizeintegerFile size in bytes.
-
captionstringThe figure's caption as the OCR read it, or
null. -
datastringWith
include=image_data(pages) orinclude=data(images): the file itself, base64-encoded. -
figure_indexintegerFor a figure, its place among the page's
[FIGURE]markers, from 0;nullfor a whole page. -
heightintegerHeight in pixels. The long side is at most 1568.
-
kindfigure | pagefigurefor a picture cropped from a page,pagefor a whole page. -
media_typestringimage/png(figures) orimage/jpeg(pages). -
pageintegerThe page it is from.
-
urlstringWhere to download the image file.
-
widthintegerWidth in pixels.
-
-
document_idstringThe document these belong to.
Errors
-
401Missing, revoked or expired key
-
402Payment required. Either the plan's monthly request quota is spent (
quota_exceeded, trial plans only — pay as you go is never capped) or the workspace is out of credit (insufficient_credits). -
404No document or query with that id for this key (documents are scoped to the key's workspace and live/test mode)
-
409The document has not finished processing
-
410Retention ran out and the result was purged
-
422Body or options failed validation (
detailslists the fields), or the document is too large (document_too_large) -
429Per-second burst limit for the plan exceeded; retry after
Retry-Afterseconds
Every error has the same shape. See Errors.