Documentation menu

API · Documents

Pictures of a completed document

GET /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

  • id string required

    The document's id.

Query parameters

  • page string optional

    One page (3) or an inclusive range (1-3).

    Example: page=2-4

  • include string optional

    data adds each image's bytes as base64 data, so the list is the pictures themselves (at most 25 MB of them; narrow with page or download each from its url).

    Example: include=data

Returns 200

The document's pictures.

  • object string

    Always list.

  • data array of Image

    In page order, figures in their order on the page.

    13 fields
    • id string

      The image's id.

    • object string

      Always image.

    • bbox object

      For a figure, where it sits on the page: left, top, width and height as fractions of the page (0 to 1). null for a whole page.

    • byte_size integer

      File size in bytes.

    • caption string

      The figure's caption as the OCR read it, or null.

    • data string

      With include=image_data (pages) or include=data (images): the file itself, base64-encoded.

    • figure_index integer

      For a figure, its place among the page's [FIGURE] markers, from 0; null for a whole page.

    • height integer

      Height in pixels. The long side is at most 1568.

    • kind figure | page

      figure for a picture cropped from a page, page for a whole page.

    • media_type string

      image/png (figures) or image/jpeg (pages).

    • page integer

      The page it is from.

    • url string

      Where to download the image file.

    • width integer

      Width in pixels.

  • document_id string

    The document these belong to.

Errors

  • 401

    Missing, revoked or expired key

  • 402

    Payment 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).

  • 404

    No document or query with that id for this key (documents are scoped to the key's workspace and live/test mode)

  • 409

    The document has not finished processing

  • 410

    Retention ran out and the result was purged

  • 422

    Body or options failed validation (details lists the fields), or the document is too large (document_too_large)

  • 429

    Per-second burst limit for the plan exceeded; retry after Retry-After seconds

Every error has the same shape. See Errors.