Skip to main content
Version: 1.0.0

Random Images

/random/:type

This route allows you to get a random image URL from the type you entered. Here are the current types:

TypeDescription
nekoA random neko image.
kitsuneA random kitsune image.
patA random pat image.
hugA random hug image.
slapA random slap image.
kissA random kiss image.

Examples

Using the fetch API

fetch('https://nekonya.classydev.fr/api/v1/random/neko')
.then((res) => res.json())
.then((data) => console.log(data)); // { url: 'https://nekonya.classydev.fr/images/nekos/...' }

Using Axios

axios.get('https://nekonya.classydev.fr/api/v1/random/neko')
.then((res) => console.log(res.data)); // { url: 'https://nekonya.classydev.fr/images/nekos/...' }

Using the official client

const nekonya = require('nekonya.js');

nekonya.neko().then((url) => console.log(url)); // https://nekonya.classydev.fr/images/nekos/...

Response

The response is a JSON object with the following properties:

PropertyDescription
urlThe URL of the image.