npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

animegirlapi

v1.5.0

Published

An API that can output anime girls, and is 100% manually verified

Downloads

3

Readme

Random Image Fetcher

This JavaScript module provides functions to fetch random images from an API based on specified tags and ratings. It supports filtering images by tags and ratings, downloading images, and retrieving metadata about tags and ratings.

Functions

getRandomImage({ number, tag, rating, ignore, random }) Fetches a random image from the API that matches the specified tag(s) and/or rating(s).

Parameters:

  • 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.

Returns: Promise<string[]>: A promise that resolves to a list of URLs for the requested number of images. Returns an empty array if no images are found.

Example Usage:

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.

Parameters:

  • url (string): The URL of the image to fetch metadata for.

Returns: Promise: A promise that resolves to an object containing the tags and rating of the image.

Example Usage:

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.

Parameters:

  • 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.

Returns: Promise: A promise that resolves to an object containing the path where the image was saved.

Example Usage:

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.

Returns: Promise: A promise that resolves to an object containing all image URLs and their metadata.

Example Usage:

const { getAllImages } = require('animegirlapi');

getAllImages()
    .then(images => console.log(images));

getAllTags()

Fetches a list of all available tags with their descriptions.

Returns: Promise: A promise that resolves to an object containing all tags and their descriptions.

Example Usage:

const { getAllTags } = require('animegirlapi');

getAllTags()
    .then(tags => console.log(tags));`

getAllRatings()

Fetches a list of all available ratings.

Returns: Promise<string[]>: A promise that resolves to an array of ratings.

Example Usage:

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).

Contact

For additional support or to request more images with specific tags, you may contact _.lex0 on Discord.

License

This project is licensed under the MIT License. See the terms of service & privacy policy located on the home page.