Images

An API Key is not required for MOST endpoints of this service. See Shared Responses for common error responses.

Online Check

GET https://v2.yiff.rest/online

{
  "success": true,
  "uptime": 0
}

List Categories

GET https://v2.yiff.rest/categories

{
  "success": true,
  "data": {
    "enabled": [
      {
        "name": "Animals > Birb",
        "db": "animals.birb"
      }
      // (...)
    ],
    "disabled": [
      {
        "name": "Animals > Fox",
        "db": "animals.fox",
        "_comment": "Category has never had any content."
      }
      // (...)
    ]
  }
}

Get Information About A Category

GET https://v2.yiff.rest/categories/:db

Path Parameters

NameTypeDescription

db*

String

The "db" representation of the category (see GET /categories)

{
  "success": true,
  "data": {
    "name": "Animals > Birb",
    "db": "animals.birb",
    "dir": "/app/public/V2/animals/birb",
    // _comment can also be present
    "disabled": false,
    "files": {
      "exists": true,
      "list": {
        "total": 65,
        "size": {
          "total": 107429688,
          "totalM": 102.453, // Mebibytes
          "average": 1652764.431,
          "averageM": 1.576 // Mebibytes
        },
        "types": {
        // mime types - none guaranteed
          "image/jpeg": 22,
          "image/gif": 6,
          "image/png": 37
        }
      }
    }
  }
}

Get Image

GET https://v2.yiff.rest/images/:id.json

Path Parameters

NameTypeDescription

id*

String

The ID of the image.

{
  "success": false,
  "error": "No image was found with that id.",
  "code": 1040
}

Get Random Image

GET https://v2.yiff.rest/:category

Path Parameters

NameTypeDescription

category*

String

The category, see GET /categories (db, replace periods with forward slashes)

Query Parameters

NameTypeDescription

amount

Number

The amount of images to request, between 1-5.

notes

String

If notes should be hidden. Use the literal string "disabled".

sizeLimit

Number

The maximum size of image to get, in powers of 2. Prefixes such as KB/MB can be used.

{
  "success": false,
  "error": "Amount must be 1 or more.",
  "code": 1051
}

Get Images Bulk

POST https://v2.yiff.rest/bulk

Get an arbitrary amount of images across many categories. This endpoint requires an api key, and is restricted to developer approval.

By default, a maximum of 100 images total can be fetched in one request. You can request your limit to be raised by contacting a developer.

Path Parameters

NameTypeDescription

sizeLimit

String

The maximum size of image to get, in powers of 2. Prefixes such as KB/MB can be used.

Request Body

NameTypeDescription

some.category*

Number

A map of category (in db format) to the amount of images. See List Categories for the list of categories.

// a map of category (in db format) to the requested imagess
{
  "some.category": [
    {
      "artists": [].
      "sources": [],
      "width": 0,
      "height": 0,
      "url": "https://v2.yiff.media/{id}.{ext}",
      "type": "{mime}",
      "name": "{name}.{ext}",
      "id": "{id}",
      "ext": "{ext}",
      "size": 0,
      "reportURL": null,
      "shortURL": "https://yiff.rocks/{id}"
    }
  ]
}

Last updated