Skip to content

Instantly share code, notes, and snippets.

@akinazuki
Last active March 6, 2019 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akinazuki/e73a16c7b919903fc484f901be2b2b0d to your computer and use it in GitHub Desktop.
Save akinazuki/e73a16c7b919903fc484f901be2b2b0d to your computer and use it in GitHub Desktop.

接口公共路由

https://api.satori.moe/v2/{action}/{method}.json

Hitokoto / 一言

路由地址: common/hitokoto

参数 类型 描述
id int 非必填,默认随机返回一条

正常返回示例

{
    "code":1,
    "hitokoto": {
        "id":1457,
        "hitokoto":"你不说话,我不说话,一辈子就过去了啊。",
        "source":"原创",
        "cat":"原创",
        "timestamp":1470849576
    }
}

错误的返回

{
    "code":404
}

Romaji Translate / 罗马音转换

路由地址: common/romaji

参数 类型 描述
text string 需要转换的原文本
lang string 手动指定原文本语言, 默认 zh-CN

正常返回示例

{
    "code":1,
    "text":"猫",
    "japanese":"ねこ",
    "romaji":"Neko"
}

ACG Image Search / ACG 以图搜图

路由地址: saucenao/search

参数 类型 描述
type string 图片类型 可选 fileurl
url string 可正常访问的 HTTP URL
image file HTTP POST 提交的文件

本接口最大文件上传限制为 5M

正常返回示例

{
    "code":1,
    "result":[
        {
            "header":{
                "similarity":"49.57",
                "thumbnail":"https://img1.saucenao.com/res/drawr/26/268920.jpg?auth=fxpEnVBupeerHf-OzUSxpw&exp=1551908362",
                "index_id":10,
                "index_name":"Index #10: Drawr Images - 268920.jpg"
            },
            "data":{
                "ext_urls":[
                    "https://drawr.net/show.php?id=268920"
                ],
                "title":"2009-01-18 00:58:13",
                "drawr_id":268920,
                "member_name":"ロド",
                "member_id":3377
            }
        },
        {
            "header":{
                "similarity":"48.47",
                "thumbnail":"https://img1.saucenao.com/res/pixiv/3460/manga/34605278_p8.jpg?auth=Yk4U_ACG81MuFJ2Vx5EIBA&exp=1551908362",
                "index_id":5,
                "index_name":"Index #5: Pixiv Images - 34605278_p8.jpg"
            },
            "data":{
                "ext_urls":[
                    "https://www.pixiv.net/member_illust.php?mode=medium&illust_id=34605278"
                ],
                "title":"ぷよぷよ落書き",
                "pixiv_id":34605278,
                "member_name":"ペケ丸@文才くれ",
                "member_id":3517335
            }
        }
    ]
}

错误返回示例

{
    "code": 413
}

Distance Calculate / 距离计算

路由地址: common/distance

参数 类型 描述
src string 起始地 示例: 上海
dst string 目的地 示例: 大阪

正常返回示例

{
    "code": 1,
    "distance": 1365,
    "unit": "KM"
}

错误返回示例

{
    "code": -1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment