Skip to content

API Documentation

The ImageAPI was created to be a replacement for the nekos.life API in the bot *Purr*.
It is publicly available to use.

Since version 1.2.0 of this API can you also find the endpoints of the former PurrBotAPI in this one.
The API is open source and contributions are always welcome.

POST

These API endpoints can only be used through POST requests.

Info

  • Responses:
    • Success: Image
    • Failure: JSON

/quote

Generates images that look like Discord messages.

Fields

Type: String
Default: https://purrbot.site/assets/img/api/unknown.png

Description:
The URL of the avatar to display in the image. The image will be resized to 217x217 pixels.

Type: String
Default: dd. MMM yyyy hh:mm:ss zzz

Description:
The format in which the date should be displayed.
This uses the SimpleDateFormat from Java.

Type: String
Default: Some message

Description:
The actual message that should be displayed.
Note that this will NOT render markdown and can only render a few selected emojis (No Discord emotes).

Type: String
Default: hex:ffffff

Description:
The color in which the username should be displayed.
Supported are hex:rrggbb, rgb:r,g,b or the raw Color value.

Type: Number
Default: Current time of the request

Description:
The date of the message as epoch milliseconds.

Type: String
Default: Someone

Description:
The username to display.

Example


This request was made on march, 9th 2020.

{
  "avatar": "https://cdn.discordapp.com/avatars/204232208049766400/dfaaefa54a2804addb1f494da7aa904d.png",
  "message": "This is an example message.",
  "nameColor": "hex:ffffff",
  "dateFormat": "dd. MMM yyyy",
  "username": "Andre_601"
}


quote

/status

Adds a status icon to the provided Avatar.

Fields

Type: String
Default: https://purrbot.site/assets/img/api/unknown.png

Description:
The URL of the avatar to display in the image. The image will be resized to 950x950 pixels.

Type: Boolean
Default: false

Description:
Wether the user is on mobile. true will change the status icon to that used to indicate mobile users on Discord (Small smartphone).

Type: String
Default: offline

Description:
The status to display with the icon.
Available are online, idle, do_not_disturb (or dnd), streaming and offline.

Example


{
  "avatar": "https://cdn.discordapp.com/avatars/204232208049766400/dfaaefa54a2804addb1f494da7aa904d.png",
  "status": "online"
}


status

GET (SFW (Safe for work) endpoints)

Contains images that are considered safe for work.
You can access those endpoints through simple GET requests.

Info

  • Responses:
    • Success: JSON
    • Failure: JSON

/img/sfw/background/img

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/sfw/background/img/gradient_orange.png",
  "time": 0
}

/img/sfw/bite/gif

Example response:

{
  "code": 200,
  "link": "https://purbot.site/img/sfw/bite/gif/bite_001.gif",
  "time": 0
}

/img/sfw/cuddle/gif

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/sfw/cuddle/gif/cuddle_001.gif",
  "time": 0
}

/img/sfw/eevee/:type

:type can be either gif for gifs or img for images.

Example responses:

{
  "code": 200,
  "link": "https://purrbot.site/img/sfw/eevee/img/eevee_001.jpg",
  "time": 0
}
{
  "code": 200,
  "link": "https://purrbot.site/img/sfw/eevee/gif/eevee_001.gif",
  "time": 0
}

/img/sfw/feed/gif

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/sfw/feed/gif/feed_001.gif",
  "time": 0
}

/img/sfw/holo/img

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/sfw/holo/img/holo_001.jpg",
  "time": 0
}

/img/sfw/hug/gif

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/sfw/hug/gif/hug_001.gif",
  "time": 0
}

/img/sfw/icon/img

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/sfw/icon/img/purr.png",
  "time": 0
}

/img/sfw/kiss/gif

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/sfw/kiss/gif/kiss_001.gif",
  "time": 0
}

/img/sfw/kitsune/img

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/sfw/kitsune/img/kitsune_001.jpg",
  "time": 0
}

/img/sfw/lick/gif

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/sfw/lick/gif/lick_001.gif",
  "time": 0
}

/img/sfw/neko/:type

:type can be either gif for gifs or img for images.

Example responses:

{
  "code": 200,
  "link": "https://purrbot.site/img/sfw/neko/img/neko_001.jpg",
  "time": 0
}
{
  "code": 200,
  "link": "https://purrbot.site/img/sfw/neko/gif/neko_001.gif",
  "time": 0
}

/img/sfw/pat/gif

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/sfw/pat/gif/pat_001.gif",
  "time": 0
}

/img/sfw/poke/gif

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/sfw/poke/gif/poke_001.gif",
  "time": 0
}

/img/sfw/senko/img

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/sfw/senko/img/senko_001.jpg",
  "time": 0
}

/img/sfw/slap/gif

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/sfw/slap/gif/slap_001.gif",
  "time": 0
}

/img/sfw/tail/gif

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/sfw/tail/gif/tail_001.gif",
  "time": 0
}

/img/sfw/tickle/gif

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/sfw/tickle/gif/tickle_001.gif",
  "time": 0
}


GET (NSFW (Not safe for work) endpoints)

Contains images that are considered Not Safe for work.
If you are using those images on Discord, make sure to only share them in Channels marked as NSFW.
You can access those endpoints through simple GET requests.

Info

  • Responses:
    • Success: JSON
    • Failure: JSON

/img/nsfw/anal/gif

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/nsfw/anal/gif/anal_001.gif",
  "time": 0
}

/img/nsfw/blowjob/gif

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/nsfw/blowjob/gif/blowjob_001.gif",
  "time": 0
}

/img/nsfw/cum/gif

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/nsfw/cum/gif/cum_001.gif",
  "time": 0
}

/img/nsfw/fuck/gif

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/nsfw/fuck/gif/fuck_001.gif",
  "time": 0
}

/img/nsfw/neko/:type

:type can be either gif for gifs or img for images.

Example responses:

{
  "code": 200,
  "link": "https://purrbot.site/img/nsfw/neko/img/neko_001.jpg",
  "time": 0
}
{
  "code": 200,
  "link": "https://purrbot.site/img/nsfw/neko/gif/neko_001.gif",
  "time": 0
}

/img/nsfw/pussylick/gif

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/nsfw/pussylick/gif/pussylick_001.gif",
  "time": 0
}

/img/nsfw/solo/gif

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/nsfw/solo/gif/solo_001.gif",
  "time": 0
}

/img/nsfw/threesome_fff/gif

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/nsfw/threesome_fff/gif/threesome_001.gif",
  "time": 0
}

/img/nsfw/threesome_ffm/gif

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/nsfw/threesome_ffm/gif/threesome_001.gif",
  "time": 0
}

/img/nsfw/threesome_mmf/gif

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/nsfw/threesome_mmf/gif/threesome_001.gif",
  "time": 0
}

/img/nsfw/yuri/gif

Example response:

{
  "code": 200,
  "link": "https://purrbot.site/img/nsfw/yuri/gif/yuri_001.gif",
  "time": 0
}


Failed requests

The API can return one of the following HTTP error codes.

When you connect to an API path which does not exist (e.g. /api/img/doesntexist) will this error response be displayed.

{
  "code": 403,
  "message": "Not supported API path",
  "time": 0
}

If the provided path doesn't contain any images, will this error be displayed.

{
  "code": 403,
  "message": "The selected directory doesn't contain any images",
  "time": 0
}

Your request didn't contain any JSON (Not even just {}) or the JSON was invalid.
Common issues of invalid JSON are missing commas or similar.

{
  "code": 403,
  "message": "Invalid or empty JSON body provided.",
  "time": 0
}

The API was unable to generate an image from the provided JSON.
This is often the case when things like the Avatar URL lead to an invalid page.

{
  "code": 500,
  "message": "Couldn't generate image. Make sure the values are valid!",
  "time": 0
}