Document Center
API debugging

Function Description

  • Universal text recognition
  • Applicable to any image with text
  • Upload images and return text recognition results

Key Features Description
Applicable scenarios Supports recognition of hundreds of common certificates and invoice documents by default, also supports text detection and recognition under any natural scenario
Text direction Supports mixed recognition of horizontal and vertical text by default
Print/handwriting Supports handwriting/print judgment and mixed recognition of printed and handwritten text by default
Character information Optional return of complete character information including character coordinates and candidate words, etc.
Language type Supports 52 languages and more mapping languages, including Simplified Chinese/Traditional Chinese/English/Japanese/Korean/French/German/Portuguese/Spanish/Italian/Dutch/Swedish/Finnish/Danish/Norwegian/Hungarian/Vietnamese /Afrikaans/Albanian/Basque/Catalan/Croatian/Czech/Estonian/Icelandic/Irish/Latin/Latvian/Lithuanian/Malay/Polish/ Romanian / Slovak / Slovenian / Swahili / Turkish / Welsh / Maltese / Creole / Galician / Esperanto / Filipino / Indonesian / Azerbaijani / Russian / Bulgarian Chinese/Macedonian/Ukrainian/Serbian/Belarusian/Greek/Armenian, etc.

Request URL

https://api.textin.ai/ai/service/v2/recognize

HTTP Request Method(Method)

HTTP POST

Request Header Description(Request Headers)

Please add the following custom headers (Header) in the HTTP request.

Header Name Header Value
x-ti-app-id Please log in and go to "Console - Account Settings - Developer Information" to view x-ti-app-id
x-ti-secret-code Please log in and go to "Console - Account Settings - Developer Information" to view x-ti-secret-code

URL Parameters(Parameters)

URL Parameters refer to key-value pairs that are concatenated to the URL in the form of {parameter name}={parameter value}. It starts with ?, and different parameters are connected using &. For example, ?p1=v1&p2=v2
parameter name Data Type Is Required Allowed Values Description
character integer No 0, 1
  • Returns complete character information including character coordinates and candidate words, etc., it is closed by default
straighten integer No 0, 1
  • Coordinate system option, it is closed by default and all results returned are based on the original image as the reference system
  • If turned on, all coordinate points of the returned results will use the orthographic image as the reference system
  • The caller needs to pay attention to the angle relationship between the image and the API result

Request Body Description(Request Body)

Content-Type: application/octet-stream

Images to be uploaded currently support most formats, including jpg, png, bmp, pdf, tiff, and single-frame gif.

Please note that the data format of the request body is a binary stream of files, not FormData or other formats.

Response Body Description(Response)

Content-Type: application/json

Description of JSON structure as follows:

Field Name Type Description
code integer Error code, see "Error Code Description" for details.
message string

Error message

version string

Interface version number.

duration number

Service time consumption, the unit is milliseconds (ms).

result object
+ angle integer

Image angle, Defining 0 degrees as the direction of the image in which humans read text is called an orthographic image, This field indicates that the input image is an upright image obtained by rotating it clockwise at several angles.

  • 0: ▲
  • 90: ▶
  • 180: ▼
  • 270: ◀
+ width integer

Enter the width of the image.

+ height integer

Enter the height of the image.

+ lines array

Recognition results in textual units

   ++ text string

Identifying Content Strings

   ++ score number

Identification confidence level

   ++ type string

Text type, used to represent the form of text. In the current version, text types include:

  • text
  • formula
   ++ position array

Represent a quadrilateral with an integer array of length 8, with the semantic upper left corner as the starting point, clockwise forming a closed region.

   ++ angle integer

Image angle, Defining 0 degrees as the direction of the image in which humans read text is called an orthographic image, This field indicates that the input image is an upright image obtained by rotating it clockwise at several angles.

  • 0: ▲
  • 90: ▶
  • 180: ▼
  • 270: ◀
   ++ direction integer

Text reading direction.

  • -1: Other
  • 0: Single word
  • 1: Horizontal
  • 2: vertical
   ++ handwritten integer

Is the text handwritten.

  • -1: unknown
  • 0: Non handwritten text, usually printed text
  • 1: Handwritten characters generally have distinct writing characteristics
   ++ char_scores array

Character confidence, range of values from 0 to 1. Output when character=1 is set.

   ++ char_centers array

Character center point. Output when character=1 is set.

   ++ char_positions array

The coordinates of the quadrilateral points of a character form a closed area in a clockwise direction. Output when character=1 is set.

   ++ char_candidates array

An array of candidate words, representing each character's candidate, used in conjunction with candidate confidence. Output when character=1 is set.

   ++ char_candidates_score array

The confidence array of candidate characters, representing the confidence level of each candidate character, is used in conjunction with the candidate characters. Output when character=1 is set.

DEMO
chart