
| 接口编号: 521 | 接口名称: 银行联行号查询 | 连接应用: 8126个 |
| 应用编号: 521001 | 应用标识: cnaps.query | 服务商: NowAPI |
说明
可精准查询国内所有银行跨区域支付结算业务联行号现代化支付行号相关信息。 扣费扣量特别说明(扣量: 包月套餐扣可用配额次数,流量包套餐扣可用次数) 1. result.dtCount 值等于数据条数,1:1扣量,比如该值为50,相应会的扣除套餐可用次数50次(非调用1次扣量1次)。 测试示例: https://sapi.k780.com/?app=cnaps.query&bank=%E4%B8%AD%E5%9B%BD%E5%B7%A5%E5%95%86%E9%93%B6%E8%A1%8C&province=%E5%B9%BF%E4%B8%9C%E7%9C%81&city=%E4%B8%AD%E5%B1%B1%E5%B8%82&keyword=%E4%B8%89%E4%B9%A1%E6%96%87%E6%98%8C&appkey=10003&sign=b59bc3ef6191eb9f747dd4e83c99f2a4&format=json (示例中sign会不定期调整)
请求网址
HTTP: http://api.k780.com
HTTPS: https://sapi.k780.com
请求方式
Post/Get
请求Header
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
请求参数
| 参数 | 类型 | 是否必须 | 备注 |
|---|---|---|---|
| app | string | 是 | 固定值 cnaps.query |
| bank | string | 是 | 银行名称 银行列表下载 |
| province | string | 是 | 所在省份 省份列表下载 |
| city | string | 是 | 所在城市 城市列表下载 |
| keyword | string | 否 | 搜索关键词 |
| appkey | string | 是 | 使用API的唯一凭证 获取 |
| sign | string | 是 | md5后的32位密文,登陆用. 获取 |
| format | {json|xml} | 否 | 返回数据格式 |
Json请求示例
https://sapi.k780.com/?app=cnaps.query&bank=中国工商银行&province=广东省&city=中山市&keyword=三乡&appkey=10003&sign=b59bc3ef6191eb9f747dd4e83c99f2a4&format=json
Json返回示例
1. 查询成功
{
"success": "1",
"result": {
"dtQuery": "中国工商银行,广东省,珠海市",
"dtCount": "49", //数据条数等于扣量次数
"dtAppend": "",
"dtList": [
{
"bankNameMain": "中国工商银行",
"bankNameBranch": "中国工商银行股份有限公司横琴粤澳深度合作区琴海支行",
"areaProvince": "广东省",
"areaCity": "珠海市",
"cnapsCode": "102585000012"
},
{
"bankNameMain": "中国工商银行",
"bankNameBranch": "中国工商银行股份有限公司珠海保税区支行",
"areaProvince": "广东省",
"areaCity": "珠海市",
"cnapsCode": "102585000037"
},
{
"bankNameMain": "中国工商银行",
"bankNameBranch": "中国工商银行股份有限公司珠海海岸支行",
"areaProvince": "广东省",
"areaCity": "珠海市",
"cnapsCode": "102585000045"
},
{
"bankNameMain": "中国工商银行",
"bankNameBranch": "中国工商银行股份有限公司珠海华发支行",
"areaProvince": "广东省",
"areaCity": "珠海市",
"cnapsCode": "102585002018"
...
2.系统级别错误(无数据/处理异常等)
{
"success":"0",
"msgid":"消息ID",
"msg":"消息实体"
}示例代码
<?php
header("Content-Type:text/html;charset=UTF-8");
function nowapiRequest($postData,&$errMsg=''){
$apiUrl = 'https://sapi.k780.com/';
$useContext = stream_context_create(array(
'http' => array(
'method' => 'POST',
'header' => 'Content-type:application/x-www-form-urlencoded',
'content' => http_build_query($postData)
)
));
if(!$resData=file_get_contents($apiUrl,false,$useContext)){
$errMsg = 'ERR_CONNECT';
return false;
}
if(!$arrData=json_decode($resData,true)){
$errMsg = 'ERR_DECODE';
return false;
}
if($arrData['success']!=1){
$errMsg = $arrData['msgid'].' '.$arrData['msg'];
return false;
}
return $arrData['result'];
}
$postData['app'] = 'cnaps.query';
$postData['bank'] = '中国工商银行';
$postData['province'] = '广东省';
$postData['city'] = '中山市';
$postData['keyword'] = '三乡';
$postData['appkey'] = '10003';//替换成自己的appkey
$postData['sign'] = 'b59bc3ef6191eb9f747dd4e83c99f2a4';//替换成自己的sign
$postData['format'] = 'json';
$result = nowapiRequest($postData,$errMsg);
print_r($errMsg);
print_r($result);
#python
import json,urllib
from urllib import urlencode
url = 'http://api.k780.com'
params = {
'app' : 'cnaps.query',
'bank' : '中国工商银行',
'province' : '广东省',
'city' : '中山市',
'keyword' : '三乡',
'appkey' : '10003',
'sign' : 'b59bc3ef6191eb9f747dd4e83c99f2a4',
'format' : 'json',
}
params = urlencode(params)
f = urllib.urlopen('%s?%s' % (url, params))
nowapi_call = f.read()
#print content
a_result = json.loads(nowapi_call)
if a_result:
if a_result['success'] != '0':
print a_result['result'];
else:
print a_result['msgid']+' '+a_result['msg']
else:
print 'Request nowapi fail.';
import java.net.*;
import java.io.*;
public class test{
public static void main(String args[]) throws Exception {
URL u=new URL("https://sapi.k780.com/?app=cnaps.query&bank=中国工商银行&province=广东省&city=中山市&keyword=三乡&appkey=10003&sign=b59bc3ef6191eb9f747dd4e83c99f2a4&format=json");
InputStream in=u.openStream();
ByteArrayOutputStream out=new ByteArrayOutputStream();
try {
byte buf[]=new byte[1024];
int read = 0;
while ((read = in.read(buf)) > 0) {
out.write(buf, 0, read);
}
} finally {
if (in != null) {
in.close();
}
}
byte b[]=out.toByteArray( );
System.out.println(new String(b,"utf-8"));
}
}
curl "https://sapi.k780.com/?app=cnaps.query&bank=中国工商银行&province=广东省&city=中山市&keyword=三乡&appkey=10003&sign=b59bc3ef6191eb9f747dd4e83c99f2a4&format=json"
流量包套餐说明:
买多少用多少,多买有优惠,10元起买,适合大多数应用场景.
| 规格 | 套餐名称 | 价格 | 描述 |
|---|---|---|---|
| 201 | 流量包 5000 次 | 10 元 | - |
| 202 | 流量包 52500 次 | 100 元 | 约 0.00190 元/次 |
| 203 | 流量包 106000 次 | 200 元 | 约 0.00189 元/次 |
| 204 | 流量包 160500 次 | 300 元 | 约 0.00187 元/次 |
| 205 | 流量包 272500 次 | 500 元 | 约 0.00183 元/次 |
免费试用套餐说明:
商用请选择付费套餐。 (系统繁忙或极端情况下,优先保证付费用户使用).
| 规格 | 套餐名称 | 价格 | 描述 |
|---|---|---|---|
| 0 | 试用套餐 50 次/每小时 | 0 元/月 | 可免费试用3个月,延长试用或次数不够可联系客服增加 |