Documentation
Images
Get a Random Image File

Get a Random Image File

This endpoint allows you to get a redirect to a random image's file URL, filtering by tags, characters, artists, etc.

Endpoint Details

  • URL: /v4/images/random
  • Method: GET
  • Response: JSON

Parameters

LocationNameTypeDescriptionRequired
QueryratingArray of strings [safe, suggestive, borderline, explicit]The (age) rating of the image.No
QueryartistArray of integersThe artist's ID.No
QuerytagsArray of stringsThe tags names, comma-delimited.No
Querywithout_tagsArray of stringsThe tags to exclude's names, comma-delimited.No

Example Request

random_image_file.py
import requests
 
res = requests.get("https://api.nekosapi.com/v4/images/random/file")
res.raise_for_status()
 
data = res.content