{ "code": 1, "msg": "获取成功", "time": "2024-05-10", "data": [{ "title": "吃亏是福?我爸总吃亏,被上汽大众赞助一台车", "heat": "233.4万", "link": "https://www.bilibili.com/video/av1754031639/" }] }
<?php /** * Created by PhpStorm. * User: FZS * Time: 2024/5/10 07:11 */ class freeApi { private $apiUrl; public function __construct() { $this->apiUrl = 'https://v.api.aa1.cn/api/bilibili-rs/'; } /** * 获取结果 * @return array */ public function getResult() { return file_get_contents($this->apiUrl); } }
package main import ( "fmt" "io/ioutil" "log" "net/http" ) const ( APIURL = "https://v.api.aa1.cn/api/bilibili-rs/" ) 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)) }