Access Documentation
OCR
Other IDs & Docs
Other IDs & Docs OCR API
Other IDs & Docs OCR API

# Description

Intelligently extract structured data from various general and non-standard ID documents, credit verification files, and other KYC-related documents via OCR.

# Invoke URL

https://api-sgp.yljz.com/finauth/v1/anydoc

WARNING:Please use HTTPS protocol for connections in production environments. HTTP protocol has safety risk due to lack of encryption; therefore, using HTTP may not guarantee service reliability.

# Invoke Method

POST  WARNING:please use "form-data" format to request.

API description

When calling the API, pass the encrypted signature (sign) generated with your apikey and secret, along with the document to be recognized. The API returns the structured recognition result.

Each document type uses a different app_id. Supported file formats, such as PDF or images, and the number of files allowed, single or multiple, may vary by app_id. For details, see the IDs & documents list(#app-list).

# Parameters

Required/Optional Parameter Type Description
Required sign String The encrypted signature generated by the client using their apikey and secret. See Authentication for details.
sign_version String Signature algorithm version. Pass hmac_sha1.
app_id String A unique ID representing the document type. See IDs & Documents List for available app_id values.
file File or File[] The document(s) to be recognized. Total size must not exceed 10 MB. Supported formats and the number of files allowed vary by app_id. Supported image formats: .jpg, .jpeg, .png, .gif, .webp. See IDs & Documents List for details.
Optional file_url Array of String URL(s) of the document(s) to recognize. Either file or file_url must be provided, not both. Supported formats and file count depend on the app_id. Example: ["https://xxx/8e013.jpeg", "https://xxx/8e014.jpeg"]. See IDs & Documents List.
inputs JSON String Additional parameters beyond the document itself. Most app_ids do not support this. Example: 'inputs': json.dumps({"key1":"value1","key2":"value2"}). See IDs & Documents List.

# Response

Field Type Description
request_id String A unique string that identifies each request. This field is returned in all cases except 404 API_NOT_FOUND or 403 AUTHORIZATION_ERROR.
time_used Int Total processing time for the request, in milliseconds. This field is always returned.
result Object The document recognition result. The response structure and fields may vary by app_id and document type. See IDs & Documents List for details.
+result.outputs JSON The extracted recognition result is always returned under outputs.text.
+result.pages Int The number of billable pages consumed by the request. The final cost is calculated as pages × unit price. For example, a single image returns 1, while a multi-page PDF returns the actual number of PDF pages, except when only a fixed number of pages is processed.
error_message String The error code returned when the request fails. See ERROR Messages below for details.

# IDs & Documents List

ID&Document Type app_id File Format Number of Files Recognition Result
Timor-Leste IDs builtin-6UOFfK0g1gMvgCHx19 Image 1 View Details

# Recognition Result

# Timor-Leste IDs

Supports recognition of four document types from Timor-Leste: Citizen/ID card, passport, driver’s license, and voter card. The returned fields vary by document type, but all responses include the cardType field.

Document Type Field Name Type Description Example
CITIZEN_CARD cardType string Document type. Always returns CITIZEN_CARD. CITIZEN_CARD
CITIZEN_CARD no string Citizen card number, usually corresponding to No BI / Card No, No BI, or Card No. 0600506125463002
CITIZEN_CARD name string Cardholder’s full name, usually corresponding to Nome do Titular / Full Name. MARIA DA SILVA
CITIZEN_CARD marital string Marital status, usually corresponding to Estado Civil / Marital Status. CASADO
CITIZEN_CARD gender string Cardholder’s gender. Possible values: M, F. F
CITIZEN_CARD height string Height without unit. 155
CITIZEN_CARD dob string Date of birth in YYYY-MM-DD format. 1990-05-12
CITIZEN_CARD pob string Place of birth, usually corresponding to Naturalidade / Place of Birth. DILI
CITIZEN_CARD nationality string Nationality, usually corresponding to Nacionalidade / Nationality. TIMORENSE
CITIZEN_CARD fatherName string Father’s name. If the parents’ names are not clearly distinguished, this is usually extracted from the first line of the parent information. JOSE DA SILVA
CITIZEN_CARD motherName string Mother’s name. If the parents’ names are not clearly distinguished, this is usually extracted from the second line of the parent information. ANA MARIA
CITIZEN_CARD address string Residential address, usually corresponding to Residência / Address. DILI, TIMOR-LESTE
CITIZEN_CARD issDate string Date of issue in YYYY-MM-DD format. 2020-01-15
CITIZEN_CARD expiryDate string Expiry date in YYYY-MM-DD format. 2030-01-15
DRIVING_LICENSE cardType string Document type. Always returns DRIVING_LICENSE. DRIVING_LICENSE
DRIVING_LICENSE no string Driver’s license number or card number, usually corresponding to fields such as No CC. 03029/DNTT/C/IV/09
DRIVING_LICENSE name string Cardholder’s full name. JOAO PEREIRA
DRIVING_LICENSE nationality string Nationality or place-of-birth information shown on the document. Returned as displayed. TIMOR-LESTE
DRIVING_LICENSE dob string Date of birth in YYYY-MM-DD format. 1988-03-20
DRIVING_LICENSE address string Cardholder’s address, usually corresponding to Morada. DILI
DRIVING_LICENSE gender string Cardholder’s gender. Possible values: M, F. M
DRIVING_LICENSE eyes string Eye color, usually corresponding to Olhos. Castanhos
DRIVING_LICENSE height string Height as displayed on the document, without unit. 180
DRIVING_LICENSE blood string Blood type, usually corresponding to G. Sanguineo. O
DRIVING_LICENSE issDate string Date of issue in YYYY-MM-DD format. 2016-04-10
DRIVING_LICENSE expiryDate string Expiry date in YYYY-MM-DD format. 2026-04-10
PASSPORT cardType string Document type. Always returns PASSPORT. PASSPORT
PASSPORT country string Issuing country code in ISO 3166-1 alpha-3 format. TLS
PASSPORT Type string Passport type code, such as ordinary passport or diplomatic passport. P
PASSPORT no string Passport number. P1234567
PASSPORT surname string Holder’s surname or family name, returned as displayed on the passport. GUTERRES
PASSPORT givenName string Holder’s given name, returned as displayed on the passport. JOSE
PASSPORT nationality string Nationality, returned as displayed on the passport. TIMORESE
PASSPORT dob string Date of birth in YYYY-MM-DD format. 1990-06-15
PASSPORT sex string Holder’s sex. Possible values: M, F. M
PASSPORT pob string/null Place of birth, returned as displayed on the passport. Returns null if not shown. DILI
PASSPORT issDate string Date of issue in YYYY-MM-DD format. 2021-05-01
PASSPORT expiryDate string Expiry date in YYYY-MM-DD format. 2031-05-01
PASSPORT issAuthority string/null Issuing authority. Returns null if not shown. MINISTRY OF JUSTICE
PASSPORT line1 string First MRZ line, usually starting with P<. P<TLSGUTERRES<<JOSE<<<<<<<<<<<<<<<<
PASSPORT line2 string Second MRZ line, containing the passport number, nationality, date of birth, expiry date, and other information. P1234567<TLS9006151M3105012<<<<<<<<
VOTER_CARD cardType string Document type. Always returns VOTER_CARD. VOTER_CARD
VOTER_CARD cardNo string Voter card number, usually corresponding to fields such as Nú Cartão, No. Cartão, or Nú. Kartaun. 123456
VOTER_CARD regNo string Registration number or document number, usually corresponding to fields such as Nú De Inscrição, No. Doc, or Nú. Dok. 987654321
VOTER_CARD name string Cardholder’s full name, usually corresponding to Nome / Naran. JOAO DA COSTA
VOTER_CARD dob string Date of birth in YYYY-MM-DD format. 1995-08-10
VOTER_CARD pob string Place of birth, usually corresponding to Naturalidade / Moris Fatin. BAUCAU
VOTER_CARD municipality string Municipality, usually corresponding to Município. DILI
VOTER_CARD post string Administrative post, usually corresponding to Posto Adm.. DOM ALEIXO
VOTER_CARD suco string Suku/Suco, the village or local administrative area. COMORO
VOTER_CARD aldeia string Aldeia, the local residential area. 30 DE AGOSTO

# Success Response

HTTP Status Code Message Description
200 Success The API call was successful. result.pages indicates the number of billable pages for this request. Billing applies only when result.pages is a positive integer. For images, pages is usually 1; for PDFs, pages is calculated based on the actual number of pages processed.

# Error Messages

HTTP Status Code Error Message Description
400 BAD_ARGUMENTS: <key> One of the parameters is invalid or cannot be parsed (e.g., BAD_ARGUMENTS:app_id when a non-existent app_id is provided).
400 FILE_PARSE_FAILED:<reason> Failed during file download stage.
400 FILE_EXTRACT_FAILED:<reason> Failed during document recognition stage.
400 INVALID_INPUTS_PARAM:<reason> The inputs parameter is invalid or malformed.
400 FILE_TOO_LARGE File exceeds the size limit; recommended under 9 MB.
400 FILE_UNSUPPORTED_FORMAT File format is not supported.
400 TOO_MANY_FILES More files were provided than supported by the API.
400 MISSING_ARGUMENTS: <key> A required parameter is missing.
400 KEY_NOT_FOUND Encryption is enabled (encryption_type), but the encryption public key or decryption private key is not configured.
403 AUTHENTICATION_ERROR The provided api_key and api_secret do not match.
403 AUTHORIZATION_ERROR:<reason> The api_key is disabled, exceeded usage limits, lacks permission to call this API, or does not have permission for the current call method. Examples: "DENIED." — api_key disabled or no permission; "Limit reached." — api_key has reached the call limit for this API.
403 CONCURRENCY_LIMIT_EXCEEDED The number of concurrent requests exceeds the limit.
403 AUTHENTICATION_ERROR: NO_APP_PERMISSION The app does not have permission to call this API.
404 API_NOT_FOUND The requested API endpoint does not exist.
500 INTERNAL_ERROR Internal server error. Retry the request. If the error persists, contact FaceID support or your account manager.