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

{
  "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

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

Get Random Image

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

Path Parameters

Query Parameters

{
  "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

Request Body

// 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