稳定、快速、免费的 API 接口服务
随机句子,hitokoto.cn 的自托管低配版
接口地址: https://api.tomys.top/api/hitokoto
返回格式: JSON
请求方式: GET
请求示例: https://api.tomys.top/api/hitokoto?c=a&encode=json
请求参数说明:
| 名称 | 必填 | 类型 | 说明 |
|---|---|---|---|
| c | 否 | string | 句子类型, 不传或非法值为随机, 见 https://developer.hitokoto.cn/sentence/ |
| encode | 否 | string | 返回类型, 默认 json, 可选 text |
返回参数说明:
| 名称 | 类型 | 说明 |
|---|---|---|
| id | number | 一言标识 |
| uuid | uuid | 一言唯一标识; 可以到 https://hitokoto.cn?uuid=[uuid] 查看其完整信息 |
| hitokoto | string | 一言正文, unicode |
| type | string | 类型, 参考请求参数 |
| from | string | 一言的出处 |
| from_who | string | 一言的作者 |
| creator | string | 添加者 |
| creator_uid | number | 添加者用户标识 |
| reviewer | number | 审核员标识 |
| commit_from | string | 提交方式 |
| created_at | string | 添加时间 |
| length | number | 句子长度 |
返回示例:
{
"id": 1133,
"uuid": "003e4ebe-59a4-49f1-a35e-69b9051ceabf",
"hitokoto": "你指尖跳动的电光,是我此生不变的信仰",
"type": "a",
"from": "某科学的超电磁炮",
"from_who": null,
"creator": "Sωeet、心境",
"creator_uid": 218,
"reviewer": 0,
"commit_from": "web",
"created_at": "1485526487",
"length": 18
}
错误码格式说明:
| 名称 | 类型 | 说明 |
|---|
代码示例:
https://api.tomys.top/api/hitokoto?c=a&encode=json