| Crates.io | anidb-api |
| lib.rs | anidb-api |
| version | 0.1.1 |
| created_at | 2025-04-28 15:42:37.570637+00 |
| updated_at | 2025-04-28 15:53:55.694349+00 |
| description | Rust library that provides wrapper for AniDB API |
| homepage | |
| repository | https://github.com/AtaraxiaSjel/anidb-api-rs |
| max_upload_size | |
| id | 1652298 |
| size | 117,504 |
An asynchronous Rust client for interacting with the AniDB HTTP API. Features a built-in rate limiter for safe and respectful API usage.
tracing logging.get_anime: Fetch detailed information about an anime by its ID.Add the dependency to your Cargo.toml:
[dependencies]
anidb-api = "0.1.0"
use anidb_api::http::{AniDbHttpClient, models::anime::Anime};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Initialize the client
let anidb = AniDbHttpClient::new()?;
// All IDs are Strings
let anime_id = "17110";
// Get xml data from AniDB and deserialize it into `Anime` struct
let anime: Anime = anidb.get_anime(anime_id).await?;
// Serialize this struct into json and write it into file, for testing purposes
let file = std::fs::File::create("anime.json")?;
serde_json::to_writer_pretty(file, &anime)?;
println!("`Anime` struct serialized successfully!");
Ok(())
}
This project is licensed under the [MIT] or [Apache-2.0] License.