接口地址:https://api.kuleu.com/api/action |
---|
返回格式:json |
请求方式:get |
请求示例:https://api.kuleu.com/api/action?text=爱情 |
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
text | string | 必填 | 搜索短剧名称 |
名称 | 类型 | 说明 |
---|---|---|
name | string | 短剧名称 |
viewlink | string | 短剧链接 |
addtime | string | 添加时间 |
{
"code": 200,
"msg": "搜索成功",
"data": [{
"name": "8527-机场爱情故事(暧昧公寓)(100集)擦边",
"viewlink": "https://pan.quark.cn/s/6f14bd514234",
"addtime": "2024-07-29 12:19:05"
},
{
"name": "9313-机场爱情故事(暧昧公寓)(100集)",
"viewlink": "https://pan.quark.cn/s/5396040ed807",
"addtime": "2024-06-07 14:48:32"
}
]
}
错误码 | 说明 |
---|---|
-1 | 无效或缺少参数 |
<?php
/**
* Created by PhpStorm.
* User: FZS
* Time: 2024/5/10 07:11
*/
class freeApi
{
private $apiUrl;
public function __construct()
{
$this->apiUrl = 'https://api.kuleu.com/api/action?text=爱情';
}
/**
* 获取结果
* @return array
*/
public function getResult()
{
return file_get_contents($this->apiUrl);
}
}
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
const (
APIURL = "https://api.kuleu.com/api/action?text=爱情"
)
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))
}