<?php
require_once 'curl.func.php';
$appkey = 'your_appkey_here';//你的appkey
$shouji = '13456755448';
$url = "https://api.binstd.com/shouji/query?appkey=$appkey&shouji=$shouji";
$result = curlOpen($url, ['ssl'=>true]);
$jsonarr = json_decode($result, true);
//exit(var_dump($jsonarr));
if($jsonarr['status'] != 0)
{
echo $jsonarr['msg'];
exit();
}
$result = $jsonarr['result'];
echo $result['province'].' '.$result['city'].' '.$result['company'].' '.$result['cardtype'].'
';
#!/usr/bin/python
# encoding:utf-8
import urllib2, json, urllib
# 1、区号查询
data = {}
data["appkey"] = "your_appkey_here"
data["shouji"] = "13456755448"
url_values = urllib.urlencode(data)
url = "https://api.binstd.com/shouji/query" + "?" + url_values
request = urllib2.Request(url)
result = urllib2.urlopen(request)
jsonarr = json.loads(result.read())
if jsonarr["status"] != u"0":
print jsonarr["msg"]
exit()
result = jsonarr["result"]
print result["province"],result["city"],result["company"],result["cardtype"]
package api.binstd.shouji;
import api.util.HttpUtil;
import net.sf.json.JSONObject;
public class Query {
public static final String APPKEY = "your_appkey_here";// 你的appkey
public static final String URL = "https://api.binstd.com/shouji/query";
public static final String shouji = "13456755448";
public static void Get() {
String result = null;
String url = URL + "?appkey=" + APPKEY + "&shouji=" + shouji;
try {
result = HttpUtil.sendGet(url, "utf-8");
JSONObject json = JSONObject.fromObject(result);
if (json.getInt("status") != 0) {
System.out.println(json.getString("msg"));
} else {
JSONObject resultarr = json.optJSONObject("result");
String province = resultarr.getString("province");
String city = resultarr.getString("city");
String company = resultarr.getString("company");
String cardtype = resultarr.getString("cardtype");
System.out.println(province + " " + city + " " + company + " " + cardtype);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}