Wallhaven API

This package is a wrapper written in the Dart programming language for Wallhaven API calls.

Features

WallhavenApiClient can provide wrappers for the endpoints listed under Wallhaven API documentation.

Getting started

To use package include wallhaven_api in your pubspec.yaml file.

dependencies:
  wallhaven_api: ^0.1.0

Usage

Initialize API Client:

WallhavenApiClient api = WallhavenApiClient();

Get wallpaper by ID:

try {
  Wallpaper wallpaper = await api.wallpaper('id');
  print(wallpaper.data.path);
} catch (e) {
  if (e is WallhavenException) {
    print(e.error);
  }
}

Rate Limiting and Errors

Please follow the guideline from the official API documentation.

Package Limitations

Here is a list of known limitations that will be resolved in the future:

  • No possibility for including a header to the request.
  • Missing query params for a search endpoint.
  • No error codes.

Additional Information

Feel free to create a new issue if you found any problem with the package.

Create a discussion in case you think some features are missing.