API overview
API standards and multilingual preset SDKs
The OpenAPI of this product (ocr-api/2021-07-07) uses the RPC signature style. We have encapsulated SDKs for common programming languages for developers. Developers can download the SDK to directly call this product's OpenAPI without worrying about technical details. If the existing SDK does not meet your needs, you can use the signature mechanism for self-signing integration. Since the details of self-signing are very complex, it may take around 5 business days. Therefore, we recommend joining our DingTalk service group (147535001692) and conducting signature integration under expert guidance.
Before using the API, you need to prepare your identity account and access key (AccessKey) to effectively access the API through client tools (such as SDK and CLI). For details, see Obtain an AccessKey.
Custom signature scenarios
If your business scenario has special requirements and you need to integrate the API through self-signing, we recommend consulting our technical support team first (DingTalk service group: 147535001692) to obtain professional guidance and ensure efficient integration.
Account and security preparation
Alibaba Cloud accounts have full administrative permissions over all resources. Once an AccessKey is compromised, all associated resources will be at risk of unauthorized access. To ensure security, it is recommended to create a RAM user with only API access permissions and configure its AccessKey, while configuring RAM policies based on the principle of least privilege (PoLP). Use the Alibaba Cloud account only in specific scenarios where Alibaba Cloud account permissions are explicitly required.
Unified OCR recognition
|
API |
Title |
Description |
| RecognizeAllText | Unified OCR Recognition | The OCR Unified Recognition API recognizes multiple image types, such as general text, ID cards, and invoices. Specify the image type using the Type parameter. You do not need to switch APIs. |
| RecognizeGeneralStructure | General Document Information Extraction | The general ticket extraction feature combines the capabilities of ReadLight OCR and the Qwen large language model (LLM) to extract key key-value (KV) information from long-tail receipts not supported by OCR, such as structured recognition and output of critical fields including Name, Address, and Date. |
General text recognition
|
API |
Title |
Description |
| RecognizeAdvanced | High-Precision Full-Text Recognition | Supports accurate detection of multi-format layouts, complex document backgrounds, and varying lighting environments. It enables detection after seal removal and supports advanced features such as low-confidence filtering and pattern Detection. |
| RecognizeHandwriting | General Handwriting Recognition | Supports handwriting recognition in complex scenarios, including Chinese handwriting, English handwriting, and numeric handwriting. |
| RecognizeBasic | E-commerce Image OCR | Quick and accurate character detection in images from online scenarios such as E-commerce product promotional images, community forum images, and user-generated content (UGC) images. |
| RecognizeGeneral | General OCR | Suitable for unstructured text recognition. Supports returning both the recognized text content and its position coordinates. |
| RecognizeTableOcr | Table Recognition | Supports effective detection of wired tables, striped tables, and wireless tables. |
| RecognizeDocumentStructure | Document Structure Recognition | Structurally detects document information and provides layout information output from two perspectives: element tiling and hierarchical tree. It can extract textual elements (such as individual characters, text blocks, lines, etc.) and corresponding layout formats (such as titles, paragraphs, tables) from documents and output them in sequence. |
Personal document recognition
|
API |
Title |
Description |
| RecognizeIdcard | ID Card Recognition | This API recognizes structured fields from both the front and back of a second-generation Chinese resident identity card. These fields include name, gender, ethnicity, address, date of birth, ID number, issuing authority, and validity period. It also supports ID quality checks, such as detecting screen captures, photocopies, completeness scores, overall quality scores, tampering indexes, and face location detection. |
| RecognizePassport | International Passport Recognition | Provides passport recognition services for major countries and regions worldwide, including the United States, France, the United Kingdom, Japan, and South Korea. Supported fields include nationality, passport number, date of birth, name, and more. |
| RecognizeHousehold | Household Register Recognition | It can structurally recognize the content of both the household registration page for permanent residents and the household head page, effectively extracting relevant household registration information from the household register. |
| RecognizeEstateCertification | Real Estate Certificate Recognition | Accurately detects key information from real estate certificates, including owner details, property address, area size, land rights type, and more. It supports recognition of various property certificates issued across different regions in China. |
| RecognizeBankCard | Bank Card Recognition | It can accurately detect the bank card number and validity period on various types of bank cards. It supports recognition and extraction from both horizontal and vertical cards, as well as cards tilted at any angle. It covers most banks in the Chinese mainland and supports cards with varying digit lengths, embossed surfaces, flat surfaces, and other formats. |
| RecognizeBirthCertification | Birth Certificate Recognition | It can accurately detect key information on birth certificates, such as date of birth, birth weight, and place of birth. |
| RecognizeChinesePassport | Chinese Passport Recognition | Supports structured content detection and recognition for passports of the People's Republic of China, including passports from the Chinese mainland, Hong Kong (China), Macao (China), and Taiwan (China). Detected fields include place of birth, date of birth, nationality, gender, passport number, validity period end date, issuing country, issuing location, and more. |
| RecognizeExitEntryPermitToMainland | Mainland Travel Permit Recognition | Accurately detects key information from travel permits, including name, date of birth, certificate number, and more. Supports Mainland Travel Permits for Hong Kong and Macao Residents as well as Mainland Travel Permits for Taiwan Residents. |
| RecognizeExitEntryPermitToHK | Travel Permit for Hong Kong, Macao, and Taiwan Recognition | Supports accurate detection of key fields in travel permits, such as name, date of birth, and certificate number. |
| RecognizeHKIdcard | Hong Kong (China) Identity Card Recognition | This API recognizes both Hong Kong Permanent Identity Cards and Hong Kong Identity Cards, detecting all card fields such as the Chinese name (if available), English name, Chinese commercial code (if available), date of birth, sex, symbols, and identity card number. |
| RecognizeSocialSecurityCardVersionII | Social Security Card Recognition | Supports full-field detection, including title, name, Social Security number, Social Security card number, bank account, issue date, and more. |
| RecognizeInternationalIdcard | International Identity Document Recognition | It can perform structured recognition of foreign identity documents. Currently supported documents include resident ID cards from Vietnam, South Korea, India, and Bangladesh. Recognizable fields include name, date of birth, document number, and more. |
Invoice and receipt recognition
|
API |
Title |
Description |
| RecognizeMixedInvoices | Mixed Invoice Recognition | Supports structured recognition and output of key fields such as invoice code, total amount including tax, total amount, purchaser identification number, and invoice date for various types of receipts. |
| RecognizeInvoice | VAT Invoice Recognition | Supports structured recognition and output of key fields from VAT special invoices, VAT general invoices, and VAT electronic invoices, including invoice code, invoice number, invoicing date, invoice amount, tax amount, verification code, purchaser's tax ID, seller's tax ID, and invoice details. |
| RecognizeCarInvoice | Unified Invoice Recognition for Motor Vehicle Sales | Supports structured recognition and output of key fields, such as invoice code, invoice number, invoice date, invoice amount, value-added tax (VAT) amount, certificate number, purchaser name, and purchaser ID number or organization code. |
| RecognizeQuotaInvoice | Fixed-amount Invoice Recognition | Supports structured recognition and output of key fields such as invoice number, invoice code, and invoice amount. |
| RecognizeAirItinerary | Air Travel Itinerary Recognition | Supports structured recognition and output of fields such as passenger name, ID card number, electronic ticket number, issuance date, and issuing organization. |
| RecognizeTrainInvoice | Train Ticket Recognition | Supports structured recognition and output of fields such as ticket number, departure station, arrival station, departure time, fare, seat type, passenger information, seat number, and train number. After the update on 2024-12-31, electronic train tickets are supported, and the following new fields are added to the response: electronic ticket number, buyer name, buyer unified credit code, title, invoice date, and remarks. |
| RecognizeTaxiInvoice | Taxi Invoice Recognition | Supports structured recognition and output of key fields such as invoice code, invoice number, date, and invoice amount. |
| RecognizeRollTicket | Roll VAT Invoice Recognition | Supports structured recognition and output of key fields on roll invoices, including invoice code, invoice number, invoice date, invoice amount, check code, amount in uppercase, seller's tax ID, and purchaser's tax ID. |
| RecognizeBankAcceptance | Bank Acceptance Bill Recognition | Supports structured recognition and output of key fields, such as issue date, draft number, issuer information, payee information, acceptor information, and draft amount. |
| RecognizeBusShipTicket | Passenger Transport Ticket Recognition | Supports structured recognition and output of key fields such as title, invoice number, departure station, arrival station, date, and amount. |
| RecognizeNonTaxInvoice | Non-tax Revenue Invoice Recognition | Supports structured recognition and output of key fields such as invoice code, payer name, invoice number, total amount, and payee name. |
| RecognizeCommonPrintedInvoice | General Machine-printed Invoice Recognition | Supports structured recognition and output of key fields, such as invoice code, invoice number, seller name, seller tax identification number, purchaser name, purchaser tax identification number, and total amount. |
| RecognizeHotelConsume | Hotel Transaction Record Recognition | Supports structured recognition and output of key fields such as room number, check-in date, departure date, total consumption, total payment, and detailed consumption list. |
| RecognizePaymentRecord | Payment product page recognition | Supports structured recognition and output of key fields such as recipient name, total amount, payment method, product description, and payment time. |
| RecognizePurchaseRecord | E-commerce Order Page Recognition | Supports structured recognition and output of key fields, such as order number, delivery information, transaction amount, store name, and detailed product list. |
| RecognizeRideHailingItinerary | Ride-Hailing Trip Receipt Detection | Supports detection of all fields in ride-hailing trip receipts, including: service provider, applied on, start time, end time, rider's phone number, total amount, and other fields. |
| RecognizeShoppingReceipt | Receipt Recognition | Supports structured recognition and output of key fields such as the invoice issuer name, invoice date, contact number, address, and total (actual payment) amount. |
| RecognizeTollInvoice | Toll Invoice Recognition | Supports structured recognition and output of key fields such as invoice code, invoice number, amount, date, vehicle type, exit, and entrance. |
| RecognizeTaxClearanceCertificate | Tax Payment Certificate Recognition | Supports structured recognition outputs of key fields, including tax authority, taxpayer identification number, taxpayer name, total amount, ticket issuer, and tax clearance details. |
| RecognizeUsedCarInvoice | Second-hand Vehicle Unified Sales Invoice Recognition | Supports structured recognition and output of key fields including invoice code, invoice number, invoice date, invoice amount, purchaser name, and purchaser ID number. |
Business license recognition
|
API |
Title |
Description |
| RecognizeBusinessLicense | Business License Recognition | It can quickly and accurately detect key fields from enterprise business licenses, including the Unified Social Credit Code, company name, address, entity type, legal representative, registered capital, organizational form, incorporation date, business term, and business scope. It supports business licenses, private non-enterprise registration certificates, social organization legal person registration certificates, and public institution legal person certificates. |
| RecognizeBankAccountLicense | Bank Account Opening Permit Recognition | It can quickly and accurately detect key information from a bank account opening permit, such as the account number, legal representative, issuing bank, approval number, company name, and permit number. |
| RecognizeTradeMarkCertification | Trademark Registration Certificate Recognition | Quickly and accurately detects key fields in a trademark registration certificate, such as the trademark name, registrant, registrant address, validity period, and approved Data Service Project. |
| RecognizeFoodProduceLicense | Food Production License Recognition | It can quickly and accurately detect key field information contained in a food production license, such as the operator name, unified social credit code, legal representative name, address, business premises, business scope, validity period, and license number. |
| RecognizeFoodManageLicense | Food Business License Recognition | It can quickly and accurately detect key field information from a Food Operation License, including the producer name, unified social credit code, legal representative name, address, production site, food category, validity period, license number, and more. |
| RecognizeMedicalDeviceManageLicense | Medical Device Business License Recognition | Quickly and accurately detects key field information from a Medical Device Business License, including license number, company name, registered address, legal representative, enterprise owner, quality manager, warehouse address, business scope, validity period, and issuance date. |
| RecognizeMedicalDeviceProduceLicense | Medical Device Manufacturing License Recognition | Quickly and accurately detects key field information contained in medical device manufacturing licenses, such as license number, legal representative, company name, registered address, production address, production scope, responsible person, and validity period. |
| RecognizeCtwoMedicalDeviceManageLicense | Recognition of ICP Filing Credential for Class II Medical Devices | It can quickly and accurately detect key fields on the ICP filing credential for Class II medical device business operations, including the filing number, company name, registered address, business premises, warehouse address, business model, legal representative, enterprise owner, business scope, license validity period, and filing date. |
| RecognizeCosmeticProduceLicense | Cosmetics Production License Recognition | Supports detection of key fields, including certificate name, enterprise name, unified social credit code, address, legal representative, license number, and more. |
| RecognizeInternationalBusinessLicense | International Business License Recognition | This operation recognizes South Korean and Indian business licenses. It extracts key fields such as certificate type, company name, registration number, legal representative’s name, and issue date. |
Vehicle and logistics recognition
|
API |
Title |
Description |
| RecognizeVehicleLicense | Vehicle License Recognition | Supports automatic localization and recognition of key fields on both the front and back pages of a vehicle registration certificate. It also supports automatic segmentation and structured recognition when both pages appear in the same image. |
| RecognizeDrivingLicense | Driver's License Recognition | Supports structured extraction of fields such as name, license number, nationality, address, initial issue date, approved vehicle type, and validity period from a driver's license. |
| RecognizeWaybill | Electron Waybill Recognition | Supports detecting all key fields on the waybill. |
| RecognizeCarNumber | License Plate Recognition | Effectively detects vehicle license plate information. Support includes motor vehicle license plates, motorcycle license plates, and temporary license plates. |
| RecognizeCarVinCode | Vehicle VIN Code Detection | Supports detection of vehicle VIN codes. |
| RecognizeVehicleRegistration | Vehicle Registration Certificate Recognition | It can quickly and accurately detect key field information from a motor vehicle registration certificate, including certificate category, barcode, registration authority, registration date, motor vehicle registration number, and more. |
| RecognizeVehicleCertification | Vehicle Certificate Recognition | Supports structured extraction of fields such as vehicle model, Vehicle Identification Number (VIN), chassis model, and engine model. |
Education scenario recognition
|
API |
Title |
Description |
| RecognizeEduFormula | Printed Mathematical Formula Recognition | Supports detection of printed mathematical formulas. |
| RecognizeEduOralCalculation | Oral Arithmetic Grading | It can detect elementary school arithmetic problems and provide judgment results. It supports basic operations (addition, subtraction, multiplication, and division) on integers, mixed integer operations, comparisons of magnitude, identification of the maximum or minimum number, and more. |
| RecognizeEduPaperOcr | Full-page worksheet recognition | Supports full-page OCR for K12 multi-subject scanning scenarios. The API supports OCR detection of printed text and formulas, returns their coordinates, and also detects the positions of accompanying figures in questions, returning their coordinate locations. |
| RecognizeEduPaperCut | Test Paper Question Cropping Recognition | Supports structured electronic entry of supplementary exam papers across various subjects, automatically chunking questions and applying structured labeling to produce structured output for corresponding questions, stems, options, answers, and other content. |
| RecognizeEduQuestionOcr | Question Recognition | It can effectively detect questions. By tagging elements within the questions, the detection performance is enhanced. |
| RecognizeEduPaperStructed | Fine-grained Structured Question Segmentation | Support structured detection of multi-subject teaching aid test papers, automatically splitting questions from entire pages of workbooks, test papers, or teaching aids, and detecting the text content and coordinate positions within them. |
Multi-language text recognition
|
API |
Title |
Description |
| RecognizeMultiLanguage | General Multilingual Recognition | Supports automatic language categorization for major international language families and returns the corresponding textual information in the detected language. |
| RecognizeEnglish | English Composition Recognition | Designed for efficiently detecting and recognizing printed English characters in fully English image-based documents, this solution provides English-specific recognition and English tokenization features, and supports basic functionalities such as rotation handling, table detection, and text coordinate extraction. |
| RecognizeThai | Thai Recognition | Efficient Detection and recognition of Thai printed text in Thai image document scenarios, with support for multiple basic features such as rotation, tables, and text coordinates. |
| RecognizeJanpanese | Japanese Recognition | For scenarios involving fully Japanese-language image documents, this feature provides efficient Detection and recognition of printed Japanese text, and supports multiple Basic Features such as rotation, tables, and text coordinates. |
| RecognizeKorean | Korean Recognition | Efficiently detects and recognizes Korean printed text in Korean image document scenarios, and supports multiple basic features such as rotation, tables, and text coordinates. |
| RecognizeLatin | Latin Text Recognition | Efficient detection and recognition of printed text in image documents for Latin-script scenarios, supporting multiple basic features such as rotation, tables, and text coordinates. |
| RecognizeRussian | Russian Recognition | Provides efficient Detection and recognition of Russian printed text in Image document scenarios, with Support for multiple Basic Features such as rotation, tables, and text coordinates. |
Medical scenario recognition
|
API |
Title |
Description |
| RecognizeCovidTestReport | COVID-19 Testing Report Recognition | Supports structured output of six key fields—name, certificate number, sampling date, sampling time, testing organization, and test result—from COVID-19 Testing Station records with varying formats across different regions nationwide. |
Document verification
|
API |
Title |
Description |
| VerifyBusinessLicense | Business License Verification | The business license verification service checks for consistency across three key elements: the Unified Social Credit Code (or business registration number), the company name, and the legal representative's name. |
| VerifyVATInvoice | Invoice Verification | The VAT invoice verification API supports multiple invoice types, such as VAT special invoices, VAT ordinary invoices (folded), VAT ordinary invoices (roll), electronic VAT ordinary invoices (including electronic VAT ordinary invoices for expressway toll fees), unified motor vehicle sales invoices, and unified second-hand vehicle sales invoices. You can enter key invoice fields to retrieve the actual invoice details, including invoice type, invoice code, invoice number, cancellation flag, issue date, buyer’s tax ID, and other invoice information. You can verify invoices issued on the same day (T+0). Note: Verification may be delayed by several hours to over ten hours. |