接口地址:http://www.dreamling.xyz/API/youdao/note/api.php |
---|
返回格式:json |
请求方式:get |
请求示例:http://www.dreamling.xyz/API/youdao/note/api.php?url=&format=json |
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
url | string | 必填 | 有道云笔记链接 |
format | string | 选填 | 返回格式 |
名称 | 类型 | 说明 |
---|---|---|
- | - | 直接能看出 |
{
"code": 200,
"data": {
"作者": "免费接口:www.free-api.com",
"标题": "test",
"点赞": 0,
"阅读": 2,
"大小": 396785,
"内容": "test",
"前端内容": "test",
"文件创建时间戳": 1677136291,
"文件创建时间": "2023年02月23日 15点11分",
"上次修改时间戳": 1677136806,
"上次修改时间": "2023年02月23日 15点20分"
}
}
错误码 | 说明 |
---|---|
- | - |
<?php
/**
* Created by PhpStorm.
* User: FZS
* Time: 2023/03/07 22:56
*/
class freeApi
{
private $apiUrl;
public function __construct()
{
$this->apiUrl = 'http://www.dreamling.xyz/API/youdao/note/api.php?url=&format=json';
}
/**
* 获取结果
* @return array
*/
public function getResult()
{
return file_get_contents($this->apiUrl);
}
}
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
const (
APIURL = "http://www.dreamling.xyz/API/youdao/note/api.php?url=&format=json"
)
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))
}