接口地址:https://v.api.aa1.cn/api/api-douyu/index.php |
---|
返回格式:伪json |
请求方式:get |
请求示例:https://v.api.aa1.cn/api/api-douyu/index.php?msg=大司马&b=1 |
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
msg | string | 必填 | 主播名称 |
b | int | 选填 | 返回类型 |
名称 | 类型 | 说明 |
---|---|---|
非标准json | - | - |
{
"tu": "https://rpic.douyucdn.cn/asrpic/230505/606118_src_1432.avif/dy1",
"zbj": "芜湖大司马丶",
"zblj": "https://m.douyu.com/606118",
"gk": "327.6万人正在观看"
}
错误码 | 说明 |
---|---|
- | - |
<?php
/**
* Created by PhpStorm.
* User: FZS
* Time: 2023/05/05 14:26
*/
class freeApi
{
private $apiUrl;
public function __construct()
{
$this->apiUrl = 'https://v.api.aa1.cn/api/api-douyu/index.php?msg=大司马&b=1';
}
/**
* 获取结果
* @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/api-douyu/index.php?msg=大司马&b=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))
}