文档中心
API调试

功能描述

印尼身份证识别接口

请求URL

https://api.textin.com/ai/service/v1/indonesia_id_card

HTTP请求方法(Method)

HTTP POST

请求头说明(Request Headers)

请在HTTP请求中添加以下自定义标头(Header)。

header 名
x-ti-app-id 请登录后前往 “工作台-账号设置-开发者信息” 查看 x-ti-app-id
x-ti-secret-code 请登录后前往 “工作台-账号设置-开发者信息” 查看 x-ti-secret-code

URL参数(Parameters)

URL参数指以 {参数名}={参数值} 形式拼接到 URL 上的键值对。它以 ? 开头,不同参数之间使用 & 连接。形如 ?p1=v1&p2=v2
参数名 数据类型 是否必填 允许的值 描述
head_portrait integer 1, 0

是否返回头像切图base64码,1为是,0为否, 默认为1

请求体说明(Request Body)

支持以下两种请求格式

1. Content-Type: application/octet-stream

要上传的图片,目前支持jpg, png, bmp, pdf, pdf第一页, 单帧gif等大部分格式

请注意,请求体的数据格式为本地文件的二进制流,非 FormData 或其他格式。文件大小不超过 10M,图像宽高须介于 20 和 10000(像素)之间。

2. Content-Type: text/plain

请求体的数据格式为文本,内容为在线文件的URL链接(支持http以及https协议)。在线文件大小不超过 10M,图像宽高须介于 20 和 10000(像素)之间。

响应体说明 (Response)

Content-Type: application/json

JSON结构说明如下:

字段名 类型 描述
code integer 错误码,详见“错误码说明”
message string

错误信息

duration integer

识别耗时(ms)

result object
+ rotated_image_width integer

正方向时图片的宽

+ rotated_image_height integer

正方向时图片高

+ image_angle integer

图片角度,指原图需要经过顺时针旋转多少度,才能得到正方向的图片

+ details object

图片OCR识别结果

   ++ nik object

证件号码

    +++ value string

字段识别结果

    +++ position array

识别的value在正方向的图中的坐标,是个长度为8的数组 [0,1,2,3,4,5,6,7]

  • (0, 1) 左上角坐标
  • (2, 3) 右上角坐标
  • (4, 5) 右下角坐标
  • (6, 7) 左下角坐标
    +++ description string

字段描述

   ++ nama object

姓名

    +++ value string

字段识别结果

    +++ position array

识别的value在正方向的图中的坐标,是个长度为8的数组 [0,1,2,3,4,5,6,7]

  • (0, 1) 左上角坐标
  • (2, 3) 右上角坐标
  • (4, 5) 右下角坐标
  • (6, 7) 左下角坐标
    +++ description string

字段描述

   ++ tempat_tgl_lahir object

出生地/出生时间

    +++ value string

字段识别结果

    +++ position array

识别的value在正方向的图中的坐标,是个长度为8的数组 [0,1,2,3,4,5,6,7]

  • (0, 1) 左上角坐标
  • (2, 3) 右上角坐标
  • (4, 5) 右下角坐标
  • (6, 7) 左下角坐标
    +++ description string

字段描述

   ++ jenis_kelamin object

性别

    +++ value string

字段识别结果

    +++ position array

识别的value在正方向的图中的坐标,是个长度为8的数组 [0,1,2,3,4,5,6,7]

  • (0, 1) 左上角坐标
  • (2, 3) 右上角坐标
  • (4, 5) 右下角坐标
  • (6, 7) 左下角坐标
    +++ description string

字段描述

   ++ gol_darah object

血型

    +++ value string

字段识别结果

    +++ position array

识别的value在正方向的图中的坐标,是个长度为8的数组 [0,1,2,3,4,5,6,7]

  • (0, 1) 左上角坐标
  • (2, 3) 右上角坐标
  • (4, 5) 右下角坐标
  • (6, 7) 左下角坐标
    +++ description string

字段描述

   ++ alamat object

地址

    +++ value string

字段识别结果

    +++ position array

识别的value在正方向的图中的坐标,是个长度为8的数组 [0,1,2,3,4,5,6,7]

  • (0, 1) 左上角坐标
  • (2, 3) 右上角坐标
  • (4, 5) 右下角坐标
  • (6, 7) 左下角坐标
    +++ description string

字段描述

   ++ rt_rw object

街道

    +++ value string

字段识别结果

    +++ position array

识别的value在正方向的图中的坐标,是个长度为8的数组 [0,1,2,3,4,5,6,7]

  • (0, 1) 左上角坐标
  • (2, 3) 右上角坐标
  • (4, 5) 右下角坐标
  • (6, 7) 左下角坐标
    +++ description string

字段描述

   ++ kel_desa object

    +++ value string

字段识别结果

    +++ position array

识别的value在正方向的图中的坐标,是个长度为8的数组 [0,1,2,3,4,5,6,7]

  • (0, 1) 左上角坐标
  • (2, 3) 右上角坐标
  • (4, 5) 右下角坐标
  • (6, 7) 左下角坐标
    +++ description string

字段描述

   ++ kecamatan object

地区

    +++ value string

字段识别结果

    +++ position array

识别的value在正方向的图中的坐标,是个长度为8的数组 [0,1,2,3,4,5,6,7]

  • (0, 1) 左上角坐标
  • (2, 3) 右上角坐标
  • (4, 5) 右下角坐标
  • (6, 7) 左下角坐标
    +++ description string

字段描述

   ++ agama object

宗教信仰

    +++ value string

字段识别结果

    +++ position array

识别的value在正方向的图中的坐标,是个长度为8的数组 [0,1,2,3,4,5,6,7]

  • (0, 1) 左上角坐标
  • (2, 3) 右上角坐标
  • (4, 5) 右下角坐标
  • (6, 7) 左下角坐标
    +++ description string

字段描述

   ++ status_perkawinan object

婚姻状况

    +++ value string

字段识别结果

    +++ position array

识别的value在正方向的图中的坐标,是个长度为8的数组 [0,1,2,3,4,5,6,7]

  • (0, 1) 左上角坐标
  • (2, 3) 右上角坐标
  • (4, 5) 右下角坐标
  • (6, 7) 左下角坐标
    +++ description string

字段描述

   ++ pekerjaan object

工作说明

    +++ value string

字段识别结果

    +++ position array

识别的value在正方向的图中的坐标,是个长度为8的数组 [0,1,2,3,4,5,6,7]

  • (0, 1) 左上角坐标
  • (2, 3) 右上角坐标
  • (4, 5) 右下角坐标
  • (6, 7) 左下角坐标
    +++ description string

字段描述

   ++ kewarganegaraan object

国籍

    +++ value string

字段识别结果

    +++ position array

识别的value在正方向的图中的坐标,是个长度为8的数组 [0,1,2,3,4,5,6,7]

  • (0, 1) 左上角坐标
  • (2, 3) 右上角坐标
  • (4, 5) 右下角坐标
  • (6, 7) 左下角坐标
    +++ description string

字段描述

   ++ berlaku_hingga object

身份证有效期限

    +++ value string

字段识别结果

    +++ position array

识别的value在正方向的图中的坐标,是个长度为8的数组 [0,1,2,3,4,5,6,7]

  • (0, 1) 左上角坐标
  • (2, 3) 右上角坐标
  • (4, 5) 右下角坐标
  • (6, 7) 左下角坐标
    +++ description string

字段描述

   ++ provinsi object

    +++ value string

字段识别结果

    +++ position array

识别的value在正方向的图中的坐标,是个长度为8的数组 [0,1,2,3,4,5,6,7]

  • (0, 1) 左上角坐标
  • (2, 3) 右上角坐标
  • (4, 5) 右下角坐标
  • (6, 7) 左下角坐标
    +++ description string

字段描述

   ++ city object

城市

    +++ value string

字段识别结果

    +++ position array

识别的value在正方向的图中的坐标,是个长度为8的数组 [0,1,2,3,4,5,6,7]

  • (0, 1) 左上角坐标
  • (2, 3) 右上角坐标
  • (4, 5) 右下角坐标
  • (6, 7) 左下角坐标
    +++ description string

字段描述

   ++ issue_date object

发证日期

    +++ value string

字段识别结果

    +++ position array

识别的value在正方向的图中的坐标,是个长度为8的数组 [0,1,2,3,4,5,6,7]

  • (0, 1) 左上角坐标
  • (2, 3) 右上角坐标
  • (4, 5) 右下角坐标
  • (6, 7) 左下角坐标
    +++ description string

字段描述

   ++ head_portrait object

头像切图

    +++ value string

字段识别结果

    +++ position array

识别的value在正方向的图中的坐标,是个长度为8的数组 [0,1,2,3,4,5,6,7]

  • (0, 1) 左上角坐标
  • (2, 3) 右上角坐标
  • (4, 5) 右下角坐标
  • (6, 7) 左下角坐标
    +++ description string

字段描述

    +++ description
    +++ value

切图的base64编码

+ type string

当前接口类型, 当为other的时候,代表无法识别的图片

  • indonesia_id_card: 印尼身份证
  • other: 其他
+ category object
   ++ DETAILS_KEY1 string

details 下字段的类型,DETAILS_KEY1 为 details 下的同名字段, 其值有以下三种类型

  • one_to_one: 只有单个值
  • one_to_many: 有多个值
  • item_list: 表格类型
   ++ DETAILS_KEY2 string

说明见 DETAILS_KEY1

   ++ DETAILS_KEY3 string

说明见 DETAILS_KEY1

JSON结构示例

{"code":200,"message":"success","duration":28,"result":{"rotated_image_width":1000,"rotated_image_height":2000,"image_angle":90,"details":{"nik":{"value":"字段识别结果","position":[100,200,200,200,300,200,100,300],"description":"结构化结果字段描述"},"nama":{"value":"字段识别结果","position":[100,200,200,200,300,200,100,300],"description":"结构化结果字段描述"},"tempat_tgl_lahir":{"value":"字段识别结果","position":[100,200,200,200,300,200,100,300],"description":"结构化结果字段描述"},"jenis_kelamin":{"value":"字段识别结果","position":[100,200,200,200,300,200,100,300],"description":"结构化结果字段描述"},"gol_darah":{"value":"字段识别结果","position":[100,200,200,200,300,200,100,300],"description":"结构化结果字段描述"},"alamat":{"value":"字段识别结果","position":[100,200,200,200,300,200,100,300],"description":"结构化结果字段描述"},"rt_rw":{"value":"字段识别结果","position":[100,200,200,200,300,200,100,300],"description":"结构化结果字段描述"},"kel_desa":{"value":"字段识别结果","position":[100,200,200,200,300,200,100,300],"description":"结构化结果字段描述"},"kecamatan":{"value":"字段识别结果","position":[100,200,200,200,300,200,100,300],"description":"结构化结果字段描述"},"agama":{"value":"字段识别结果","position":[100,200,200,200,300,200,100,300],"description":"结构化结果字段描述"},"status_perkawinan":{"value":"字段识别结果","position":[100,200,200,200,300,200,100,300],"description":"结构化结果字段描述"},"pekerjaan":{"value":"字段识别结果","position":[100,200,200,200,300,200,100,300],"description":"结构化结果字段描述"},"kewarganegaraan":{"value":"字段识别结果","position":[100,200,200,200,300,200,100,300],"description":"结构化结果字段描述"},"berlaku_hingga":{"value":"字段识别结果","position":[100,200,200,200,300,200,100,300],"description":"结构化结果字段描述"},"provinsi":{"value":"字段识别结果","position":[100,200,200,200,300,200,100,300],"description":"结构化结果字段描述"},"city":{"value":"字段识别结果","position":[100,200,200,200,300,200,100,300],"description":"结构化结果字段描述"},"issue_date":{"value":"字段识别结果","position":[100,200,200,200,300,200,100,300],"description":"结构化结果字段描述"},"head_portrait":{"value":"/9j/4AAQSkZJRgABA...","position":[100,200,200,200,300,200,100,300],"description":"头像切图"}},"type":"other","category":{"DETAILS_KEY1":"one_to_one","DETAILS_KEY2":"one_to_many","DETAILS_KEY3":"item_list"}}}

错误码说明

错误码 描述
40101 x-ti-app-id 或 x-ti-secret-code 为空
40102 x-ti-app-id 或 x-ti-secret-code 无效,验证失败
40103 客户端IP不在白名单
40003 余额不足,请充值后再使用
40004 参数错误,请查看技术文档,检查传参
40007 机器人不存在或未发布
40008 机器人未开通,请至市场开通后重试
40301 图片类型不支持
40302 上传文件大小不符,文件大小不超过 10M
40303 文件类型不支持
40304 图片尺寸不符,图像宽高须介于 20 和 10000(像素)之间
40305 识别文件未上传
40400 无效的请求链接,请检查链接是否正确
30203 基础服务故障,请稍后重试
500 服务器内部错误
人工咨询
技术交流群

联系我们