waifuim
    Preparing search index...

    waifuim

    Waifu.im API

    Waifu.im API Client for JavaScript.

    Currently up to date as of API v7.

    • Requires at least Node.js v18. Version 21+ recommended.
    • This module relies on the Node.js native fetch()
    • This module is ESM Only
    $ npm install waifuim
    
    import { WaifuClient } from 'waifuim';

    const client = new WaifuClient({
    auth: {
    apiKey: 'API KEY'
    // or jwt: ''
    }
    });

    // Get a random image
    const images = client.images.search();
    console.log(images.items[0]);

    // Add the image to your favorites
    await client.albums.addImage('me', 'favorites', image.items[0].id);

    JWT

    const client = new WaifuClient();
    const jwt = await client.auth.loginDiscord(code);
    client.authenticate({ jwt });

    Browse the complete API documentation here