waifuim_dart

Caution

V2 of this package is currently in progress to work with v7 of the API. v1.0.2 has been released so you can self hosted instances of waifu.im API v6 until v2 of the package comes out.

waifuim_dart is a Dart package made to make using the waifu.im API easier for your Dart projects.

Installation

Before using, make sure you are using Dart v3. This package will work on projects using http v0.13.0 to v1.x.x

Method 1: Install via git

Add the following to your pubspec.yaml file

dependencies:
	waifuim_dart:
		git: https://codeberg.org/ahsokasoftware/waifuim_dart.git
	# Your other dependencies here

Method 2: Install via pub.dev

Add the following to your pubspec.yaml file

dependencies:
	waifuim_dart: 2.0.0-dev.1
	# Your other dependencies here

Usage

Here is a basic example of using the package for getting a random image based on a tag search

import 'package:waifuim_dart/waifuim_dart.dart';

Future<void> main() async {
	final waifuClient = WaifuImClient(debug: true);
	final tag = "maid";
	
	try {
		final imageData = await waifuClient.getImage(tag, isNsfw: false);
		final imageUrl = imageData['url'];
		
		print(imageUrl);
		print("Image obtained from: https://www.waifu.im");
	} catch (e) {
		print('❌ An error occurred: $e');
	}
}

You can refer to the example directory for more examples on using this package.

Help

If something is not working and you know how to fix it, open an issue or pull request on Codeberg.

You can also join one of the following communities: Discord Server | Stoat Server

Release Dates:

  • V2.0.0-dev.1: April 25th, 2026
  • V1.0.2: February 5th, 2026
  • V1.0.1: November 24th, 2025
  • V1.0.0: September 19th, 2025
  • Started on: September 7th, 2025

Libraries

waifuim_dart