API接口概述与并发限制
该API接口自 2011年 SAE平台上线稳定运行至今,增加了17号段的支持,欢迎各种采集注限制 并发10
具体操作指南如下。
服务入口URL为:http://appyun.sinaapp.com/index.php?app=mobile&controller=index&action=api
数据传输采用GET协议。
主要涉及以下请求参数配置:
| 参数名 | 类型 | 必填 | 位置 | 描述 | 默认值 | |---|---|---|---|---|---| | app | string | 是 | urlParam | 模块名称(固定) | mobile | | controller | string | 是 | urlParam | 控制器名称 | index | | action | string | 是 | urlParam | 动作名称 | api | | mobile | string | 是 | urlParam | 手机号或号段 | 13800138000 | | outfmt | string | 是 | urlParam | 输出格式 | json | 调用范例:
http://appyun.sinaapp.com/index.php?app=mobile&controller=index&action=api&outfmt=json&mobile=13800138000
系统返回的JSON数据结构示例:
{
"id":"80012",
"Mobile":"13800138000",
"Province":"\u5317\u4eac",
"City":"\u5317\u4eac",
"AreaCode":"010",
"PostCode":"100000",
"Operators":"\u4e2d\u56fd\u79fb\u52a8",
"Card":"GSM"
}
若选择XML格式,返回结构示例:
<?xml version="1.0" encoding="utf-8" ?>
13800138000
True
北京
北京
010
100000
中国移动
GSM
代码集成步骤
function getMobileInfo($mobile)
{
$response = file_get_contents('http://appyun.sinaapp.com/index.php?app=mobile&controller=index&action=api&outfmt=json&mobile='.$mobile)
$result = json_decode($response,true);
return $result;
}
上述内容涵盖了该接口的全部核心信息,希望能帮助到大家。