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:
/v3/images/random
- Method:
GET
- Response:
JSON
Parameters
Location | Name | Type | Description | Required |
---|---|---|---|---|
Query | rating | Array of strings [safe, suggestive, borderline, explicit] | The (age) rating of the image. | No |
Query | is_original | Boolean | Whether the image's idea is original or it uses characters/settings/content from another place (not original). | No |
Query | is_screenshot | Boolean | Whether the image is a screenshot of an anime ep./manga page. | No |
Query | is_flagged | Boolean | Whether the image is flagged by mods. | No |
Query | is_animated | Boolean | Whether the image is animated or not. This'll become useful in the future when we add GIFs. | No |
Query | artist | Array of integers | The artist's ID. | No |
Query | character | Array of integers | The character's ID. | No |
Query | tag | Array of integers | The tag's ID. | No |
Example Request
random_image_file.py
import requests
res = requests.get("https://api.nekosapi.com/v3/images/random/file")
res.raise_for_status()
data = res.content