An API that can output anime girls, and is 100% manually verified
npm install animegirlapigetRandomImage({ number, tag, rating, ignore, random })
number (number): The number of images to request. Default is 1. Must be 100 or fewer.
tag (string | string[] | null, optional): A tag or a list of tags to filter images. If null, no tag filtering is applied.
rating (string | string[] | null, optional): A rating or a list of ratings to filter images. If null, no rating filtering is applied.
ignore (boolean, optional): If false and not enough images are found, a warning is printed. If true, no warning is printed. Default is false.
random (boolean, optional): If true, shuffles the images randomly before filtering.
js
const { getRandomImage } = require('animegirlapi');
// Fetch 5 random images with tag "yuri" and rating "safe"
getRandomImage({ number: 5, tag: 'yuri', rating: 'safe' })
.then(images => console.log(images));
// Fetch 10 random images with tag "catgirl" without checking for rating
getRandomImage({ number: 10, tag: 'catgirl' })
.then(images => console.log(images));
// Fetch 3 random images with rating "explicit" and ignore the warning if not enough images are found
getRandomImage({ number: 3, rating: 'nsfw', ignore: true })
.then(images => console.log(images));
// Fetch 4 random images with multiple tags
getRandomImage({ number: 4, tag: ['yuri', 'catgirl'] })
.then(images => console.log(images));
`
getInfo(url)
Fetches metadata about a specific image URL, including tags and rating.
$3
- url (string): The URL of the image to fetch metadata for.
$3
$3
`js
const { getInfo } = require('animegirlapi');
getInfo('https://www.catgirlnexus.xyz/api/storage/image_145.png')
.then(info => console.log(info));
`
downloadImage(url, output)
Downloads an image from the specified URL and saves it to the given output path.
$3
- url (string): The URL of the image to download.
- output (string | null, optional): The file path to save the image. If null, saves the image in the current directory with the filename extracted from the URL.
$3
$3
`js
const { downloadImage } = require('animegirlapi');
downloadImage('https://www.catgirlnexus.xyz/api/storage/image_145.png', 'images/image_145.png')
.then(response => console.log('Image saved at:', response.path));
`
getAllImages()
Fetches all available image URLs from the API.
$3
$3
`js
const { getAllImages } = require('animegirlapi');
getAllImages()
.then(images => console.log(images));
`
getAllTags()
Fetches a list of all available tags with their descriptions.
$3
$3
`js
const { getAllTags } = require('animegirlapi');
getAllTags()
.then(tags => console.log(tags));
getAllRatings()
Fetches a list of all available ratings.
$3
$3
`js
const { getAllRatings } = require('animegirlapi');
getAllRatings()
.then(ratings => console.log(ratings));
`
Tags
- "vampire": "A character with vampiric traits."
- "gothic": "A character with a dark, gothic style."
- "demon": "A character with demonic traits."
- "kawaii": "A character with an extremely cute and endearing appearance."
- "magical girl": "A character with magical abilities, often with a transformation theme"
- "romantic": "A character in a romantic or affectionate pose."
- "bunnygirl": "A character with bunny ears and traits."
- "catgirl": "A character with cat ears and traits."
- "foxgirl": "A character with fox ears and traits."
- "big breast": "A character with a large bust."
- "heterochromia": "A character with two different-colored eyes, often adding a unique and striking visual trait."
- "small breast": "A character with a small bust."
- "yuri": "Content focusing on romantic relationships between women."
- "multiple girl": "Content involving multiple female characters."
- "schoolgirl": "A character dressed as a schoolgirl."
- "elf": "A character with elf-like features."
- "other animal": "There are other animals in the picture."
- "feet": "Contains feet images."
- "puppygirl": "A character with dog ears and traits."
- "favorites": "Favorites of the owner."
- "blush": "Contains image of heavy blushing."
- "maid": "A character dressed in a maid uniform with charming and elegant traits."
- "loli": "A character depicted as young, petite, and often very cute, embodying a childlike or youthful appearance."
Ratings
- "safe": This is 100% safe.
- "suggestive": Isn't borderline but is suggestive.
- "very suggestive": Borderline of suggestive.
- "nsfw": This is 18+.
Error Handling
- Throws a RangeError if the number exceeds 100.
- Prints a warning message if the number of images requested cannot be fulfilled and ignore is false.
Dependencies
- axios (for making HTTP requests to the API).
- lodash` (for utility functions).