《新浪短網(wǎng)址API接口》要點(diǎn):
本文介紹了新浪短網(wǎng)址API接口,希望對(duì)您有用。如果有疑問,可以聯(lián)系我們。
相關(guān)主題:PHP開發(fā)
新浪短網(wǎng)址接口的穩(wěn)定性和跳轉(zhuǎn)速度還是很給力的,現(xiàn)給出其API說明。
該接口支持兩種返回格式:xml和json
對(duì)應(yīng)的URL請(qǐng)求地址為:
xml:http://api.t.sina.com.cn/short_url/shorten.xml
json:http://api.t.sina.com.cn/short_url/shorten.json
請(qǐng)求方式:GET
請(qǐng)求參數(shù):
source:應(yīng)用的appkey ,這里 3271760578 或 31641035 還可以用哦。如果你不想申請(qǐng)就直接用吧。
url_long:需要轉(zhuǎn)換的長(zhǎng)鏈接
舉個(gè)例子:
(1)XML格式:
http://api.t.sina.com.cn/short_url/shorten.xml?source=3271760578&url_long=http://www.snjht.com/jiaocheng/14521.html
返回內(nèi)容為:
<urls> <url> <url_short>http://t.cn/RucE4jb</url_short> <url_long>http://www.snjht.com/jiaocheng/14521.html</url_long> <type>0</type> </url> </urls>
(2)json格式:
http://api.t.sina.com.cn/short_url/shorten.json?source=3271760578&url_long=http://www.snjht.com/jiaocheng/14521.html
返回內(nèi)容為:
[{"url_short":"http://t.cn/RucE4jb","url_long":"http://www.snjht.com/jiaocheng/14521.html","type":0}]
轉(zhuǎn)載請(qǐng)注明本頁(yè)網(wǎng)址:
http://www.snjht.com/jiaocheng/14672.html