API

目录

支持CORS

接口列表

接口总表

接口名接口地址请求方式接口内容范例

随机图片文件

image

Get

Image

/image

随机图片文件

image

Post

same as images.json

随机图片文件 redirect

images

Get

Image

/images

随机图片元信息

image

Ppost

JSon Object

/images

随机图片元信息

image.json

Get

JSon Object

/images.json

随机图片元信息

image.json

Post

same as images.json

获取标签列表

tags

Get

基本请求参数

参数名数据类型默认值范例说明

nin

string

boy,long_hair

英文逗号分割,排除的分类 Categories | 常见分类

id

int

236433

图片id,使用此字段之后其他筛选条件将失效

compress

true/false

true

true则加载webp格式图片,有效提高加载速度

mix_size

int

最小尺寸

默认无最小尺寸限制

max_size

int

6144

最大尺寸

默认最大不超过6144*6144,超过该尺寸需要设置此参数

接口详情

随机图片文件(Random Anime Image File)[GET]接口

接口名请求方式接口内容范例

image

GET

Image

/image

默认提供https/http,get请求方式,例:

curl -I -XGET "https://pic.re/image"

除开主要的经随机筛选而来的图片内容外,额外图片信息均储存在Response Header

见响应头,主要可用字段为

HTTP/1.1 200 OK
Date: Sat, 15 May 2021 15:01:25 GMT
Content-Type: image/jpeg
Content-Length: 689008
Connection: keep-alive
image_id: 242637
image_source: https://www.pixiv.net/member_illust.php?mode=medium&illust_id=63026388
image_tags: aqua_eyes,armor,fate/extra,fate/extra_ccc,fate/grand_order,fate_(series),long_hair,meltryllis,polychromatic,purple_hair,tagme_(artist)

随机图片文件 推荐!(Random Anime Image FIle Recommend)[GET]接口

接口名请求方式接口内容范例

images

GET

Image

/images

参数与/image接口通用,区别是会使用301跳转到CDN地址。此接口可以很大的降低服务器压力。

正常访问场景和#1接口无区别

随机图片元信息(Random Anime Image Meta Info)[POST]接口

接口名请求方式接口内容范例

image

POST

JSon Object

/image

默认提供https/http,POST请求方式,例:

curl -XPOST "https://pic.re/image"

返回Json数据

{
    "file_url":"https://konachan.com/image/c2013204d3c186f0b95e433eea9bce15/Konachan.com%20-%20208569%20animal%20aqua_hair%20bird%20boots%20bow%20building%20city%20clouds%20gloves%20hat%20hinanawi_tenshi%20night%20red_eyes%20short_hair%20skirt_lift%20sky%20touhou%20tree%20waira%20water.jpg",
    "md5":"c2013204d3c186f0b95e433eea9bce15",
    "tags":[
        "animal",
        "aqua_hair",
        "bird",
        "boots",
        "bow",
        "building",
        "city",
        "clouds",
        "gloves",
        "hat",
        "hinanawi_tenshi",
        "night",
        "red_eyes",
        "short_hair",
        "skirt_lift",
        "sky",
        "touhou",
        "tree",
        "waira",
        "water"
    ],
    "width":2047,
    "height":1447,
    "source":"http://i4.pixiv.net/img-original/img/2015/10/24/00/31/25/53177335_p0.jpg",
    "author":"Flandre93",
    "has_children":false,
    "_id":208569
}

随机图片元信息(Random Anime Image Meta Info)[Get]接口

接口名请求方式接口内容范例

image.json

Get

JSon Object

/images.json

同Post接口内容

获取现有图片标签

获取现有数据库内大于一定图片量的表情

接口名请求方式接口内容范例

tags

GET & POST

JSon Object

Example:

[
    {
        "name": "long_hair",
        "count": 44045
    },
    {
        "name": "original",
        "count": 24985
    },
    {
        "name": "short_hair",
        "count": 19695
    },
    {
        "name": "blush",
        "count": 17494
    }
]

Last updated