nsfw-neko

Here's an example of fetching a nsfw-neko image with the nsfw-neko endpoint.

Fetching a nsfw-neko image

Get a nsfw-neko image & its details.

GET https://nekos.pro/api/nsfw-neko

{
    "id": 73,
    "character_name": "Schwarz (Arknights)",
    "url": "https://cdn.nekos.pro/nsfw-neko/abe9bd3e71fc4880aac6db3dd3e8d13e.jpg"
}

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/nsfw-neko') 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