irl-random

Here's an example of fetching an irl-random image with the irl-random endpoint. Returns a random image from any of our real pornography endpoints.

Fetching an irl-random image

Get an irl-random image & its details.

GET https://nekos.pro/api/irl-random

{
    "id": 65,
    "url": "https://cdn.nekos.pro/irl-random/d64856f71270411c87971cac46371d59.jpeg"
}

Python example:

import aiohttp

headers = {'Content-type': 'application/json'}
async with aiohttp.ClientSession(headers=headers) as session:
    async with session.get('https://nekos.pro/api/irl-random') as resp:
        image = await resp.json()
        print(image['url'])

This example assumes you are using asyncio & running a Discord bot, which you should be using instead of requests, which is blocking.

Last updated