您的位置:首页 > 其它

常用的免费接口

2015-04-08 11:44 211 查看

一.开源免费的天气接口:

1.百度免费天气接口:

百度天气接口说明:根据经纬度/城市名查询天气的结果

百度天气接口示例:

1.
http://api.map.baidu.com/telematics/v3/weather?location=北京&output=json&ak=yourkey


接口参数说明:

参数类型参数名称是否必须具体描述
Stringaktrue开发者密钥
Stringsnfalse若用户所用ak的校验方式为sn校验时该参数必须。
Stringlocationtrue输入城市名或经纬度,城市名称如:北京,经纬度格式为lng,lat坐标如: location=116.305145,39.982368;城市天气预报中间"|"分 隔,location=116.305145,39.982368| 122.305145,36.982368|….
Stringoutputfalse输出的数据格式,默认为xml格式,当output设置为’json’时,输出的为json格式的数据;
Stringcoord_typefalse请求参数坐标类型,默认为gcj02经纬度坐标。允许的值为bd09ll、bd09mc、gcj02、wgs84。bd09ll表示百度经纬度坐标,bd09mc表示百度墨卡托坐标,gcj02表示经过国测局加密的坐标。wgs84表示gps获取的坐标。
百度天气接口返回结果:

参数名称含义说明
currentCity当前城市返回城市名
status返回结果状态信息
date当前时间年-月-日
results天气预报信息白天可返回近期3天的天气情况(今天、明天、后天)、晚上可返回近期4天的天气情况(今天、明天、后天、大后天)
results.currentCity当前城市
results.weather_dataweather_data.date天气预报时间
weather_data.dayPictureUrl白天的天气预报图片url
weather_data.nightPictureUrl晚上的天气预报图片url
weather_data.weather天气状况所有天气情况(”|”分隔符):晴|多云|阴|阵雨|雷阵雨|雷阵雨伴有冰雹|雨夹雪|小雨|中雨|大雨|暴雨|大暴雨|特大暴雨|阵雪|小雪| 中雪|大雪|暴雪|雾|冻雨|沙尘暴|小雨转中雨|中雨转大雨|大雨转暴雨|暴雨转大暴雨|大暴雨转特大暴雨|小雪转中雪|中雪转大雪|大雪转暴雪|浮 尘|扬沙|强沙尘暴|霾
weather_data.wind风力
weather_data.temperature温度
百度天气接口返回xml格式的数据

01.
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>

02.
<
CityWeatherResponse
>

03.
<
status
>success</
status
>

04.
<
date
>2014-05-03</
date
>

05.
<
results
>

06.
<
currentCity
>北京</
currentCity
>

07.
<
weather_data
>

08.
<
date
>周六(今天, 实时:22℃)</
date
>

09.
<
dayPictureUrl
>http://api.map.baidu.com/images/weather/day/leizhenyu.png<;/
dayPictureUrl
>

10.
<
nightPictureUrl
>http://api.map.baidu.com/images/weather/night/duoyun.png<;/
nightPictureUrl
>

11.
<
weather
>雷阵雨转多云</
weather
>

12.
<
wind
>北风5-6级</
wind
>

13.
<
temperature
>24 ~ 11℃</
temperature
>

14.
<
date
>周日</
date
>

15.
<
dayPictureUrl
>http://api.map.baidu.com/images/weather/day/duoyun.png<;/
dayPictureUrl
>

16.
<
nightPictureUrl
>http://api.map.baidu.com/images/weather/night/qing.png<;/
nightPictureUrl
>

17.
<
weather
>多云转晴</
weather
>

18.
<
wind
>北风4-5级</
wind
>

19.
<
temperature
>19 ~ 8℃</
temperature
>

20.
<
date
>周一</
date
>

21.
<
dayPictureUrl
>http://api.map.baidu.com/images/weather/day/qing.png<;/
dayPictureUrl
>

22.
<
nightPictureUrl
>http://api.map.baidu.com/images/weather/night/qing.png<;/
nightPictureUrl
>

23.
<
weather
>晴</
weather
>

24.
<
wind
>微风</
wind
>

25.
<
temperature
>21 ~ 9℃</
temperature
>

26.
<
date
>周二</
date
>

27.
<
dayPictureUrl
>http://api.map.baidu.com/images/weather/day/duoyun.png<;/
dayPictureUrl
>

28.
<
nightPictureUrl
>http://api.map.baidu.com/images/weather/night/qing.png<;/
nightPictureUrl
>

29.
<
weather
>多云转晴</
weather
>

30.
<
wind
>微风</
wind
>

31.
<
temperature
>21 ~ 10℃</
temperature
>

32.
</
weather_data
>

33.
</
results
>

34.
</
CityWeatherResponse
>


2.国家气象局提供的天气预报接口:

接口地址:

1.
//接口事例

2.
http://www.weather.com.cn/data/sk/101010100.html

3.
http://www.weather.com.cn/data/cityinfo/101010100.html

4.
http://m.weather.com.cn/data/101010100.html


对于第三个接口,返回信息比较全面,也是以json格式提供,格式如下:

01.
{

02.
"weatherinfo": {

03.
//基本信息;"city": "北京",

04.
"city_en": "beijing",

05.
"date_y": "2012年2月16日",

06.
"date": "",

07.
"week": "星期四",

08.
"fchh": "11",

09.
"cityid": "101010100",

10.
//摄氏温度"temp1": "2℃~-7℃",

11.
"temp2": "1℃~-7℃",

12.
"temp3": "4℃~-7℃",

13.
"temp4": "7℃~-5℃",

14.
"temp5": "5℃~-3℃",

15.
"temp6": "5℃~-2℃",

16.
//华氏温度;"tempF1": "35.6℉~19.4℉",

17.
"tempF2": "33.8℉~19.4℉",

18.
"tempF3": "39.2℉~19.4℉",

19.
"tempF4": "44.6℉~23℉",

20.
"tempF5": "41℉~26.6℉",

21.
"tempF6": "41℉~28.4℉",

22.
//天气描述;"weather1": "晴",

23.
"weather2": "晴",

24.
"weather3": "晴",

25.
"weather4": "晴转多云",

26.
"weather5": "多云",

27.
"weather6": "多云转阴",

28.
//天气描述图片序号"img1": "0",

29.
"img2": "99",

30.
"img3": "0",

31.
"img4": "99",

32.
"img5": "0",

33.
"img6": "99",

34.
"img7": "0",

35.
"img8": "1",

36.
"img9": "1",

37.
"img10": "99",

38.
"img11": "1",

39.
"img12": "2",

40.
"img_single": "0",

41.
//图片名称;"img_title1": "晴",

42.
"img_title2": "晴",

43.
"img_title3": "晴",

44.
"img_title4": "晴",

45.
"img_title5": "晴",

46.
"img_title6": "晴",

47.
"img_title7": "晴",

48.
"img_title8": "多云",

49.
"img_title9": "多云",

50.
"img_title10": "多云",

51.
"img_title11": "多云",

52.
"img_title12": "阴",

53.
"img_title_single": "晴",

54.
//风速描述"wind1": "北风3-4级转微风",

55.
"wind2": "微风",

56.
"wind3": "微风",

57.
"wind4": "微风",

58.
"wind5": "微风",

59.
"wind6": "微风",

60.
//风速级别描述"fx1": "北风",

61.
"fx2": "微风",

62.
"fl1": "3-4级转小于3级",

63.
"fl2": "小于3级",

64.
"fl3": "小于3级",

65.
"fl4": "小于3级",

66.
"fl5": "小于3级",

67.
"fl6": "小于3级",

68.
//今天穿衣指数;"index": "冷",

69.
"index_d": "天气冷,建议着棉衣、皮夹克加羊毛衫等冬季服装。年老体弱者宜着厚棉衣或冬大衣。",

70.
//48小时穿衣指数"index48": "冷",

71.
"index48_d": "天气冷,建议着棉衣、皮夹克加羊毛衫等冬季服装。年老体弱者宜着厚棉衣或冬大衣。",

72.
//紫外线及48小时紫外线"index_uv": "弱",

73.
"index48_uv": "弱",

74.
//洗车"index_xc": "适宜",

75.
//旅游"index_tr": "一般",

76.
//舒适指数"index_co": "较不舒适",

77.
"st1": "1",

78.
"st2": "-8",

79.
"st3": "2",

80.
"st4": "-4",

81.
"st5": "5",

82.
"st6": "-5",

83.
//晨练"index_cl": "较不宜",

84.
//晾晒"index_ls": "基本适宜",

85.
//过敏"index_ag": "极不易发"

86.
}

87.
}


3.新浪天气接口:

1.
http://php.weather.sina.com.cn/iframe/index/w_cl.php?code=js&;day=0&city=&dfc=1&charset=utf-8


接口说明:参数中city如果给了参数就是相关的城市,否则会自动判断,day=0表示今天

二.电商开源接口

1.京东获取单个商品价格接口:

1.
//ps:商品ID这么获取:http://item.jd.com/954086.html

2.
http://p.3.cn/prices/mgets?skuIds=J_商品ID&type=1


2.淘宝商品搜索建议:

1.
http://suggest.taobao.com/sug?code=utf-8&;q=商品关键字&callback=cb

2.
//ps:callback是回调函数设定


三.物流接口

1.快递接口:

1.
//ps:快递公司编码:申通="shentong" EMS="ems" 顺丰="shunfeng" 圆通="yuantong" 中通="zhongtong" 韵达="yunda" 天天="tiantian"

2.
汇通="huitongkuaidi" 全峰="quanfengkuaidi" 德邦="debangwuliu" 宅急送="zhaijisong"

3.
http://www.kuaidi100.com/query?type=快递公司代号&postid=快递单号


四.大公司相关接口

1.谷歌的FeedXml转json接口:

1.
http://ajax.googleapis.com/ajax/services/feed/load?q=Feed地址&v=1.0

2.
//备选参数:callback:&callback=foo就会在json外面嵌套foo({})方便做jsonp使用。

3.
//备选参数:n:返回多少条记录。


2.百度百科接口:

1.
http://baike.baidu.com/api/openapi/BaikeLemmaCardApi?scope=103&;format=json&appid=379020&bk_key=关键字&bk_length=600

2.
//查询出错示例如下:查看原始页面 {"error_code":"20000","error_msg":"search word not found"}音乐接口


3.虾米音乐接口

1.
http://kuang.xiami.com/app/nineteen/search/key/歌曲名称/diandian/1/page/歌曲当前页?_=当前毫秒&callback=getXiamiData


4.QQ空间音乐接口

1.
http://qzone-music.qq.com/fcg-bin/cgi_playlist_xml.fcg?uin=QQ号码&json=1&g_tk=1916754934


5.QQ空间收藏音乐接口

1.
http://qzone-music.qq.com/fcg-bin ;/fcg_music_fav_getinfo.fcg?dirinfo=0&dirid=1&uin=QQ号& p=0.519638272547262&g_tk=1284234856


6.多米音乐接口

1.
http://v5.pc.duomi.com/search-ajaxsearch-searchall?kw=关键字&pi=页码&pz=每页音乐数


7.soso音乐接口

1.
http://cgi.music.soso.com/fcgi-bin/fcg_search_xmldata.q?source=10&;w=关键字&perpage=1&ie=utf-8


8.腾讯获取QQ昵称和用户头像

1.
http://r.qzone.qq.com/cgi-bin/user/cgi_personal_card?uin=QQ(不过是jsonp哦)


五.视频接口

1.土豆视频接口

1.
http://api.tudou.com/v3/gw?method=album.item.get&; appKey=Appkey&format=json&albumId=视频剧集ID&pageNo=当前页& pageSize=每页显示


六.地图接口

1.阿里云根据地区名获取经纬度接口

1.
//参数解释: 纬度,经度 type 001 (100代表道路,010代表POI,001代表门址,111可以同时显示前三项)

2.
http://gc.ditu.aliyun.com/geocoding?a=苏州市


2.阿里云根据经纬度获取地区名接口

1.
http://gc.ditu.aliyun.com/regeocoding?l=39.938133,116.395739&type=001


3.获取用户的IP,国家代码缩写,经纬度

1.
http://www.telize.com/geoip?callback=a

2.
//参数解释: callback是回调函数


七.IP接口

1.新浪接口(ip值为空的时候 获取本地的)

1.
http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=json&;ip=218.4.255.255


2.淘宝接口

1.
http://ip.taobao.com/service/getIpInfo.php?ip=63.223.108.42


详情请参见通过ip地址准确获取对应的所在地区信息-新浪网易淘宝开放API接口调用方法

八.手机信息查询接口 JSON在线工具

1.淘宝网接口

1.
http://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=手机号


2.拍拍接口

1.
http://virtual.paipai.com/extinfo/GetMobileProductInfo?mobile=手机号&amount=10000&callname=getPhoneNumInfoExtCallback


3.百付宝接口

1.
https://www.baifubao.com/callback?cmd=1059&;callback=phone&phone=手机号


4.115接口

1.
http://cz.115.com/?ct=index&;ac=get_mobile_local&callback=jsonp1333962541001&mobile=手机号


5.有道接口

1.
http://www.youdao.com/smartresult-xml/search.s?jsFlag=true&;type=mobile&q=手机号


6.手机在线接口

1.
http://api.showji.com/Locating/www.showji.com.aspx?m=手机号&output=json&callback=querycallback


九.视频信息接口JSON在线工具

1.优酷

1.
http://v.youku.com/player/getPlayList/VideoIDS/视频ID (比如 http://v.youku.com/v_show/id_XNTQxNzc4ODg0.html的ID就是XNTQxNzc4ODg0)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: