{ "code": "200", "data": [{ "oriTitle": "接口大全-免费API,为您收集免费的接口服务,做一个api的搬运工", "hoverUrl": "https://www.free-api.com/?fm=253&fmt=auto&app=138&f=JPEG?w=701&h=500", "thumbnailUrl": "https://www.free-api.com/?fm=253&fmt=auto&app=138&f=JPEG?w=701&h=500", "width": 810, "height": 578 }, { "oriTitle": "接口大全-免费API,为您收集免费的接口服务,做一个api的搬运工", "hoverUrl": "https://www.free-api.com/?fm=253&fmt=auto&app=138&f=JPEG?w=701&h=500", "thumbnailUrl": "https://www.free-api.com/?fm=253&fmt=auto&app=138&f=JPEG?w=701&h=500", "width": 810, "height": 578 }, { "oriTitle": "接口大全-免费API,为您收集免费的接口服务,做一个api的搬运工", "hoverUrl": "https://www.free-api.com/?fm=253&fmt=auto&app=138&f=JPEG?w=701&h=500", "thumbnailUrl": "https://www.free-api.com/?fm=253&fmt=auto&app=138&f=JPEG?w=701&h=500", "width": 810, "height": 578 }, { "oriTitle": "接口大全-免费API,为您收集免费的接口服务,做一个api的搬运工", "hoverUrl": "https://www.free-api.com/?fm=253&fmt=auto&app=138&f=JPEG?w=701&h=500", "thumbnailUrl": "https://www.free-api.com/?fm=253&fmt=auto&app=138&f=JPEG?w=701&h=500", "width": 810, "height": 578 }, { "oriTitle": "接口大全-免费API,为您收集免费的接口服务,做一个api的搬运工", "hoverUrl": "https://www.free-api.com/?fm=253&fmt=auto&app=138&f=JPEG?w=701&h=500", "thumbnailUrl": "https://www.free-api.com/?fm=253&fmt=auto&app=138&f=JPEG?w=701&h=500", "width": 810, "height": 578 } ] }
<?php /** * Created by PhpStorm. * User: FZS * Time: 2023/03/07 22:56 */ class freeApi { private $apiUrl; public function __construct() { $this->apiUrl = 'https://zj.v.api.aa1.cn/api/so-baidu-img/?msg=免费接口&page=1'; } /** * 获取结果 * @return array */ public function getResult() { return file_get_contents($this->apiUrl); } }
package main import ( "fmt" "io/ioutil" "log" "net/http" ) const ( APIURL = "https://zj.v.api.aa1.cn/api/so-baidu-img/?msg=免费接口&page=1" ) 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)) }