接口地址
http://api.guiguiya.com/api/wenan/hitokoto
接口状态
正常 (HTTP 200) 上次检测:2026-05-19 12:10:29
📝 接口描述
hitokoto随机一言文案
📋 请求示例
【基础请求】
GET http://api.guiguiya.com/api/wenan/hitokoto
【请求头】
Content-Type: application/json
Accept: application/json
【参数说明】
GET请求参数通过URL传递:
http://api.guiguiya.com/api/wenan/hitokoto?参数名1=参数值1&参数名2=参数值2
【调用示例】
# cURL
curl -X GET 'http://api.guiguiya.com/api/wenan/hitokoto' \
-H 'Content-Type: application/json'
# JavaScript (Fetch)
fetch('http://api.guiguiya.com/api/wenan/hitokoto', {
method: 'GET',
headers: { 'Content-Type': 'application/json' }
})
.then(res => res.json())
.then(data => console.log(data));
# PHP (cURL)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://api.guiguiya.com/api/wenan/hitokoto');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
# Python (requests)
import requests
url = 'http://api.guiguiya.com/api/wenan/hitokoto'
response = requests.get(url)
print(response.json())
📤 真实返回示例
{
"code": 200,
"msg": "随机hitokoto一言",
"full": "英雄意味着强大,英雄意味着孤独,最后一幕一定是英雄渐行渐远,我的英雄也是那样的存在。—hasty《四月是你的谎言》",
"data": {
"author": "hasty",
"works": "《四月是你的谎言》",
"content": "英雄意味着强大,英雄意味着孤独,最后一幕一定是英雄渐行渐远,我的英雄也是那样的存在。",
"by": "鬼鬼API 提供技术支持",
"文本调用": "?type=text"
}
}
🔧 JavaScript (Fetch)
fetch('/api/proxy.php?url=http%3A%2F%2Fapi.guiguiya.com%2Fapi%2Fwenan%2Fhitokoto', {
method: 'GET',
headers: { 'Content-Type': 'application/json' }
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));
🐘 PHP (cURL)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://api.guiguiya.com/api/wenan/hitokoto');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
📡 Python (requests)
import requests
url = 'http://api.guiguiya.com/api/wenan/hitokoto'
response = requests.request('GET', url)
print(response.json())