本API支援1、可輸入11位手機號查詢歸屬地如:13858861234,2、可輸入7位號段查詢歸屬地如:1335586,3、支援號段 13、14、15、17、18,有需要的小夥伴可以參考下。
該API介面自 2011年 SAE平台上線穩定運行至今,增加了17號段的支援,歡迎各種採集注限制 並發10
詳細使用說明
介面地址: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返回樣本:
?
| 1 2 3 4 5 6 7 8 9 10 |
{ "id":"80012", "Mobile":"13800138000", "Province":"u5317u4eac", "City":"u5317u4eac", "AreaCode":"010", "PostCode":"100000", "Operators":"u4e2du56fdu79fbu52a8", "Card":"GSM" } |
XML返回樣本:
?
| 1 2 3 4 5 6 7 8 9 10 11 |
<?xml version="1.0" encoding="utf-8" ?> <QueryResponse xmlns="http://appyun.sinaapp.com/"> <Mobile>13800138000</Mobile> <QueryResult>True</QueryResult> <Province>北京</Province> <City>北京</City> <AreaCode>010</AreaCode> <PostCode>100000</PostCode> <Operators>中國移動</Operators> <Card>GSM</Card> </QueryResponse> |
使用方法
?
| 1 2 3 4 5 6 |
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; } |
以上所述就是本文的全部內容了,希望大家能夠喜歡。