| Crates.io | pvoutput-client |
| lib.rs | pvoutput-client |
| version | 0.0.3 |
| created_at | 2025-11-06 08:10:34.346399+00 |
| updated_at | 2026-01-17 23:14:03.963471+00 |
| description | Client for the PVOutput.org API |
| homepage | |
| repository | https://gitlab.com/Lynnesbian/pvoutput-client |
| max_upload_size | |
| id | 1919279 |
| size | 312,796 |
Rust client for the PVOutput API.
use pvoutput_client::{Client, types::params::GetSystemParams};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a new client with your API key and system id.
let client = Client::new("your-api-key", 12345, None, None)?;
// Retrieve all available system information.
let response = client.get_system(GetSystemParams::all()).await?;
let system = response.data.system;
println!("{} is a {} watt system.", system.name, system.size);
// All API requests provide rate limit information.
let rate_limit = response.rate_limit;
println!("You have {} of {} requests remaining.", rate_limit.remaining, rate_limit.limit);
Ok(())
}
Further examples can be found in the examples directory.
Feel free to open an issue or submit a merge request if you need support for any of these endpoints.
In addition, none of the data services endpoints are supported.
(These are what I assume would be the most frequently asked questions. Nobody has actually asked these yet.)
Every API response returns a
Response struct which
has a rate_limit field.
There isn't a way to do that, but you can use an endpoint like
get_ladder
and look at the rate_limit, ignoring the rest of the response.
Check the rate limit response.
If the limit field is 300, the account (probably) has donation status.
The PVOutput API doesn't provide a way to check this otherwise.
The PVOutput API only accepts integer values for most data. You can provide floating point values, but they'll be rounded to the nearest integer. Try it yourself: use cURL or similar to upload a report with 100.1 watts of usage, and you'll see the website rounds it to 100.
Check out IDIOSYNCRASIES.md for some useful tips. If you want to reference my code, go ahead -- just make sure you're following the licences.