GET
/
v1-preview
/
models
/
image-to-text
/
{documentId}
from abbyy_document_ai import DocumentAi
import os


with DocumentAi(
    api_key_auth=os.getenv("DOCUMENTAI_API_KEY_AUTH", ""),
) as document_ai:

    res = document_ai.models.image_to_text.get_extracted_text(document_id="wh23anb5xjf0ntw5taase5qz")

    assert res.extracted_text is not None

    # Handle response
    print(res.extracted_text)
{
  "meta": {
    "id": "wh23anb5xjf0ntw5taase5qz",
    "name": "document.jpg",
    "createdAt": "2025-02-07T17:44:06.949Z",
    "model": "image-to-text",
    "status": "Processed",
    "pageCount": 10,
    "errors": [
      {
        "message": "Total is required"
      }
    ]
  },
  "text": {
    "languages": [
      "EnglishUnitedStates"
    ],
    "content": {
      "paragraphs": [
        {
          "id": "paragraph_1",
          "formatting": {
            "aligning": "left",
            "lineSpacing": 1
          },
          "layoutReferences": [
            {
              "blockId": "A77B148A0BE1369723FA10D9BF74D6A4",
              "blockType": "text",
              "sectionIndex": 0,
              "columnIndex": 0,
              "lineNumbering": false,
              "parIndex": 0,
              "firstLine": 0,
              "lastLine": 2
            }
          ],
          "listReference": {
            "id": "list_1",
            "levelIndex": 0,
            "ordinalNumber": 0
          },
          "role": "text",
          "text": "Sample paragraph text"
        }
      ],
      "lists": [
        {
          "id": "list_1",
          "listLevels": [
            {
              "levelIndex": 0,
              "numberingStyle": "Decimal",
              "startNumber": 1
            }
          ]
        }
      ]
    },
    "layout": {
      "corrected": false,
      "pages": [
        {
          "width": 3472,
          "height": 4624,
          "rotated": "none",
          "texts": [
            {
              "id": "text_1",
              "position": {
                "l": 100,
                "t": 200,
                "r": 300,
                "b": 400
              },
              "lines": [
                {
                  "confidence": 95,
                  "position": {
                    "l": 110,
                    "t": 210,
                    "r": 290,
                    "b": 390
                  },
                  "text": "Sample text line",
                  "charParams": {
                    "bold": true,
                    "fontSize": 12,
                    "fontName": "Arial",
                    "color": "#000000",
                    "lang": "en"
                  },
                  "words": [
                    {
                      "confidence": 98,
                      "position": {
                        "l": 115,
                        "t": 215,
                        "r": 285,
                        "b": 385
                      },
                      "chars": [
                        {
                          "confidence": 99,
                          "text": "S",
                          "position": {
                            "l": 115,
                            "t": 215,
                            "r": 125,
                            "b": 225
                          }
                        }
                      ]
                    }
                  ]
                }
              ],
              "confidence": 95
            }
          ],
          "tables": [
            {
              "id": "table_1",
              "confidence": 85,
              "position": {
                "l": 400,
                "t": 500,
                "r": 800,
                "b": 900
              },
              "cells": [
                {
                  "id": "ADDF4892A3318B0193621EEDA6F9E308",
                  "colRowPosition": {
                    "l": 0,
                    "t": 0,
                    "r": 1,
                    "b": 1
                  },
                  "borders": {
                    "l": "invisible",
                    "t": "invisible",
                    "r": "invisible",
                    "b": "invisible"
                  },
                  "contentType": "text",
                  "position": {
                    "l": 861,
                    "t": 1581,
                    "r": 2428,
                    "b": 1768
                  },
                  "lines": [
                    {
                      "confidence": 92,
                      "position": {
                        "l": 863,
                        "t": 1582,
                        "r": 2425,
                        "b": 1737
                      },
                      "text": "QTY SKU PRICE",
                      "charParams": {
                        "fontSize": 240,
                        "fontName": "Arial",
                        "lang": "en-US"
                      },
                      "words": [
                        {
                          "confidence": 97,
                          "position": {
                            "l": 863,
                            "t": 1616,
                            "r": 984,
                            "b": 1679
                          },
                          "text": "QTY",
                          "chars": [
                            {
                              "confidence": 96,
                              "text": "Q",
                              "position": {
                                "l": 863,
                                "t": 1619,
                                "r": 904,
                                "b": 1676
                              }
                            },
                            {
                              "confidence": 98,
                              "text": "T",
                              "position": {
                                "l": 906,
                                "t": 1618,
                                "r": 945,
                                "b": 1667
                              }
                            },
                            {
                              "confidence": 97,
                              "text": "Y",
                              "position": {
                                "l": 943,
                                "t": 1618,
                                "r": 984,
                                "b": 1666
                              }
                            }
                          ]
                        },
                        {
                          "confidence": 81,
                          "position": {
                            "l": 1143,
                            "t": 1617,
                            "r": 1258,
                            "b": 1671
                          },
                          "text": "SKU",
                          "chars": [
                            {
                              "confidence": 87,
                              "text": "S",
                              "position": {
                                "l": 1143,
                                "t": 1619,
                                "r": 1186,
                                "b": 1668
                              }
                            },
                            {
                              "confidence": 90,
                              "text": "K",
                              "position": {
                                "l": 1182,
                                "t": 1618,
                                "r": 1219,
                                "b": 1669
                              }
                            },
                            {
                              "confidence": 67,
                              "text": "U",
                              "position": {
                                "l": 1216,
                                "t": 1620,
                                "r": 1258,
                                "b": 1667
                              }
                            }
                          ]
                        },
                        {
                          "confidence": 95,
                          "position": {
                            "l": 2243,
                            "t": 1632,
                            "r": 2425,
                            "b": 1692
                          },
                          "text": "PRICE",
                          "chars": [
                            {
                              "confidence": 98,
                              "text": "P",
                              "position": {
                                "l": 2243,
                                "t": 1636,
                                "r": 2274,
                                "b": 1687
                              }
                            },
                            {
                              "confidence": 95,
                              "text": "R",
                              "position": {
                                "l": 2277,
                                "t": 1637,
                                "r": 2312,
                                "b": 1685
                              }
                            },
                            {
                              "confidence": 96,
                              "text": "I",
                              "position": {
                                "l": 2319,
                                "t": 1638,
                                "r": 2345,
                                "b": 1685
                              }
                            },
                            {
                              "confidence": 98,
                              "text": "C",
                              "position": {
                                "l": 2356,
                                "t": 1637,
                                "r": 2389,
                                "b": 1684
                              }
                            },
                            {
                              "confidence": 90,
                              "text": "E",
                              "position": {
                                "l": 2395,
                                "t": 1639,
                                "r": 2425,
                                "b": 1685
                              }
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "confidence": 92
                }
              ]
            }
          ],
          "checkmarks": [
            {
              "confidence": 95,
              "position": {
                "l": 100,
                "t": 200,
                "r": 300,
                "b": 400
              },
              "value": "checked"
            }
          ],
          "barcodes": [
            {
              "id": "barcode_1",
              "confidence": 95,
              "position": {
                "l": 100,
                "t": 200,
                "r": 300,
                "b": 400
              },
              "type": "QRCode",
              "value": "12345",
              "supplementType": "none",
              "supplementValue": ""
            }
          ],
          "pictures": [
            {
              "id": "picture_1",
              "confidence": 95,
              "position": {
                "l": 100,
                "t": 200,
                "r": 300,
                "b": 400
              }
            }
          ],
          "separators": [
            {
              "confidence": 95,
              "position": {
                "l": 100,
                "t": 200,
                "r": 300,
                "b": 400
              },
              "type": "solid",
              "color": -1,
              "thickness": 2,
              "endPoints": {
                "startX": 0,
                "startY": 351,
                "endX": 3472,
                "endY": 351
              }
            }
          ]
        }
      ]
    }
  }
}

Authorizations

Authorization
string
header
required

Our API offers authentication via API keys. You can obtain an API key from https://developer.abbyy.com

Path Parameters

documentId
string
required

The id of the document

Response

200
application/json

The response from the getExtractedText endpoint.

meta
object
required

Represents a document that has been submitted for processing.

Example:
{
  "id": "wh23anb5xjf0ntw5taase5qz",
  "name": "document.jpg",
  "createdAt": "2025-02-07T17:44:06.949Z",
  "model": "image-to-text",
  "status": "Processed",
  "pageCount": 10,
  "errors": [{ "message": "Total is required" }]
}
text
object