Home  >  Article  >  php教程  >  常用的API接口,返回JSON格式的服务API接口

常用的API接口,返回JSON格式的服务API接口

PHP中文网
PHP中文网Original
2016-05-23 17:09:211852browse

常用的API接口,返回JSON格式的服务API接口

php代码

快递接口:
http://www.kuaidi100.com/query?type=快递公司代号&postid=快递单号 
ps:快递公司编码:申通="shentong" EMS="ems" 顺丰="shunfeng" 圆通="yuantong" 中通="zhongtong" 韵达="yunda" 天天="tiantian" 汇通="huitongkuaidi" 全峰="quanfengkuaidi" 德邦="debangwuliu" 宅急送="zhaijisong"

php代码

谷歌接口
FeedXml转json接口:
http://ajax.googleapis.com/ajax/services/feed/load?q=Feed地址&v=1.0
备选参数:callback:&callback=foo就会在json外面嵌套foo({})方便做jsonp使用。 
备选参数:n:返回多少条记录。

php代码

百度百科接口:
http://baike.baidu.com/api/openapi/BaikeLemmaCardApi?scope=103&format=json&appid=379020&bk_key=关键字&bk_length=600
查询出错示例如下:查看原始页面 {"error_code":"20000","error_msg":"search word not found"}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn