| Crates.io | openmeteo-rs-ureq |
| lib.rs | openmeteo-rs-ureq |
| version | 0.1.1 |
| created_at | 2025-04-05 14:57:25.480205+00 |
| updated_at | 2025-04-09 19:09:04.722666+00 |
| description | A Rust client for the Open-Meteo API using ureq |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1622174 |
| size | 177,426 |
A Rust SDK for the Open-Meteo Weather API using the ureq HTTP client.
This SDK is based on the official Open-Meteo SDK collection and provides a type-safe way to interact with Open-Meteo's free weather forecast APIs.
ureq HTTP clientAdd the dependency to your Cargo.toml:
[dependencies]
openmeteo-rs-ureq = "0.1.0" # replace with current version
use openmeteo_rs_ureq::{OpenMeteoClient, WeatherRequest};
fn main() {
let client = OpenMeteoClient::default();
let request = WeatherRequest::new(52.52, 13.41)
.add_hourly("temperature_2m")
.add_hourly("relative_humidity_2m")
.add_daily("temperature_2m_max")
.add_daily("temperature_2m_min")
.add_current("temperature_2m")
.temperature_unit("celsius")
.wind_speed_unit("kmh");
println!(
"Got weather forecast for 52.52, 13.41: {:#?}\n",
client.get_weather(request).unwrap().decode_buffer()
);
}
use openmeteo_rs_ureq::{HistoricalWeatherRequest, OpenMeteoClient};
fn main() {
let client = OpenMeteoClient::default();
let request = HistoricalWeatherRequest::new(52.52, 13.41)
.add_hourly("temperature_2m")
.add_daily("temperature_2m_max")
.start_date("2022-01-01")
.end_date("2022-01-10")
.temperature_unit("celsius");
println!("Got historical weather for 52.52, 13.41: {:#?}\n", client.get_historical_weather(request).unwrap().decode_buffer());
}
For detailed API documentation, please visit docs.rs/openmeteo-rs-ureq.
For information about the Open-Meteo API itself, visit open-meteo.com/en/docs.
This project is licensed under the MIT License - see the LICENSE file for details.