Updated on 2023-12-04 GMT+08:00

OCR SDK Overview

SDK Introduction

Optical Character Recognition (OCR) detects and extracts text from images or scanned copies and converts the text into an editable format, freeing you from burdensome manual input while improving the efficiency of your business.

OCR provides services through open APIs. You can obtain inference results by accessing and calling APIs in real time, significantly improving the efficiency of your business.

OCR SDK encapsulates RESTful APIs provided by OCR to simplify development. You can directly call API functions provided by OCR SDKs to use OCR.

The developer guides for SDKs in various programming languages are as follows:

Table 1 Developer guides for SDKs in various programming languages

Programming Language

Developer Guide

Java

Java SDK Developer Guide

Python

Python SDK Developer Guide

Node.js

Node.js SDK Developer Guide

PHP

PHP SDK Developer Guide

C++

C++ SDK Developer Guide

Go

Go SDK Developer Guide

NET

NET SDK Developer Guide

Automatic Generation of Sample SDK Code

API Explorer supports quick search of all APIs, visual platform debugging, help document viewing, and online consultation.

You only need to modify API parameters in the API Explorer to automatically generate the corresponding sample code. In addition, you can build, debug, and run code in CloudIDE.

Figure 1 API Explorer

Mapping Between Services and APIs

Table 2 lists the mappings between OCR services and APIs.

Table 2 Mapping between services and APIs

Service

API

ID Document

POST /v2/{project_id}/ocr/id-document

General Table

POST /v2/{project_id}/ocr/general-table

General Text

POST /v2/{project_id}/ocr/general-text

Web Image

POST /v2/{project_id}/ocr/web-image

Passport

POST /v2/{project_id}/ocr/passport

Thailand ID Card

POST /v2/{project_id}/ocr/thailand-id-card

Cambodian ID Card

POST /v2/{project_id}/ocr/cambodian-idcard

Myanmar ID Card

POST /v2/{project_id}/myanmar-id-card

Myanmar Driving License

POST /v2/{project_id}/ocr/myanmar-driver-license

Chile ID Card

POST /v2/{project_id}/ocr/chile-id-card

Vietnam ID Card

POST /v2/{project_id}/ocr/vietnam-id-card

Thailand Plate Number

POST /v2/{project_id}/ocr/thailand-license-plate

Hong Kong ID Card

POST /v2/{project_id}/ocr/hk-id-card

Macao Resident ID Card

POST /v2.0/{project_id}/ocr/macao-id-card

Exit-Entry Permit for Traveling to and from Hong Kong, Macao, and Taiwan

POST /v2/{project_id}/ocr/exit-entry-permit

Mainland Travel Permit for Hong Kong, Macao, and Taiwan Residents

POST /v2/{project_id}/ocr/mainland-travel-permit