{ "code": "10000", "charge": false, "msg": "查询成功", "result": { "status": "0", "msg": "ok", "result": { "keyword": "姚明", "num": "9", "list": [{ "title": "姚明:篮球改革比足球基础好 像电视剧一样播比赛", "time": "2016-03-16 09:59:06", "src": "网易", "category": "", "pic": "http://api.jisuapi.com/news/upload/20160316/104634_55612.jpg", "url": "http://m.news.so.com/transcode?ofmt=html&src=srp&q=%E5%A7%9A%E6%98%8E&pn=1&pos=1&m=20bf33d00f8db460ecacb72229acbd11f3d238e1&u=http%3A%2F%2Fsports.163.com%2F16%2F0316%2F09%2FBI96O41V00052UUC.html", "weburl": "http://sports.163.com/16/0316/09/BI96O41V00052UUC.html", "content": "作为全国政协委员,他今年关注的是体育场馆改革,建议可为体育馆发放年检的安全许可证,在许可证范围之内,举办赛事可以不用再经过公安、消防等部门的审批,从而真正盘活体育场馆。" }] } } }
<?php /** * Created by PhpStorm. * User: FZS * Time: 2020/12/01 22:26 */ class freeApi { private $apiUrl; public function __construct() { $this->apiUrl = 'https://way.jd.com/jisuapi/newSearch?keyword=姚明&appkey=APPKEY'; } /** * 获取结果 * @return array */ public function getResult() { return file_get_contents($this->apiUrl); } }
package main import ( "fmt" "io/ioutil" "log" "net/http" ) const ( APIURL = "https://way.jd.com/jisuapi/newSearch?keyword=姚明&appkey=APPKEY" ) func main() { queryUrl := fmt.Sprintf("%s",APIURL) resp, err := http.Get(queryUrl) if err != nil { log.Println(err) return } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) }