开户行查询 API 接入文档 v1

接口地址

请求方式:POST

https://www.du21.cc/index/api/v1

请求参数

参数名 类型 必填 说明
key string 是 用户的API Key,在网站登录后通过"我的API"获取
bankcard string 是 银行卡号,每次只能查询一个卡号(12-25位数字)

返回参数

参数名 类型 说明
code int 状态码,1表示成功,0表示失败
msg string 提示信息
data object 查询结果(成功时返回)
data.cardType string 卡类型(如:借记卡)
data.name string 开户分行名称
data.cnaps string 开户行联行号

请求示例

cURL

curl -X POST https://www.du21.cc/index/api/v1 \
  -d "key=您的API_KEY" \
  -d "bankcard=6217000170006318989"

PHP

$ch = curl_init();
curl_setopt_array($ch, [
    CURLOPT_URL => 'https://www.du21.cc/index/api/v1',
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => http_build_query([
        'key' => '您的API_KEY',
        'bankcard' => '6217000170006318989',
    ]),
    CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
print_r($result);

Python

import requests

url = "https://www.du21.cc/index/api/v1"
data = {
    "key": "您的API_KEY",
    "bankcard": "6217000170006318989"
}
resp = requests.post(url, data=data)
result = resp.json()
print(result)

成功响应示例

{
  "code": 1,
  "msg": "成功",
  "data": {
    "cardType": "借记卡",
    "name": "中国建设银行股份有限公司张家口分行",
    "cnaps": "105138000014"
  }
}

失败响应示例

{
  "code": 0,
  "msg": "余额不足"
}
注意事项:
← 返回银行卡开户行批量查询工具