新浪短链接 生成 api

新浪短网址接口的稳定性和跳转速度还是很给力的,现给出其API说明。 该接口支持两种返回格式:xml和json 对应的URL请求地址为:

xml:http://api.t.sina.com.cn/short_url/shorten.xml json:http://api.t.sina.com.cn/short_url/shorten.json

请求方式:GET 请求参数: source:应用的appkey url_long:需要转换的长链接

eg: 下面的appkey 可以用。

xml:http://api.t.sina.com.cn/short_url/shorten.xml?source=3271760578&url_long=http://www.douban.com/note/249723561/
返回内容为:

     
          http://t.cn/zWXySpZ
          http://www.douban.com/note/249723561/
          0
     


json:http://api.t.sina.com.cn/short_url/shorten.json?source=3271760578&url_long=http://www.douban.com/note/249723561/
返回内容为:
[{"url_short":"http://t.cn/zWXySpZ","url_long":http://www.douban.com/note/249723561/","type":0}]

 

打赏
Bookmark the permalink.

Comments are closed.