[AI10]Generate an OCR recognition task

post
https://connect.patsnap.com/ai/ocr/task/create
Try in Sandbox

This interface provides the task of creating and downloading OCR recognition, generating jobs_id, through jobs_id Go to "[AI10] query and export the OCR recognition results". OCR recognition supports recognizing numbers, text information, table contents, and more in images or scanned PDF files. Additionally, it can analyze the layout and provide OCR recognition results in multiple formats that closely resemble the structure of the original document.

1. The document text language of OCR defaults to Chinese, English and numbers; 2.OCR recognition supports downloading the doc/html/xls/ppt/txt version. 3.All OCR recognition results are downloaded in real time, and the download time is 1~2 hours

Request Parameters

List of parameters supported by this API endpoint

NameTypeExampleDescription
document
Required
stringhttps://static-open.zhihuiya.com/sample/common_demo.png
The images or scanned PDF files that require OCR recognition.
document_type
Required
stringpng
The types of files that require OCR include: pdf, png, jpg.
ocr_format
Required
stringdoc
Search for the type of OCR recoginition results, doc/html/xls/ppt/txt
document_lang
array[ "简体中文", "数字", "英语" ]

Language(s) of the text in the file to be recognized for OCR (multiple selections allowed), for example:

Simplified Chinese

Abkhaz

Adyghe

Afrikaans

Agul

Albanian

Altai

Arabic (Saudi Arabia)

Armenian (Eastern)

Armenian (Western)

Armenian (Grabar)

Avar

Aymara

Azeri (Cyrillic)

Azeri (Latin)

Bashkir

Basque

Belarusian

Bemba

Blackfoot

Breton

Bugotu

Bulgarian

Buryat

Catalan

Cebuano

Chamorro

Chechen

Chinese Traditional

Chukchee

Chuvash

Corsican

Crimean Tatar

Croatian

Crow

Czech

Dakota

Danish

Dargwa

Dungan

Dutch

Dutch (Belgian)

English

Eskimo (Cyrillic)

Eskimo (Latin)

Estonian

Even

Evenki

Faroese

Fijian

Finnish

French

Frisian

Friulian

Gagauz

Galician

Ganda

German

German (Luxembourg)

German (New Spelling)

Greek

Guarani

Hani

Hausa

Hawaiian

Hebrew

Hungarian

Icelandic

Indonesian

Ingush

Irish

Italian

Japanese

Japanese (Modern)

Jingpo

Kabardian

Kalmyk

Karachay-balkar

Karakalpak

Kashubian

Kawa

Kazakh

Khakass

Khanty

Kikuyu

Kirghiz

Kongo

Korean

Korean (Hangul)

Koryak

Kpelle

Kumyk

Kurdish

Lak

Latin

Latvian

Latvian Gothic

Lezgi

Lithuanian

Luba

Macedonian

Malagasy

Malay (Malaysian)

Malinke

Maltese

Mansi

Maori

Mari

Maya

Miao

Minangkabau

Mohawk

Mongol

Mordvin

Nahuatl

Nenets

Nivkh

Nogay

Norwegian

Norwegian (Bokmal)

Norwegian (Nynorsk)

Nyanja

Occitan

Ojibway

Old English

Old French

Old German

Old Italian

Old Slavonic

Old Spanish

Ossetian

Papiamento

Polish

Portuguese

Portuguese (Brazilian)

Quechua (Bolivia)

Rhaeto-Romanic

Romanian

Romanian (Moldova)

Romany

Rundi

Russian

Russian (Old Spelling)

Russian with stress marks

Rwanda

Sami (Lappish)

Samoan

Scottish Gaelic

Selkup

Serbian (Cyrillic)

Serbian (Latin)

Shona

Slovak

Slovenian

Somali

Sorbian

Sotho

Spanish

Sunda

Swahili

Swazi

Swedish

Tabasaran

Tagalog

Tahitian

Tajik

Tatar

Thai

Tok Pisin

Tongan

Tswana

Tun

Turkish

Turkmen (Cyrillic)

Turkmen (Latin)

Tuvinian

Udmurt

Uighur (Cyrillic)

Uighur (Latin)

Ukrainian

Uzbek (Cyrillic)

Uzbek (Latin)

Vietnamese

Welsh

Wolof

Xhosa

Yakut

Yiddish

Zapotec

Zulu

Note: Default is "Simplified Chinese; Numbers; English."

Response Schema

Structure of the API response data

Field NameTypeExampleDescription
data
object-
response data
job_id
stringb4bdae6b4a65432d91f25b5c52bdfd80
export OCR recognition result task id.
status
Required
booleanfalse
Status
error_msg
stringThe request parameter format is incorrect!
Error Message
error_code
Required
integer0
Error Code

Success Response Example

Example of a successful API response

JSON
{
  "data": {
    "job_id": "b4bdae6b4a65432d91f25b5c52bdfd80"
  },
  "status": true,
  "error_code": 0
}

Error Codes

List of possible error codes returned by this endpoint

Business Errors

Error CodeDescription
68300004Invalid parameter!
68300005Search api failure!
68300006Analytic basic access error!
68300007Bad request!
68300008Service error, please try again later!
68300010The file does not comply with upload specifications!

Platform Errors

Error CodeDescription
67200000API call exceeds the total limit set by the platform!
67200001API call exceeds the total limit set by the platform!
67200002The current call rate is too fast, exceeding the current configuration limit QPS!
67200003The key and secret parameters for applying for the token are incorrect or the client has been disabled!
67200004The requested api does not have permission. Please contact our support personnel!
67200005Insufficient account balance/number of calls!
67200006The client has exceeded the activation validity period!
67200007The current call exceeds the configured usage limit of the day!
67200008Please check if the required apikey in the query parameter has been transmitted!
67200009The apikey does not match the passed bearerToken. Please check if a valid token is being used!
67200012The request is illegal!
67200100The current server status is busy, request response timeout!
67200101The API requested currently does not exist. Please check the request path!

HTTP Status Codes

Status CodeDescription
0Success
201Created
401Unauthorized
403Forbidden
404Not Found

Performance Metrics

Expected performance characteristics for this endpoint

Normal Response Time

5000 ms

Max Response Time

10000 ms