Skip to content

Instantly share code, notes, and snippets.

@greatghoul
Last active April 30, 2023 12:33
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greatghoul/803f6e6fdf8d04b1a3479eba0a4f6bd1 to your computer and use it in GitHub Desktop.
Save greatghoul/803f6e6fdf8d04b1a3479eba0a4f6bd1 to your computer and use it in GitHub Desktop.
一言 API:随机返回一句话 | 捷径社区

一言:随机返回一句话

GET https://v1.hitokoto.cn/

参数

参数名称 类型 描述
c 可选 Cat,即类型。提交不同的参数代表不同的类别,具体:
a Anime - 动画
b Comic – 漫画
c Game – 游戏
d Novel – 小说
e Myself – 原创
f Internet – 来自网络
g Other – 其他
其他不存在参数 任意类型随机取得
encode 可选
text 返回纯净文本
json 返回不进行unicode转码的json文本
js 返回指定选择器(默认.hitokoto)的同步执行函数。
其他不存在参数 返回unicode转码的json文本
charset 可选
utf-8 返回 UTF-8 编码的内容,支持与异步函数同用。
gbk 返回 GBK 编码的内容,不支持与异步函数同用。
callback 可选
回调函数 将返回的内容传参给指定的异步函数。

具体方法参见 https://hitokoto.cn/api


Kim 整理,更多 API 请访问 公共 API 收集帖(长期更新) 技巧 | 捷径社区

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment