| Crates.io | gyazo-api |
| lib.rs | gyazo-api |
| version | 0.2.2 |
| created_at | 2025-01-12 04:33:46.857352+00 |
| updated_at | 2025-09-16 14:25:45.221038+00 |
| description | Gyazo API client |
| homepage | |
| repository | https://github.com/mrsekut/gyazo-rs |
| max_upload_size | |
| id | 1512939 |
| size | 52,213 |
gyazo-api is a Rust library for interacting with the Gyazo API.
It allows you to upload images, retrieve image details, and fetch image lists, all with ease.
reqwest.cargo add gyazo-api
use gyazo_api::{upload::GyazoUploadOptions, Gyazo};
#[tokio::main]
async fn main() {
let gyazo = Gyazo::new("YOUR_GYAZO_TOKEN");
let options = GyazoUploadOptions {
title: Some("My Image Title".to_string()),
..Default::default()
};
match gyazo.upload("image.jpg", Some(&options)).await {
Ok(response) => println!("Image uploaded successfully: {:?}", response),
Err(e) => eprintln!("Error uploading image: {}", e),
}
}
use gyazo_api::Gyazo;
#[tokio::main]
async fn main() {
let gyazo = Gyazo::new("YOUR_GYAZO_TOKEN");
match gyazo.list(1, 10).await {
Ok(images) => {
for image in images {
println!("Image ID: {}, URL: {}", image.image_id, image.url);
}
}
Err(e) => eprintln!("Error fetching image list: {}", e),
}
}
use gyazo_api::Gyazo;
#[tokio::main]
async fn main() {
let gyazo = Gyazo::new("YOUR_GYAZO_TOKEN");
match gyazo.image("IMAGE_ID").await {
Ok(image_info) => println!("Image Info: {:?}", image_info),
Err(e) => eprintln!("Error fetching image info: {}", e),
}
}