RecognizeAllText
Recognizes text in multiple image types through a unified OCR interface, including general text, personal ID cards, and invoices. You only need to specify the image type by using the Type parameter without switching to a different API operation.
Operation description
How to use this operation
| Step | Description |
| 1 | Activate the Unified OCR Recognition service. After you activate this API operation, you receive a free quota that you can use for testing. |
| 2 | Purchase an OCR Shared Resource Plan. You can also skip purchasing a resource plan. The system automatically deducts fees based on actual usage through the pay-as-you-go billing method. |
| 3 | Refer to the code samples on the debugging page to complete API integration. After integration, call the API operation to obtain recognition results. If you use a RAM user to call the API operation, the Alibaba Cloud account must grant permissions to the RAM user. For more information about how to create a RAM user, see Create a RAM user. The text recognition service provides a system authorization policy: AliyunOCRFullAccess. For more information about how to grant permissions, see Grant permissions to a RAM user on the Users page. |
Important notes
| Type | Description |
| Image format |
|
| Image dimensions |
|
| Image size |
|
| Other notes |
|
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ocr:RecognizeAllText |
none |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Url |
string |
No |
|
https://example.png |
| body |
string |
No |
|
Binary file |
| Type |
string |
Yes |
|
Advanced |
| OutputFigure |
boolean |
No |
|
false |
| OutputQrcode |
boolean |
No |
|
false |
| OutputBarCode |
boolean |
No |
|
false |
| OutputStamp |
boolean |
No |
|
false |
| OutputCoordinate |
string |
No |
|
"" |
| OutputOricoord |
boolean |
No |
|
false |
| OutputKVExcel |
boolean |
No |
|
false |
| PageNo |
integer |
No |
When the image type is mixed invoice, VAT invoice, fixed-amount invoice, air itinerary, train ticket, VAT roll invoice, or general machine-printed invoice (Type=MixedInvoice/Invoice/QuotaInvoice/AirItinerary/TrainTicket/RollTicket/CommonPrintedInvoice), you can use this parameter to set optional features.
|
1 |
| AdvancedConfig |
object |
No |
|
|
| OutputRow |
boolean |
No |
|
false |
| OutputParagraph |
boolean |
No |
|
false |
| OutputTable |
boolean |
No |
|
false |
| OutputCharInfo |
boolean |
No |
|
false |
| IsLineLessTable |
boolean |
No |
|
false |
| IsHandWritingTable |
boolean |
No |
|
false |
| OutputTableExcel |
boolean |
No |
|
false |
| OutputTableHtml |
boolean |
No |
|
false |
| IdCardConfig |
object |
No |
|
|
| OutputIdCardQuality |
boolean |
No |
|
false |
| Llm_rec |
boolean |
No |
||
| InternationalIdCardConfig |
object |
No |
|
|
| Country |
string |
No |
Valid values:
|
India |
| InternationalBusinessLicenseConfig |
object |
No |
|
|
| Country |
string |
No |
Valid values:
|
India |
| MultiLanConfig |
object |
No |
|
|
| Languages |
string |
No |
|
eng,chn |
| TableConfig |
object |
No |
|
|
| IsHandWritingTable |
boolean |
No |
|
false |
| IsLineLessTable |
boolean |
No |
|
false |
| OutputTableExcel |
boolean |
No |
|
false |
| OutputTableHtml |
boolean |
No |
|
false |
The request parameters of this operation are divided into three levels. Level-1 parameters are required basic parameters such as the image URL and image type. Level-2 parameters control the recognition output, such as whether to return coordinates. Level-3 parameters are associated with specific image types and control whether to output specific information, such as whether to output the quality detection score of an ID card. Only Type is a required parameter. Set the other parameters as needed.
Supplementary description of request parameters supported by image type (Type)
| Type | Type description | Supported parameters |
| Advanced | Advanced general text recognition |
|
| General | Basic general text recognition |
|
| Commerce | E-commerce image text |
|
| HandWriting | Handwritten text |
|
| MultiLang | Multi-language text |
|
| Table | Table |
|
| IdCard | ID card |
|
| BankCard | Bank card |
|
| InternationalPassport | International passport |
|
| ChinesePassport | Chinese passport |
|
| SocialSecurityCard | Social security card |
|
| PermitToHK_MO_TW | Travel permit to Hong Kong, Macao, and Taiwan |
|
| PermitToMainland | Travel permit to the Chinese mainland |
|
| HouseholdHead | Household register front page |
|
| HouseholdResident | Household register resident page |
|
| EstateCertification | Real estate ownership certificate |
|
| BirthCertification | Birth certificate |
|
| HKIdCard | Hong Kong ID card |
|
| InternationalIdCard | International ID card |
|
| Stamp | Seal |
|
| MixedInvoice | Mixed invoice |
|
| Invoice | VAT invoice |
|
| CarInvoice | Motor vehicle sales invoice |
|
| QuotaInvoice | Fixed-amount invoice |
|
| AirItinerary | Air itinerary |
|
| TrainTicket | Train ticket |
|
| TollInvoice | Toll invoice |
|
| RollTicket | VAT roll invoice |
|
| BankAcceptance | Bank acceptance bill |
|
| BusShipTicket | Bus and ship ticket |
|
| NonTaxInvoice | Non-tax revenue invoice |
|
| CommonPrintedInvoice | General machine-printed invoice |
|
| HotelConsume | Hotel consumption record |
|
| PaymentRecord | Payment details page |
|
| PurchaseRecord | E-commerce order page |
|
| RideHailingItinerary | Ride-hailing itinerary |
|
| ShoppingReceipt | Shopping receipt |
|
| TaxClearanceCertificate | Tax clearance certificate |
|
| UsedCarInvoice | Used car sales invoice |
|
| VehicleLicense | Vehicle license |
|
| DrivingLicense | Driving license |
|
| VehicleRegistration | Motor vehicle registration certificate |
|
| VehicleCertification | Vehicle certificate of conformity |
|
| LicensePlateNumber | License plate |
|
| CarVinCode | Vehicle VIN code |
|
| BusinessLicense | Business license |
|
| InternationalBusinessLicense | International business license |
|
| MedicalDeviceManageLicense | Medical device business license |
|
| MedicalDeviceProduceLicense | Medical device production license |
|
| CosmeticProduceLicense | Cosmetic production license |
|
| QrCode | QR code | |
| BarCode | Barcode | |
| TaxiInvoice | Taxi invoice |
|
| TrademarkCertificate | Trademark registration certificate |
|
| FoodProduceLicense | Food production license |
|
| FoodManagementLicense | Food business license |
|
| ClassIIMedicalDeviceManageLicense | Class II medical device business filing certificate |
|
| WayBill | Electronic waybill |
|
| BankAccountPermit | Bank account opening permit |
|
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The unique request ID. |
E2A98925-DC2C-18FB-995F-BAF507XXXXXX |
| Data |
object |
The recognition result. |
|
| Height |
integer |
The height of the original image. |
2000 |
| Width |
integer |
The width of the original image. |
1000 |
| Content |
string |
The aggregated text content contained in the image. |
"Contract No...." |
| SubImageCount |
integer |
The number of sub-images contained in the image. |
2 |
| SubImages |
array<object> |
The sub-image information contained in the image. |
|
|
array<object> |
|||
| SubImageId |
integer |
The sub-image ID. Numbering starts from 0. |
0 |
| Type |
string |
The sub-image type, such as ID card front or VAT invoice. |
ID card front |
| Angle |
integer |
The clockwise rotation angle of the sub-image. Valid values: 0 to 359 degrees. |
0 |
| SubImagePoints |
array<object> |
The four-point coordinates of the sub-image. Returned when OutputCoordinate="points". |
|
|
object |
|||
| X |
integer |
The X-coordinate of the vertex. |
100 |
| Y |
integer |
The Y-coordinate of the vertex. |
200 |
| SubImageRect |
object |
The rotated rectangle coordinates of the sub-image. Returned when OutputCoordinate="rectangle". |
|
| CenterX |
integer |
The X-coordinate of the rectangle center point. |
100 |
| CenterY |
integer |
The Y-coordinate of the rectangle center point. |
200 |
| Width |
integer |
The width of the sub-image. |
1000 |
| Height |
integer |
The height of the sub-image. |
2000 |
| KvInfo |
object |
|
|
| KvCount |
integer |
The number of key-value pairs in the structured information of the sub-image. |
6 |
| Data |
any |
|
{ "address": "XX Province XX City XX Street No. XX", "ethnicity": "Han", "sex": "Male", "name": "Wang XX", "idNumber": "XXX", "birthDate": "January 1, 2000" } |
| KvDetails |
object |
|
|
|
object |
|
||
| KeyName |
string |
The field name. |
"address" |
| KeyConfidence |
integer |
The confidence score of the field. Valid values: 0 to 100. |
100 |
| Value |
string |
The text content of the value corresponding to the field (KeyName). |
"XX Province XX City XX Street" |
| ValueConfidence |
integer |
The confidence score of the value corresponding to the field name. Valid values: 0 to 100. |
98 |
| ValuePoints |
array<object> |
The four-point coordinates of the value corresponding to the field name. Returned when OutputCoordinate="points". |
|
|
object |
|||
| X |
integer |
The X-coordinate of the vertex. |
100 |
| Y |
integer |
The Y-coordinate of the vertex. |
200 |
| ValueRect |
object |
The rotated rectangle coordinates of the value corresponding to the field name. Returned when OutputCoordinate="rectangle". |
|
| CenterX |
integer |
The X-coordinate of the rectangle center point. |
100 |
| CenterY |
integer |
The Y-coordinate of the rectangle center point. |
200 |
| Width |
integer |
The width of the rectangle. |
50 |
| Height |
integer |
The height of the rectangle. |
50 |
| ValueAngle |
integer |
The clockwise rotation angle of the value corresponding to the field name. Valid values: 0 to 359. |
0 |
| BlockInfo |
object |
|
|
| BlockCount |
integer |
The number of text blocks in the sub-image. |
12 |
| BlockDetails |
array<object> |
The text block details of the sub-image. |
|
|
array<object> |
|||
| BlockId |
integer |
The text block ID. Numbering starts from 0. |
0 |
| BlockAngle |
integer |
The clockwise rotation angle of the text block. Valid values: 0 to 359. |
0 |
| BlockContent |
string |
The text content of the text block. |
"Contract No...." |
| BlockConfidence |
integer |
The confidence score of the text block. Valid values: 0 to 100. |
98 |
| BlockPoints |
array<object> |
The four-point coordinates of the text block. Returned when OutputCoordinate="points". |
|
|
object |
|||
| X |
integer |
The X-coordinate of the vertex. |
100 |
| Y |
integer |
The Y-coordinate of the vertex. |
200 |
| BlockRect |
object |
The rotated rectangle coordinates of the text block. Returned when OutputCoordinate="rectangle". |
|
| CenterX |
integer |
The X-coordinate of the rectangle center point. |
100 |
| CenterY |
integer |
The Y-coordinate of the rectangle center point. |
200 |
| Width |
integer |
The width of the rectangle. |
50 |
| Height |
integer |
The height of the rectangle. |
10 |
| CharInfos |
array<object> |
The character-level information. Returned when AdvancedConfig.OutputCharInfo=true. |
|
|
array<object> |
|||
| CharId |
integer |
The character ID. Numbering starts from 0. |
0 |
| CharContent |
string |
The character content. |
"C" |
| CharConfidence |
integer |
The confidence score of the character. Valid values: 0 to 100. |
95 |
| CharPoints |
array<object> |
The four-point coordinates of the character. Returned when OutputCoordinate="points". |
|
|
object |
|||
| X |
integer |
The X-coordinate of the vertex. |
100 |
| Y |
integer |
The Y-coordinate of the vertex. |
200 |
| CharRect |
object |
The rotated rectangle coordinates of the character. Returned when OutputCoordinate="rectangle". |
|
| CenterX |
integer |
The X-coordinate of the rectangle center point. |
100 |
| CenterY |
integer |
The Y-coordinate of the rectangle center point. |
200 |
| Width |
integer |
The width of the rectangle. |
10 |
| Height |
integer |
The height of the rectangle. |
10 |
| TableInfo |
object |
The table information. Returned when AdvancedConfig.OutputTable=true. |
|
| TableCount |
integer |
The number of tables. |
2 |
| TableDetails |
array<object> |
The table details. |
|
|
array<object> |
|||
| TableId |
integer |
The table ID. Numbering starts from 0. |
0 |
| RowCount |
integer |
The number of rows in the table. |
10 |
| ColumnCount |
integer |
The number of columns in the table. |
3 |
| CellCount |
integer |
The number of cells in the table. |
29 |
| Header |
object |
The table header information. |
|
| Contents |
array |
The text content of the table header. |
|
|
string |
|
"12.1 Parties to this contract" |
|
| BlockId |
integer |
The text block ID (numbering starts from 0). |
0 |
| Footer |
object |
The table footer information. |
|
| Contents |
array |
The text content of the table footer. |
|
|
string |
The content of a single footer line. |
"Lender/Mortgagee (Seal/Electronic Signature):" |
|
| BlockId |
integer |
The text block ID. Numbering starts from 0. |
0 |
| CellDetails |
array<object> |
The cell information details. |
|
|
array<object> |
|||
| CellId |
integer |
The cell ID (numbering starts from 0). |
0 |
| CellContent |
string |
The text content of the cell. |
"Borrower/Mortgagor:" |
| RowStart |
integer |
The starting row number of the cell. The position of the first cell is 0. |
0 |
| RowEnd |
integer |
The ending row number of the cell. The position of the first cell is 0. RowStart=0 and RowEnd=0 indicates that the cell occupies only the first row. |
0 |
| ColumnStart |
integer |
The starting column number of the cell. The position of the first cell is 0. |
2 |
| ColumnEnd |
integer |
The ending column number of the cell. The position of the first cell is 0. ColumnStart=0 and ColumnEnd=0 indicates that the cell occupies only the first column. |
5 |
| BlockList |
array |
The text block IDs contained in this cell. |
|
|
integer |
The ID of a single text block. |
0 |
|
| CellPoints |
array<object> |
The four-point coordinates of the cell (returned when OutputCoordinate="points"). |
|
|
object |
|||
| X |
integer |
The X-coordinate of the vertex. |
100 |
| Y |
integer |
The Y-coordinate of the vertex. |
200 |
| CellRect |
object |
The rotated rectangle coordinates of the cell (returned when OutputCoordinate="rectangle"). |
|
| CenterX |
integer |
The X-coordinate of the rectangle center point. |
100 |
| CenterY |
integer |
The Y-coordinate of the rectangle center point. |
200 |
| Width |
integer |
The width of the rectangle. |
20 |
| Height |
integer |
The height of the rectangle. |
20 |
| CellAngle |
integer |
The clockwise rotation angle of the cell (range: 0 to 359). |
0 |
| TablePoints |
array<object> |
The four-point coordinates of the table (returned when OutputCoordinate="points"). |
|
|
object |
|||
| X |
integer |
The X-coordinate of the vertex. |
100 |
| Y |
integer |
The Y-coordinate of the vertex. |
200 |
| TableRect |
object |
The rotated rectangle coordinates of the table (returned when OutputCoordinate="rectangle"). |
|
| CenterX |
integer |
The X-coordinate of the rectangle center point. |
100 |
| CenterY |
integer |
The Y-coordinate of the rectangle center point. |
200 |
| Width |
integer |
The width of the rectangle. |
100 |
| Height |
integer |
The height of the rectangle. |
100 |
| TableExcel |
string |
|
https://example.xlsx |
| TableHtml |
string |
|
https://example.html |
| RowInfo |
object |
The row information of the sub-image (returned when AdvancedConfig.OutputRow=true). |
|
| RowCount |
integer |
The number of rows contained in the sub-image. |
9 |
| RowDetails |
array<object> |
The row information details of the sub-image. |
|
|
object |
|||
| RowId |
integer |
The row ID (numbering starts from 0). |
0 |
| RowContent |
string |
The text content of the row. |
"Contract No...." |
| BlockList |
array |
The list of text block IDs contained in this row. |
|
|
integer |
The ID of a single text block. |
0 |
|
| ParagraphInfo |
object |
The paragraph information of the sub-image (returned when AdvancedConfig.OutputParagraph=true). |
|
| ParagraphCount |
integer |
The number of paragraphs contained in the sub-image. |
11 |
| ParagraphDetails |
array<object> |
The paragraph information details of the sub-image. |
|
|
object |
|||
| ParagraphId |
integer |
The paragraph ID (numbering starts from 0). |
0 |
| ParagraphContent |
string |
The text content of the paragraph. |
"Contract No...." |
| BlockList |
array |
The list of text block IDs contained in this paragraph. |
|
|
integer |
The ID of a single text block. |
0 |
|
| QrCodeInfo |
object |
The QR code information of the sub-image (returned when OutputQrcode=true). |
|
| QrCodeCount |
integer |
The number of QR codes in the sub-image. |
1 |
| QrCodeDetails |
array<object> |
The QR code information details of the sub-image. |
|
|
array<object> |
|||
| Data |
any |
The content of the QR code. |
“http://www.gsxt.gov.cn/indeXXX” |
| QrCodePoints |
array<object> |
The four-point coordinates of the QR code (returned when OutputCoordinate="points"). |
|
|
object |
|||
| X |
integer |
The X-coordinate of the vertex. |
100 |
| Y |
integer |
The Y-coordinate of the vertex. |
200 |
| QrCodeRect |
object |
The rotated rectangle coordinates of the QR code (returned when OutputCoordinate="rectangle"). |
|
| CenterX |
integer |
The X-coordinate of the rectangle center point. |
100 |
| CenterY |
integer |
The Y-coordinate of the rectangle center point. |
200 |
| Width |
integer |
The width of the rectangle. |
100 |
| Height |
integer |
The height of the rectangle. |
100 |
| QrCodeAngle |
integer |
The rotation angle of the QR code (range: 0 to 359). |
0 |
| BarCodeInfo |
object |
The barcode information of the sub-image (returned when OutputBarCode=true). |
|
| BarCodeCount |
integer |
The number of barcodes in the sub-image. |
2 |
| BarCodeDetails |
array<object> |
The barcode information details. |
|
|
array<object> |
|||
| Type |
string |
The barcode type. The following types are supported:
|
Code128 |
| Data |
any |
The content of the barcode. |
"1100011XXXXXX" |
| BarCodePoints |
array<object> |
The four-point coordinates of the barcode (returned when OutputCoordinate="points"). |
|
|
object |
|||
| X |
integer |
The X-coordinate of the vertex. |
100 |
| Y |
integer |
The Y-coordinate of the vertex. |
200 |
| BarCodeRect |
object |
The rotated rectangle coordinates of the barcode (returned when OutputCoordinate="rectangle"). |
|
| CenterX |
integer |
The X-coordinate of the rectangle center point. |
100 |
| CenterY |
integer |
The Y-coordinate of the rectangle center point. |
200 |
| Width |
integer |
The width of the rectangle. |
100 |
| Height |
integer |
The height of the rectangle. |
10 |
| BarCodeAngle |
integer |
The clockwise rotation angle of the barcode (range: 0 to 359). |
0 |
| FigureInfo |
object |
The figure information contained in the sub-image (returned when OutputFigure=true). This is a dictionary type where the key is the figure type and the value is the information of figures of that type. The following figure types are supported:
|
|
|
object |
The figure details. |
||
| FigureCount |
integer |
The number of figures contained in the sub-image. |
3 |
| FigureDetails |
array<object> |
The details of the figure information. |
|
|
array<object> |
|||
| Type |
string |
The figure type. Valid values: blicense_title, national_emblem, face, finger_print, and signature. |
face |
| Data |
any |
The figure data. This field is returned only when data is available. |
“” |
| FigurePoints |
array<object> |
The four-point coordinates of the figure. This field is returned when OutputCoordinate="points". |
|
|
object |
|||
| X |
integer |
The X-coordinate of the vertex. |
100 |
| Y |
integer |
The Y-coordinate of the vertex. |
200 |
| FigureRect |
object |
The rotated rectangle coordinates of the figure. This field is returned when OutputCoordinate="rectangle". |
|
| CenterX |
integer |
The X-coordinate of the rectangle center point. |
100 |
| CenterY |
integer |
The Y-coordinate of the rectangle center point. |
200 |
| Width |
integer |
The width of the rectangle. |
50 |
| Height |
integer |
The height of the rectangle. |
50 |
| FigureAngle |
integer |
The clockwise rotation angle of the figure. Value range: 0 to 359. |
0 |
| StampInfo |
object |
The stamp information of the sub-image. This field is returned when OutputStamp=true. |
|
| StampCount |
integer |
The number of stamps in the sub-image. |
2 |
| StampDetails |
array<object> |
The details of the stamp information. |
|
|
array<object> |
|||
| Data |
object |
The recognition result of the sub-image stamp. The value is a dictionary type in which keys are field names and values are the recognition results of the corresponding fields. |
|
| CompanyId |
string |
The import and export enterprise code. |
"XXX" |
| OrganizationName |
string |
The organization name. |
"XXX Trading Co., Ltd." |
| AntiFakeCode |
string |
The anti-counterfeiting code. |
"3205823XXXXXX" |
| OtherText |
string |
The other text. |
"3205823XXXXXX" |
| TopText |
string |
The top arc text. |
"XXX Trading Co., Ltd." |
| OrganizationNameEng |
string |
The English organization name. |
"" |
| TaxpayerId |
string |
The taxpayer identification number. |
"" |
| StampPoints |
array<object> |
The four-point coordinates of the stamp. This field is returned when OutputCoordinate="points". |
|
|
object |
|||
| X |
integer |
The X-coordinate of the vertex. |
100 |
| Y |
integer |
The Y-coordinate of the vertex. |
200 |
| StampRect |
object |
The rotated rectangle coordinates of the stamp. This field is returned when OutputCoordinate="rectangle". |
|
| CenterX |
integer |
The X-coordinate of the rectangle center point. |
100 |
| CenterY |
integer |
The Y-coordinate of the rectangle center point. |
200 |
| Width |
integer |
The width of the rectangle. |
50 |
| Height |
integer |
The height of the rectangle. |
50 |
| StampAngle |
integer |
The clockwise rotation angle of the rectangle. Value range: 0 to 359. |
0 |
| QualityInfo |
object |
The quality detection information of the sub-image. |
|
| IsCopy |
boolean |
Indicates whether the image is a photocopy. |
false |
| IsReshoot |
boolean |
Indicates whether the image is a recaptured photo. Only ID card images (Type=IdCard) are supported. |
false |
| CompletenessScore |
number |
The completeness score. Only ID card images (Type=IdCard) are supported. |
90.5 |
| QualityScore |
number |
The overall quality score. Only ID card images (Type=IdCard) are supported. |
80.5 |
| TamperScore |
number |
The tampering score. Only ID card images (Type=IdCard) are supported. |
10.5 |
| XmlResult |
string |
The result in XML format. |
"" |
| AlgoVersion |
string |
The algorithm version number. |
"" |
| DebugInfo |
any |
The debug information. This field is returned only when the value is not empty. |
"" |
| AlgoServer |
array |
The list of algorithm server information. This field is returned only when the value is not empty. |
|
|
string |
The algorithm server information. |
"" |
|
| IsMixedMode |
boolean |
Indicates whether the image is of a mixed-paste type. |
false |
| PageNo |
integer |
The page number of the PDF or OFD file. The value starts from 1. |
1 |
| KvExcelUrl |
string |
|
https://example.xlsx |
| Code |
string |
The error code. This field is not returned when recognition succeeds. |
400 |
| Message |
string |
The error message. This field is not returned when recognition succeeds. |
illegalImageUrl |
KV information fields corresponding to each image type (Type). All KV fields are of the String type.
| Type | Type description | Returned KV information fields |
| IdCard | ID card |
|
| BankCard | Bank card |
|
| InternationalPassport | International passport |
|
| ChinesePassport | Chinese passport |
|
| SocialSecurityCard | Social security card |
|
| PermitToHK_MO_TW | Travel permit to Hong Kong, Macao, and Taiwan |
|
| PermitToMainland | Travel permit to Chinese mainland |
|
| HouseholdHead | Household register header page |
|
| HouseholdResident | Household register resident page |
|
| EstateCertification | Real estate ownership certificate |
|
| BirthCertification | Birth certificate |
|
| HKIdCard | Hong Kong identity card |
|
| InternationalIdCard | International identity card |
|
| Stamp | Seal |
|
| Invoice | VAT invoice |
|
| CarInvoice | Motor vehicle sales invoice |
|
| QuotaInvoice | Fixed-amount invoice |
|
| AirItinerary | Air itinerary |
|
| TrainTicket | Train ticket |
|
| TollInvoice | Toll invoice |
|
| RollTicket | VAT roll invoice |
|
| BankAcceptance | Bank acceptance bill |
|
| BusShipTicket | Bus/ship ticket |
|
| NonTaxInvoice | Non-tax revenue invoice |
|
| CommonPrintedInvoice | General machine-printed invoice |
|
| HotelConsume | Hotel transaction record |
|
| PaymentRecord | Payment details page |
|
| PurchaseRecord | E-commerce order page |
|
| RideHailingItinerary | Ride-hailing itinerary |
|
| ShoppingReceipt | Shopping receipt |
|
| TaxClearanceCertificate | Tax clearance certificate |
|
| UsedCarInvoice | Used car sales invoice |
|
| VehicleLicense | Vehicle license |
|
| DrivingLicense | Driving license |
|
| VehicleRegistration | Motor vehicle registration certificate |
|
Examples
Success response
JSON format
{
"RequestId": "E2A98925-DC2C-18FB-995F-BAF507XXXXXX",
"Data": {
"Height": 2000,
"Width": 1000,
"Content": "\"合同编号...\"",
"SubImageCount": 2,
"SubImages": [
{
"SubImageId": 0,
"Type": "身份证正面",
"Angle": 0,
"SubImagePoints": [
{
"X": 100,
"Y": 200
}
],
"SubImageRect": {
"CenterX": 100,
"CenterY": 200,
"Width": 1000,
"Height": 2000
},
"KvInfo": {
"KvCount": 6,
"Data": "{\n \"address\": \"XX省XX市XX街道XX号\",\n \"ethnicity\": \"汉\",\n \"sex\": \"男\",\n \"name\": \"王XX\",\n \"idNumber\": \"XXX\",\n \"birthDate\": \"2000年1月1日\"\n}",
"KvDetails": {
"key": {
"KeyName": "\"address\"",
"KeyConfidence": 100,
"Value": "\"XX省XX市XX街道\"",
"ValueConfidence": 98,
"ValuePoints": [
{
"X": 100,
"Y": 200
}
],
"ValueRect": {
"CenterX": 100,
"CenterY": 200,
"Width": 50,
"Height": 50
},
"ValueAngle": 0
}
}
},
"BlockInfo": {
"BlockCount": 12,
"BlockDetails": [
{
"BlockId": 0,
"BlockAngle": 0,
"BlockContent": "“合同编号...”",
"BlockConfidence": 98,
"BlockPoints": [
{
"X": 100,
"Y": 200
}
],
"BlockRect": {
"CenterX": 100,
"CenterY": 200,
"Width": 50,
"Height": 10
},
"CharInfos": [
{
"CharId": 0,
"CharContent": "“合”",
"CharConfidence": 95,
"CharPoints": [
{
"X": 100,
"Y": 200
}
],
"CharRect": {
"CenterX": 100,
"CenterY": 200,
"Width": 10,
"Height": 10
}
}
]
}
]
},
"TableInfo": {
"TableCount": 2,
"TableDetails": [
{
"TableId": 0,
"RowCount": 10,
"ColumnCount": 3,
"CellCount": 29,
"Header": {
"Contents": [
"\"12.1本合同当事人\""
],
"BlockId": 0
},
"Footer": {
"Contents": [
"\"贷款人/抵押权人(盖章/电子签章):\""
],
"BlockId": 0
},
"CellDetails": [
{
"CellId": 0,
"CellContent": "\"借款人/抵押人:\"",
"RowStart": 0,
"RowEnd": 0,
"ColumnStart": 2,
"ColumnEnd": 5,
"BlockList": [
0
],
"CellPoints": [
{
"X": 100,
"Y": 200
}
],
"CellRect": {
"CenterX": 100,
"CenterY": 200,
"Width": 20,
"Height": 20
},
"CellAngle": 0
}
],
"TablePoints": [
{
"X": 100,
"Y": 200
}
],
"TableRect": {
"CenterX": 100,
"CenterY": 200,
"Width": 100,
"Height": 100
}
}
],
"TableExcel": "https://example.xlsx",
"TableHtml": "https://example.html"
},
"RowInfo": {
"RowCount": 9,
"RowDetails": [
{
"RowId": 0,
"RowContent": "“合同编号...\"",
"BlockList": [
0
]
}
]
},
"ParagraphInfo": {
"ParagraphCount": 11,
"ParagraphDetails": [
{
"ParagraphId": 0,
"ParagraphContent": "“合同编号...”",
"BlockList": [
0
]
}
]
},
"QrCodeInfo": {
"QrCodeCount": 1,
"QrCodeDetails": [
{
"Data": "“http://www.gsxt.gov.cn/indeXXX”",
"QrCodePoints": [
{
"X": 100,
"Y": 200
}
],
"QrCodeRect": {
"CenterX": 100,
"CenterY": 200,
"Width": 100,
"Height": 100
},
"QrCodeAngle": 0
}
]
},
"BarCodeInfo": {
"BarCodeCount": 2,
"BarCodeDetails": [
{
"Type": "Code128",
"Data": "\"1100011XXXXXX\"",
"BarCodePoints": [
{
"X": 100,
"Y": 200
}
],
"BarCodeRect": {
"CenterX": 100,
"CenterY": 200,
"Width": 100,
"Height": 10
},
"BarCodeAngle": 0
}
]
},
"FigureInfo": {
"key": {
"FigureCount": 3,
"FigureDetails": [
{
"Type": "face",
"Data": "“”",
"FigurePoints": [
{
"X": 100,
"Y": 200
}
],
"FigureRect": {
"CenterX": 100,
"CenterY": 200,
"Width": 50,
"Height": 50
},
"FigureAngle": 0
}
]
}
},
"StampInfo": {
"StampCount": 2,
"StampDetails": [
{
"Data": {
"CompanyId": "\"XXX\"",
"OrganizationName": "\"XXX贸易有限公司\"",
"AntiFakeCode": "\"3205823XXXXXX\"",
"OtherText": "\"3205823XXXXXX\"",
"TopText": "\"XXX贸易有限公司\"",
"OrganizationNameEng": "\"\"",
"TaxpayerId": "\"\""
},
"StampPoints": [
{
"X": 100,
"Y": 200
}
],
"StampRect": {
"CenterX": 100,
"CenterY": 200,
"Width": 50,
"Height": 50
},
"StampAngle": 0
}
]
},
"QualityInfo": {
"IsCopy": false,
"IsReshoot": false,
"CompletenessScore": 90.5,
"QualityScore": 80.5,
"TamperScore": 10.5
}
}
],
"XmlResult": "\"\"",
"AlgoVersion": "\"\"",
"DebugInfo": "\"\"",
"AlgoServer": [
"\"\""
],
"IsMixedMode": false,
"PageNo": 1,
"KvExcelUrl": "https://example.xlsx"
},
"Code": "400",
"Message": "illegalImageUrl"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | invalidInputParameter | %s | |
| 400 | InvalidCountry | Specified parameter Country is not valid. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.