https://github.com/foxzool/qweather-sdk
和风天气API SDK
https://github.com/foxzool/qweather-sdk
api rust weather-api
Last synced: 7 months ago
JSON representation
和风天气API SDK
- Host: GitHub
- URL: https://github.com/foxzool/qweather-sdk
- Owner: foxzool
- License: apache-2.0
- Created: 2024-07-01T03:01:43.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-20T06:16:23.000Z (almost 2 years ago)
- Last Synced: 2024-10-31T11:52:21.406Z (over 1 year ago)
- Topics: api, rust, weather-api
- Language: Rust
- Homepage:
- Size: 118 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
[](https://crates.io/crates/qweather-sdk)
[](https://github.com/Seldom-SE/seldom_pixel#license)
[](https://crates.io/crates/qweather-sdk)
[](https://github.com/foxzool/qweather-sdk/actions)
[](https://docs.rs/qweather-sdk)
# 和风天气API SDK
## Example
在项目下创建`.env`文件,内容如下:
```env
QWEATHER_ID=your_id
QWEATHER_KEY=your_key
```
```no_run
use std::env;
use dotenvy::dotenv;
use qweather_sdk::client::{ClientConfig, QWeatherClient};
#[tokio::main]
async fn main() {
dotenv().expect(".env file not found");
env_logger::init();
let id = env::var("QWEATHER_ID").unwrap();
let key = env::var("QWEATHER_KEY").unwrap();
let client_config = ClientConfig::new(id, key);
let client = QWeatherClient::with_config(client_config);
let resp = client.weather_now("101010100").await.unwrap();
println!("{:#?}", resp);
}
```
## 已完成的API
- GeoAPI
- [x] 城市搜索
- [x] 热门城市查询
- [x] POI搜索
- [x] POI范围搜索
- 城市天气
- [x] 实时天气
- [x] 每日天气预报
- [x] 逐小时天气预报
- 分钟预报
- [x] 分钟级降水
- 格点天气
- [x] 格点实时天气
- [x] 格点每日天气预报
- [x] 格点逐小时天气预报
- 预警
- [x] 天气灾害预警
- [x] 天气预警城市列表
- 天气指数
- [x] 天气指数预报
- 空气质量(beta)
- 实时空气质量(beta)
- 监测站数据(beta)