Expand description
Async client for the Sobry API v2.
A Sobry API key belongs to one contract, so no contract identifier is needed.
use chrono::NaiveDate;
use sobry_api::{Client, DailyPricesRequest, Granularity, TaxMode};
let client = Client::new(std::env::var("SOBRY_API_KEY").unwrap())?;
let request = DailyPricesRequest::new()
.day(NaiveDate::from_ymd_opt(2026, 6, 12).unwrap())
.granularity(Granularity::QuarterHour)
.tax_mode(TaxMode::IncludingTax);
let prices = client.daily_prices(&request).await?;
println!("received {} price points", prices.len());Structs§
- ApiError
- Structured fields commonly returned by a failed API call.
- Client
- An asynchronous Sobry API client.
- Client
Builder - Configuration for a
Client. - Daily
Price - One electricity-price time slot returned by Sobry.
- Daily
Prices Request - Query options accepted by
GET /user/daily-prices.
Enums§
- Color
Label - Price category relative to the French regulated tariff (TRV).
- Error
- Errors produced by this crate.
- Granularity
- Price-point granularity.
- TaxMode
- Tax treatment of the all-inclusive
pricefield.
Constants§
- DEFAULT_
BASE_ URL - Default base URL for Sobry API v2.