pixiv3-rs
Rust client for the Pixiv App API (app-api.pixiv.net). Port of the Python library pixivpy3, with a similar public API, and an updated asynchronous structure.
Usage
Add to your Cargo.toml:
[]
= "0.1"
= "0.3"
Example: create a client with a refresh token and fetch user details and illustrations:
use ;
use ;
async
Without authentication (e.g. for public endpoints or when using a proxy that injects auth):
let api = new_no_auth;
With a fixed access token:
let api = new_from_access_token;
Features
stream(default): Enables streaming helpers and async iteration where applicable.log(default): Enables logging via thelogcrate. Disable withdefault-features = falsefor a dependency-free build if you do not need logging.
Relation to pixivpy3
This library is a port of upbit/pixivpy, with a similar public API, and an updated architecture:
- Method names: Kept close to pixivpy3 (e.g.
user_detail,user_illusts,illust_detail) for easier migration. - Async-first: All API calls are async and return
Result<T, PixivError>; usetokio(or another runtime) to run them. - Streaming: Optional
streamfeature provides async iterators (e.g.user_illusts_iter) instead of manual pagination. - Macro-based definitions: API endpoints (most of them now) are defined using a procedural macro, to avoid boilerplate code.
License
Unlicense, same as upbit/pixivpy. And I quote its words here:
Feel free to use, reuse and abuse the code in this project.