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.
Libraries
- api/wallhaven_api_client
- models/avatar/avatar
- models/category/category
- models/collection/collection
- models/collections/collections
- models/exception/wallhaven_exception
- models/file_type/file_type
- models/meta/meta
- models/models
- models/purity/purity
- models/search/search
- models/settings/settings
- models/tag/tag
- models/thumbs/thumbs
- models/uploader/uploader
- models/wallpaper/wallpaper
- wallhaven_api
- Wallhaven API wrapper for the Dart programming language.