該API接口自 2011年 SAE平臺(tái)上線穩(wěn)定運(yùn)行至今,增加了17號(hào)段的支持,歡迎各種采集注限制 并發(fā)10
詳細(xì)使用說明
接口地址:http://appyun.sinaapp.com/index.php?app=mobile&controller=index&action=api
請(qǐng)求方法:GET
請(qǐng)求參數(shù):
參數(shù)名 類型 必填 參數(shù)位置 描述 默認(rèn)值
app string 是 urlParam 模塊名稱(不變) mobile
controller string 是 urlParam 控制器名稱 index
action string 是 urlParam 操作名稱 api
mobile string 是 urlParam 手機(jī)號(hào)碼或號(hào)段 13800138000
outfmt string 是 urlParam 期望得到的結(jié)果類型 json
請(qǐng)求示例:
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" : "\u5317\u4eac" , "City" : "\u5317\u4eac" , "AreaCode" : "010" , "PostCode" : "100000" , "Operators" : "\u4e2d\u56fd\u79fb\u52a8" , "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 >中國移動(dòng)</ 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 ; } |
以上所述就是本文的全部?jī)?nèi)容了,希望大家能夠喜歡。