和风天气 .NET(C#) SDK Sparrow.Qweather
简介
Sparrow.Qweather 是基于和风天气开放平台官方 API 封装的 .NET SDK,提供简洁、类型安全的异步调用接口,让开发者无需关心 JWT 签名与 HTTP 细节,即可在 .NET 项目中快速接入全球气象数据服务。
项目地址
GitHub:https://github.com/cnsmallant/sparrow.qweather Gitee:https://gitee.com/dikeko/sparrow.qweather
特性
全覆盖:封装和风天气 12 大类、27 个接口,包括天气预报、空气质量、台风、海洋、天文、历史数据等
开箱即用:统一的 WebApiClient 扩展方法,一行代码发起请求
安全鉴权:内置 Ed25519 私钥 + JWT 签名,无需手动处理认证逻辑
异步优先:全部接口采用 async/await 模式,天然适配现代 .NET 应用
类型安全:每个接口均有对应的强类型 Request / Response 类,IDE 自动补全友好
多语言文档:提供中文、English、Français、Español、Русский、العربية、日本語、한국어 八种语言文档
语言 / Languages
简体中文
和风天气 Sparrow.Qweather .NET SDK 使用说明
安装方式
dotnet add package Sparrow.Qweather
初始化
public static WebApiClient WebApiClient ( )
{
string folderPath = @"cert" ;
string relativeFilePath = @"您的私钥证书" ;
string certPath = Path. GetFullPath ( Path. Combine ( folderPath, relativeFilePath) ) ;
var options = new WebApiOptions ( )
{
Host = "您的API Host" ,
Kid = "您的项目ID" ,
Sub = "您的凭据ID" ,
CertPath = certPath
} ;
var client = WebApiClientBuilder. Create ( options) . Build ( ) ;
return client;
}
使用示例
using Sparrow. Qweather. Client ;
using Sparrow. Qweather. Example ;
using Sparrow. Qweather. Tools ;
var request =
new Sparrow. Qweather. Models. Request. Weather. WeatherNowRequest
{
Location = "101010100" ,
} ;
var response = await WebApiClientSetting. WebApiClient ( ) . WeatherNowAsync ( request) ;
var json = JsonTool. SerializeWithNullFilter ( response) ;
Console. WriteLine ( json) ;
SDK 方法与和风天气 API 对应列表
地理位置 GeoAPI
SDK 方法 Request 类 Response 类 和风天气文档 CityLookUpAsyncCityLookUpRequestCityLookUpResponse城市查询 CityTopAsyncCityTopRequestCityTopResponse热门城市 PoiLookUpAsyncPoiLookUpRequestPoiLookUpResponsePOI 搜索 PoiRangeAsyncPoiRangeRequestPoiRangeReponsePOI 范围搜索
天气预报
SDK 方法 Request 类 Response 类 和风天气文档 WeatherNowAsyncWeatherNowRequestWeatherNowResponse实时天气 WeatherDaysAsyncWeatherDaysRequestWeatherDaysResponse每日天气预报 (3d/7d/10d/15d/30d)WeatherHoursAsyncWeatherHoursRequestWeatherHoursResponse逐小时天气预报 (3h/6h/12h/24h)GridWeatherNowAsyncGridWeatherNowRequestGridWeatherNowResponse格点实时天气 GridWeatherDaysAsyncGridWeatherDaysRequestGridWeatherDaysResponse格点每日天气预报 (3d/7d)GridWeatherHoursAsyncGridWeatherHoursRequestGridWeatherHoursResponse格点逐小时天气预报 (24h/72h)
分钟级预报
SDK 方法 Request 类 Response 类 和风天气文档 Minutely5mAsyncMinutely5mRequsetMinutely5mResponse分钟级降水
天气预警
SDK 方法 Request 类 Response 类 和风天气文档 WeatheralertCurrentAsyncWeatheralertCurrentRequestWeatheralertCurrentResponse实时天气预警
天气指数
SDK 方法 Request 类 Response 类 和风天气文档 IndicesForecastAsyncIndicesForecastRequestIndicesForecastResponse天气指数预报
空气质量
SDK 方法 Request 类 Response 类 和风天气文档 AirCurrentAsyncAirCurrentRequestAirCurrentResponse实时空气质量 AirHourlyForecastAsyncAirHourlyForecastRequestAirHourlyForecastResponse空气质量小时预报
时光机(历史数据)
SDK 方法 Request 类 Response 类 和风天气文档 HistoricalWeatherAsyncHistoricalWeatherRequestHistoricalWeatherResponse天气时光机 HistoricalAirAsyncHistoricalAirRequestHistoricalAirResponse空气质量时光机
热带气旋(台风)
SDK 方法 Request 类 Response 类 和风天气文档 StormForecastAsyncStormForecastRequestStormForecastResponse台风预报 StormTrackAsyncStormTrackRequestStormTrackResponse台风实况和路径 StormListAsyncStormListRequestStormListResponse台风列表
海洋数据
SDK 方法 Request 类 Response 类 和风天气文档 TideAsyncTideRequestTideResponse潮汐
太阳辐射
SDK 方法 Request 类 Response 类 和风天气文档 SolarRadiationForecastAsyncSolarRadiationForecastRequestSolarRadiationForecastResponse太阳辐射预报
天文
SDK 方法 Request 类 Response 类 和风天气文档 SunAsyncSunRequestSunResponse日出日落 MoonAsyncMoonRequestMoonResponse月升月落和月相 SolarElevationAngleAsyncSolarElevationAngleRequestSolarElevationAngleResponse太阳高度角
控制台
SDK 方法 Request 类 Response 类 和风天气文档 FinanceSummaryAsyncFinanceSummaryRequestFinanceSummaryResponse财务汇总 MetricsStatsAsyncMetricsStatsRequestMetricsStatsResponse请求量统计
English
QWeather Sparrow.Qweather .NET SDK Documentation
Installation
dotnet add package Sparrow.Qweather
Initialization
public static WebApiClient WebApiClient ( )
{
string folderPath = @"cert" ;
string relativeFilePath = @"your_private_key_certificate" ;
string certPath = Path. GetFullPath ( Path. Combine ( folderPath, relativeFilePath) ) ;
var options = new WebApiOptions ( )
{
Host = "your_API_Host" ,
Kid = "your_project_ID" ,
Sub = "your_credential_ID" ,
CertPath = certPath
} ;
var client = WebApiClientBuilder. Create ( options) . Build ( ) ;
return client;
}
Usage Example
using Sparrow. Qweather. Client ;
using Sparrow. Qweather. Example ;
using Sparrow. Qweather. Tools ;
var request =
new Sparrow. Qweather. Models. Request. Weather. WeatherNowRequest
{
Location = "101010100" ,
} ;
var response = await WebApiClientSetting. WebApiClient ( ) . WeatherNowAsync ( request) ;
var json = JsonTool. SerializeWithNullFilter ( response) ;
Console. WriteLine ( json) ;
SDK Method to QWeather API Mapping
Geo API
SDK Method Request Class Response Class QWeather Docs CityLookUpAsyncCityLookUpRequestCityLookUpResponseCity Lookup CityTopAsyncCityTopRequestCityTopResponseTop City PoiLookUpAsyncPoiLookUpRequestPoiLookUpResponsePOI Lookup PoiRangeAsyncPoiRangeRequestPoiRangeReponsePOI Range
Weather Forecast
SDK Method Request Class Response Class QWeather Docs WeatherNowAsyncWeatherNowRequestWeatherNowResponseWeather Now WeatherDaysAsyncWeatherDaysRequestWeatherDaysResponseDaily Forecast (3d/7d/10d/15d/30d)WeatherHoursAsyncWeatherHoursRequestWeatherHoursResponseHourly Forecast (3h/6h/12h/24h)GridWeatherNowAsyncGridWeatherNowRequestGridWeatherNowResponseGrid Weather Now GridWeatherDaysAsyncGridWeatherDaysRequestGridWeatherDaysResponseGrid Daily Forecast (3d/7d)GridWeatherHoursAsyncGridWeatherHoursRequestGridWeatherHoursResponseGrid Hourly Forecast (24h/72h)
Minutely Forecast
SDK Method Request Class Response Class QWeather Docs Minutely5mAsyncMinutely5mRequsetMinutely5mResponseMinutely Precipitation
Weather Warning
SDK Method Request Class Response Class QWeather Docs WeatheralertCurrentAsyncWeatheralertCurrentRequestWeatheralertCurrentResponseWeather Alert
Weather Indices
SDK Method Request Class Response Class QWeather Docs IndicesForecastAsyncIndicesForecastRequestIndicesForecastResponseIndices Forecast
Air Quality
SDK Method Request Class Response Class QWeather Docs AirCurrentAsyncAirCurrentRequestAirCurrentResponseAir Current AirHourlyForecastAsyncAirHourlyForecastRequestAirHourlyForecastResponseAir Hourly Forecast
Time Machine (Historical Data)
SDK Method Request Class Response Class QWeather Docs HistoricalWeatherAsyncHistoricalWeatherRequestHistoricalWeatherResponseHistorical Weather HistoricalAirAsyncHistoricalAirRequestHistoricalAirResponseHistorical Air
Tropical Cyclone (Typhoon)
SDK Method Request Class Response Class QWeather Docs StormForecastAsyncStormForecastRequestStormForecastResponseStorm Forecast StormTrackAsyncStormTrackRequestStormTrackResponseStorm Track StormListAsyncStormListRequestStormListResponseStorm List
Ocean Data
SDK Method Request Class Response Class QWeather Docs TideAsyncTideRequestTideResponseTide
Solar Radiation
SDK Method Request Class Response Class QWeather Docs SolarRadiationForecastAsyncSolarRadiationForecastRequestSolarRadiationForecastResponseSolar Radiation Forecast
Astronomy
Console
SDK Method Request Class Response Class QWeather Docs FinanceSummaryAsyncFinanceSummaryRequestFinanceSummaryResponseFinance Summary MetricsStatsAsyncMetricsStatsRequestMetricsStatsResponseMetrics Stats
Français
Documentation du SDK .NET QWeather Sparrow.Qweather
Installation
dotnet add package Sparrow.Qweather
Initialisation
public static WebApiClient WebApiClient ( )
{
string folderPath = @"cert" ;
string relativeFilePath = @"votre_certificat_clé_privée" ;
string certPath = Path. GetFullPath ( Path. Combine ( folderPath, relativeFilePath) ) ;
var options = new WebApiOptions ( )
{
Host = "votre_hôte_API" ,
Kid = "votre_ID_projet" ,
Sub = "votre_ID_credential" ,
CertPath = certPath
} ;
var client = WebApiClientBuilder. Create ( options) . Build ( ) ;
return client;
}
Exemple d’utilisation
using Sparrow. Qweather. Client ;
using Sparrow. Qweather. Example ;
using Sparrow. Qweather. Tools ;
var request =
new Sparrow. Qweather. Models. Request. Weather. WeatherNowRequest
{
Location = "101010100" ,
} ;
var response = await WebApiClientSetting. WebApiClient ( ) . WeatherNowAsync ( request) ;
var json = JsonTool. SerializeWithNullFilter ( response) ;
Console. WriteLine ( json) ;
Correspondance méthodes SDK / API QWeather
API Géographique (GeoAPI)
Prévisions météo
Prévisions à la minute
Méthode SDK Classe Request Classe Response Documentation QWeather Minutely5mAsyncMinutely5mRequsetMinutely5mResponsePrécipitations par minute
Alertes météo
Méthode SDK Classe Request Classe Response Documentation QWeather WeatheralertCurrentAsyncWeatheralertCurrentRequestWeatheralertCurrentResponseAlerte météo
Indices météo
Méthode SDK Classe Request Classe Response Documentation QWeather IndicesForecastAsyncIndicesForecastRequestIndicesForecastResponsePrévisions d’indices
Qualité de l’air
Machine à remonter le temps (données historiques)
Méthode SDK Classe Request Classe Response Documentation QWeather HistoricalWeatherAsyncHistoricalWeatherRequestHistoricalWeatherResponseMétéo historique HistoricalAirAsyncHistoricalAirRequestHistoricalAirResponseQualité de l’air historique
Cyclone tropical (Typhon)
Méthode SDK Classe Request Classe Response Documentation QWeather StormForecastAsyncStormForecastRequestStormForecastResponsePrévision typhon StormTrackAsyncStormTrackRequestStormTrackResponseTrajectoire typhon StormListAsyncStormListRequestStormListResponseListe des typhons
Données océaniques
Méthode SDK Classe Request Classe Response Documentation QWeather TideAsyncTideRequestTideResponseMarée
Rayonnement solaire
Méthode SDK Classe Request Classe Response Documentation QWeather SolarRadiationForecastAsyncSolarRadiationForecastRequestSolarRadiationForecastResponsePrévisions rayonnement solaire
Astronomie
Console
Méthode SDK Classe Request Classe Response Documentation QWeather FinanceSummaryAsyncFinanceSummaryRequestFinanceSummaryResponseRésumé financier MetricsStatsAsyncMetricsStatsRequestMetricsStatsResponseStatistiques de requêtes
Español
Documentación del SDK .NET QWeather Sparrow.Qweather
Instalación
dotnet add package Sparrow.Qweather
Inicialización
public static WebApiClient WebApiClient ( )
{
string folderPath = @"cert" ;
string relativeFilePath = @"su_certificado_clave_privada" ;
string certPath = Path. GetFullPath ( Path. Combine ( folderPath, relativeFilePath) ) ;
var options = new WebApiOptions ( )
{
Host = "su_Host_API" ,
Kid = "su_ID_proyecto" ,
Sub = "su_ID_credencial" ,
CertPath = certPath
} ;
var client = WebApiClientBuilder. Create ( options) . Build ( ) ;
return client;
}
Ejemplo de uso
using Sparrow. Qweather. Client ;
using Sparrow. Qweather. Example ;
using Sparrow. Qweather. Tools ;
var request =
new Sparrow. Qweather. Models. Request. Weather. WeatherNowRequest
{
Location = "101010100" ,
} ;
var response = await WebApiClientSetting. WebApiClient ( ) . WeatherNowAsync ( request) ;
var json = JsonTool. SerializeWithNullFilter ( response) ;
Console. WriteLine ( json) ;
Correspondencia entre métodos SDK y API QWeather
API Geográfica (GeoAPI)
Método SDK Clase Request Clase Response Documentación QWeather CityLookUpAsyncCityLookUpRequestCityLookUpResponseBúsqueda de ciudad CityTopAsyncCityTopRequestCityTopResponseCiudades populares PoiLookUpAsyncPoiLookUpRequestPoiLookUpResponseBúsqueda POI PoiRangeAsyncPoiRangeRequestPoiRangeReponsePOI en radio
Pronóstico del tiempo
Pronóstico por minutos
Método SDK Clase Request Clase Response Documentación QWeather Minutely5mAsyncMinutely5mRequsetMinutely5mResponsePrecipitación por minutos
Alertas meteorológicas
Método SDK Clase Request Clase Response Documentación QWeather WeatheralertCurrentAsyncWeatheralertCurrentRequestWeatheralertCurrentResponseAlerta meteorológica
Índices meteorológicos
Método SDK Clase Request Clase Response Documentación QWeather IndicesForecastAsyncIndicesForecastRequestIndicesForecastResponsePronóstico de índices
Calidad del aire
Máquina del tiempo (datos históricos)
Método SDK Clase Request Clase Response Documentación QWeather HistoricalWeatherAsyncHistoricalWeatherRequestHistoricalWeatherResponseTiempo histórico HistoricalAirAsyncHistoricalAirRequestHistoricalAirResponseCalidad del aire histórica
Ciclón tropical (Tifón)
Datos oceánicos
Método SDK Clase Request Clase Response Documentación QWeather TideAsyncTideRequestTideResponseMarea
Radiación solar
Método SDK Clase Request Clase Response Documentación QWeather SolarRadiationForecastAsyncSolarRadiationForecastRequestSolarRadiationForecastResponsePronóstico radiación solar
Astronomía
Consola
Русский
Документация SDK .NET QWeather Sparrow.Qweather
Установка
dotnet add package Sparrow.Qweather
Инициализация
public static WebApiClient WebApiClient ( )
{
string folderPath = @"cert" ;
string relativeFilePath = @"ваш_сертификат_закрытого_ключа" ;
string certPath = Path. GetFullPath ( Path. Combine ( folderPath, relativeFilePath) ) ;
var options = new WebApiOptions ( )
{
Host = "ваш_API_хост" ,
Kid = "ваш_ID_проекта" ,
Sub = "ваш_ID_учётных_данных" ,
CertPath = certPath
} ;
var client = WebApiClientBuilder. Create ( options) . Build ( ) ;
return client;
}
Пример использования
using Sparrow. Qweather. Client ;
using Sparrow. Qweather. Example ;
using Sparrow. Qweather. Tools ;
var request =
new Sparrow. Qweather. Models. Request. Weather. WeatherNowRequest
{
Location = "101010100" ,
} ;
var response = await WebApiClientSetting. WebApiClient ( ) . WeatherNowAsync ( request) ;
var json = JsonTool. SerializeWithNullFilter ( response) ;
Console. WriteLine ( json) ;
Таблица соответствия методов SDK и API QWeather
Геолокационный API (GeoAPI)
Метод SDK Класс Request Класс Response Документация QWeather CityLookUpAsyncCityLookUpRequestCityLookUpResponseПоиск города CityTopAsyncCityTopRequestCityTopResponseПопулярные города PoiLookUpAsyncPoiLookUpRequestPoiLookUpResponseПоиск POI PoiRangeAsyncPoiRangeRequestPoiRangeReponsePOI в радиусе
Прогноз погоды
Метод SDK Класс Request Класс Response Документация QWeather WeatherNowAsyncWeatherNowRequestWeatherNowResponseТекущая погода WeatherDaysAsyncWeatherDaysRequestWeatherDaysResponseЕжедневный прогноз (3d/7d/10d/15d/30d)WeatherHoursAsyncWeatherHoursRequestWeatherHoursResponseПочасовой прогноз (3h/6h/12h/24h)GridWeatherNowAsyncGridWeatherNowRequestGridWeatherNowResponseТекущая погода сетки GridWeatherDaysAsyncGridWeatherDaysRequestGridWeatherDaysResponseЕжедневный прогноз сетки (3d/7d)GridWeatherHoursAsyncGridWeatherHoursRequestGridWeatherHoursResponseПочасовой прогноз сетки (24h/72h)
Поминутный прогноз
Метод SDK Класс Request Класс Response Документация QWeather Minutely5mAsyncMinutely5mRequsetMinutely5mResponseПоминутные осадки
Погодные предупреждения
Метод SDK Класс Request Класс Response Документация QWeather WeatheralertCurrentAsyncWeatheralertCurrentRequestWeatheralertCurrentResponseПогодное предупреждение
Погодные индексы
Метод SDK Класс Request Класс Response Документация QWeather IndicesForecastAsyncIndicesForecastRequestIndicesForecastResponseПрогноз индексов
Качество воздуха
Машина времени (исторические данные)
Тропический циклон (Тайфун)
Метод SDK Класс Request Класс Response Документация QWeather StormForecastAsyncStormForecastRequestStormForecastResponseПрогноз тайфуна StormTrackAsyncStormTrackRequestStormTrackResponseТраектория тайфуна StormListAsyncStormListRequestStormListResponseСписок тайфунов
Океанические данные
Метод SDK Класс Request Класс Response Документация QWeather TideAsyncTideRequestTideResponseПриливы
Солнечная радиация
Метод SDK Класс Request Класс Response Документация QWeather SolarRadiationForecastAsyncSolarRadiationForecastRequestSolarRadiationForecastResponseПрогноз солнечной радиации
Астрономия
Метод SDK Класс Request Класс Response Документация QWeather SunAsyncSunRequestSunResponseВосход и закат MoonAsyncMoonRequestMoonResponseЛуна и фазы луны SolarElevationAngleAsyncSolarElevationAngleRequestSolarElevationAngleResponseУгол высоты солнца
Консоль
Метод SDK Класс Request Класс Response Документация QWeather FinanceSummaryAsyncFinanceSummaryRequestFinanceSummaryResponseФинансовая сводка MetricsStatsAsyncMetricsStatsRequestMetricsStatsResponseСтатистика запросов
العربية
توثيق SDK .NET الخاص بـ QWeather Sparrow.Qweather
التثبيت
dotnet add package Sparrow.Qweather
التهيئة
public static WebApiClient WebApiClient ( )
{
string folderPath = @"cert" ;
string relativeFilePath = @"شهادة_مفتاحك_الخاص" ;
string certPath = Path. GetFullPath ( Path. Combine ( folderPath, relativeFilePath) ) ;
var options = new WebApiOptions ( )
{
Host = "مضيف_API_الخاص_بك" ,
Kid = "معرّف_مشروعك" ,
Sub = "معرّف_بيانات_اعتمادك" ,
CertPath = certPath
} ;
var client = WebApiClientBuilder. Create ( options) . Build ( ) ;
return client;
}
مثال على الاستخدام
using Sparrow. Qweather. Client ;
using Sparrow. Qweather. Example ;
using Sparrow. Qweather. Tools ;
var request =
new Sparrow. Qweather. Models. Request. Weather. WeatherNowRequest
{
Location = "101010100" ,
} ;
var response = await WebApiClientSetting. WebApiClient ( ) . WeatherNowAsync ( request) ;
var json = JsonTool. SerializeWithNullFilter ( response) ;
Console. WriteLine ( json) ;
جدول تطابق أساليب SDK مع واجهات برمجة تطبيقات QWeather
واجهة الموقع الجغرافي (GeoAPI)
توقعات الطقس
أسلوب SDK فئة Request فئة Response توثيق QWeather WeatherNowAsyncWeatherNowRequestWeatherNowResponseالطقس الآن WeatherDaysAsyncWeatherDaysRequestWeatherDaysResponseالتوقعات اليومية (3d/7d/10d/15d/30d)WeatherHoursAsyncWeatherHoursRequestWeatherHoursResponseالتوقعات بالساعة (3h/6h/12h/24h)GridWeatherNowAsyncGridWeatherNowRequestGridWeatherNowResponseطقس الشبكة الآن GridWeatherDaysAsyncGridWeatherDaysRequestGridWeatherDaysResponseالتوقعات اليومية للشبكة (3d/7d)GridWeatherHoursAsyncGridWeatherHoursRequestGridWeatherHoursResponseالتوقعات بالساعة للشبكة (24h/72h)
توقعات دقيقة بدقيقة
أسلوب SDK فئة Request فئة Response توثيق QWeather Minutely5mAsyncMinutely5mRequsetMinutely5mResponseهطول الأمطار بالدقيقة
تحذيرات الطقس
أسلوب SDK فئة Request فئة Response توثيق QWeather WeatheralertCurrentAsyncWeatheralertCurrentRequestWeatheralertCurrentResponseتنبيه الطقس
مؤشرات الطقس
أسلوب SDK فئة Request فئة Response توثيق QWeather IndicesForecastAsyncIndicesForecastRequestIndicesForecastResponseتوقعات المؤشرات
جودة الهواء
آلة الزمن (البيانات التاريخية)
أسلوب SDK فئة Request فئة Response توثيق QWeather HistoricalWeatherAsyncHistoricalWeatherRequestHistoricalWeatherResponseالطقس التاريخي HistoricalAirAsyncHistoricalAirRequestHistoricalAirResponseجودة الهواء التاريخية
الإعصار المداري (التايفون)
أسلوب SDK فئة Request فئة Response توثيق QWeather StormForecastAsyncStormForecastRequestStormForecastResponseتوقع الإعصار StormTrackAsyncStormTrackRequestStormTrackResponseمسار الإعصار StormListAsyncStormListRequestStormListResponseقائمة الأعاصير
بيانات المحيط
أسلوب SDK فئة Request فئة Response توثيق QWeather TideAsyncTideRequestTideResponseالمد والجزر
الإشعاع الشمسي
أسلوب SDK فئة Request فئة Response توثيق QWeather SolarRadiationForecastAsyncSolarRadiationForecastRequestSolarRadiationForecastResponseتوقعات الإشعاع الشمسي
علم الفلك
لوحة التحكم
أسلوب SDK فئة Request فئة Response توثيق QWeather FinanceSummaryAsyncFinanceSummaryRequestFinanceSummaryResponseالملخص المالي MetricsStatsAsyncMetricsStatsRequestMetricsStatsResponseإحصاءات الطلبات
日本語
QWeather Sparrow.Qweather .NET SDK ドキュメント
インストール
dotnet add package Sparrow.Qweather
初期化
public static WebApiClient WebApiClient ( )
{
string folderPath = @"cert" ;
string relativeFilePath = @"あなたの秘密鍵証明書" ;
string certPath = Path. GetFullPath ( Path. Combine ( folderPath, relativeFilePath) ) ;
var options = new WebApiOptions ( )
{
Host = "あなたのAPI Host" ,
Kid = "あなたのプロジェクトID" ,
Sub = "あなたのクレデンシャルID" ,
CertPath = certPath
} ;
var client = WebApiClientBuilder. Create ( options) . Build ( ) ;
return client;
}
使用例
using Sparrow. Qweather. Client ;
using Sparrow. Qweather. Example ;
using Sparrow. Qweather. Tools ;
var request =
new Sparrow. Qweather. Models. Request. Weather. WeatherNowRequest
{
Location = "101010100" ,
} ;
var response = await WebApiClientSetting. WebApiClient ( ) . WeatherNowAsync ( request) ;
var json = JsonTool. SerializeWithNullFilter ( response) ;
Console. WriteLine ( json) ;
SDK メソッドと QWeather API の対応表
地理位置情報 GeoAPI
SDK メソッド Request クラス Response クラス QWeather ドキュメント CityLookUpAsyncCityLookUpRequestCityLookUpResponse都市検索 CityTopAsyncCityTopRequestCityTopResponse人気都市 PoiLookUpAsyncPoiLookUpRequestPoiLookUpResponsePOI 検索 PoiRangeAsyncPoiRangeRequestPoiRangeReponsePOI 範囲検索
天気予報
SDK メソッド Request クラス Response クラス QWeather ドキュメント WeatherNowAsyncWeatherNowRequestWeatherNowResponse現在の天気 WeatherDaysAsyncWeatherDaysRequestWeatherDaysResponse日別予報 (3d/7d/10d/15d/30d)WeatherHoursAsyncWeatherHoursRequestWeatherHoursResponse時間別予報 (3h/6h/12h/24h)GridWeatherNowAsyncGridWeatherNowRequestGridWeatherNowResponseグリッド現在天気 GridWeatherDaysAsyncGridWeatherDaysRequestGridWeatherDaysResponseグリッド日別予報 (3d/7d)GridWeatherHoursAsyncGridWeatherHoursRequestGridWeatherHoursResponseグリッド時間別予報 (24h/72h)
分単位予報
SDK メソッド Request クラス Response クラス QWeather ドキュメント Minutely5mAsyncMinutely5mRequsetMinutely5mResponse分単位降水
気象警報
SDK メソッド Request クラス Response クラス QWeather ドキュメント WeatheralertCurrentAsyncWeatheralertCurrentRequestWeatheralertCurrentResponse気象警報
気象指数
SDK メソッド Request クラス Response クラス QWeather ドキュメント IndicesForecastAsyncIndicesForecastRequestIndicesForecastResponse指数予報
大気質
SDK メソッド Request クラス Response クラス QWeather ドキュメント AirCurrentAsyncAirCurrentRequestAirCurrentResponse現在の大気質 AirHourlyForecastAsyncAirHourlyForecastRequestAirHourlyForecastResponse時間別大気質予報
タイムマシン(履歴データ)
SDK メソッド Request クラス Response クラス QWeather ドキュメント HistoricalWeatherAsyncHistoricalWeatherRequestHistoricalWeatherResponse過去の天気 HistoricalAirAsyncHistoricalAirRequestHistoricalAirResponse過去の大気質
熱帯低気圧(台風)
SDK メソッド Request クラス Response クラス QWeather ドキュメント StormForecastAsyncStormForecastRequestStormForecastResponse台風予報 StormTrackAsyncStormTrackRequestStormTrackResponse台風経路 StormListAsyncStormListRequestStormListResponse台風リスト
海洋データ
SDK メソッド Request クラス Response クラス QWeather ドキュメント TideAsyncTideRequestTideResponse潮汐
太陽放射
SDK メソッド Request クラス Response クラス QWeather ドキュメント SolarRadiationForecastAsyncSolarRadiationForecastRequestSolarRadiationForecastResponse太陽放射予報
天文
SDK メソッド Request クラス Response クラス QWeather ドキュメント SunAsyncSunRequestSunResponse日の出・日の入り MoonAsyncMoonRequestMoonResponse月の出・月の入り・月相 SolarElevationAngleAsyncSolarElevationAngleRequestSolarElevationAngleResponse太陽高度角
コンソール
SDK メソッド Request クラス Response クラス QWeather ドキュメント FinanceSummaryAsyncFinanceSummaryRequestFinanceSummaryResponse財務概要 MetricsStatsAsyncMetricsStatsRequestMetricsStatsResponseリクエスト統計
한국어
QWeather Sparrow.Qweather .NET SDK 문서
설치
dotnet add package Sparrow.Qweather
초기화
public static WebApiClient WebApiClient ( )
{
string folderPath = @"cert" ;
string relativeFilePath = @"개인키_인증서" ;
string certPath = Path. GetFullPath ( Path. Combine ( folderPath, relativeFilePath) ) ;
var options = new WebApiOptions ( )
{
Host = "API Host" ,
Kid = "프로젝트 ID" ,
Sub = "자격증명 ID" ,
CertPath = certPath
} ;
var client = WebApiClientBuilder. Create ( options) . Build ( ) ;
return client;
}
사용 예제
using Sparrow. Qweather. Client ;
using Sparrow. Qweather. Example ;
using Sparrow. Qweather. Tools ;
var request =
new Sparrow. Qweather. Models. Request. Weather. WeatherNowRequest
{
Location = "101010100" ,
} ;
var response = await WebApiClientSetting. WebApiClient ( ) . WeatherNowAsync ( request) ;
var json = JsonTool. SerializeWithNullFilter ( response) ;
Console. WriteLine ( json) ;
SDK 메서드와 QWeather API 대응 목록
지리 위치 GeoAPI
SDK 메서드 Request 클래스 Response 클래스 QWeather 문서 CityLookUpAsyncCityLookUpRequestCityLookUpResponse도시 검색 CityTopAsyncCityTopRequestCityTopResponse인기 도시 PoiLookUpAsyncPoiLookUpRequestPoiLookUpResponsePOI 검색 PoiRangeAsyncPoiRangeRequestPoiRangeReponsePOI 범위 검색
날씨 예보
SDK 메서드 Request 클래스 Response 클래스 QWeather 문서 WeatherNowAsyncWeatherNowRequestWeatherNowResponse현재 날씨 WeatherDaysAsyncWeatherDaysRequestWeatherDaysResponse일별 예보 (3d/7d/10d/15d/30d)WeatherHoursAsyncWeatherHoursRequestWeatherHoursResponse시간별 예보 (3h/6h/12h/24h)GridWeatherNowAsyncGridWeatherNowRequestGridWeatherNowResponse격자 현재 날씨 GridWeatherDaysAsyncGridWeatherDaysRequestGridWeatherDaysResponse격자 일별 예보 (3d/7d)GridWeatherHoursAsyncGridWeatherHoursRequestGridWeatherHoursResponse격자 시간별 예보 (24h/72h)
분 단위 예보
SDK 메서드 Request 클래스 Response 클래스 QWeather 문서 Minutely5mAsyncMinutely5mRequsetMinutely5mResponse분 단위 강수
기상 경보
SDK 메서드 Request 클래스 Response 클래스 QWeather 문서 WeatheralertCurrentAsyncWeatheralertCurrentRequestWeatheralertCurrentResponse기상 경보
날씨 지수
SDK 메서드 Request 클래스 Response 클래스 QWeather 문서 IndicesForecastAsyncIndicesForecastRequestIndicesForecastResponse지수 예보
대기질
SDK 메서드 Request 클래스 Response 클래스 QWeather 문서 AirCurrentAsyncAirCurrentRequestAirCurrentResponse현재 대기질 AirHourlyForecastAsyncAirHourlyForecastRequestAirHourlyForecastResponse시간별 대기질 예보
타임머신 (역사 데이터)
SDK 메서드 Request 클래스 Response 클래스 QWeather 문서 HistoricalWeatherAsyncHistoricalWeatherRequestHistoricalWeatherResponse과거 날씨 HistoricalAirAsyncHistoricalAirRequestHistoricalAirResponse과거 대기질
열대성 저기압 (태풍)
SDK 메서드 Request 클래스 Response 클래스 QWeather 문서 StormForecastAsyncStormForecastRequestStormForecastResponse태풍 예보 StormTrackAsyncStormTrackRequestStormTrackResponse태풍 경로 StormListAsyncStormListRequestStormListResponse태풍 목록
해양 데이터
SDK 메서드 Request 클래스 Response 클래스 QWeather 문서 TideAsyncTideRequestTideResponse조석
태양 복사
SDK 메서드 Request 클래스 Response 클래스 QWeather 문서 SolarRadiationForecastAsyncSolarRadiationForecastRequestSolarRadiationForecastResponse태양 복사 예보
천문
SDK 메서드 Request 클래스 Response 클래스 QWeather 문서 SunAsyncSunRequestSunResponse일출·일몰 MoonAsyncMoonRequestMoonResponse월출·월몰 및 월상 SolarElevationAngleAsyncSolarElevationAngleRequestSolarElevationAngleResponse태양 고도각
콘솔
SDK 메서드 Request 클래스 Response 클래스 QWeather 문서 FinanceSummaryAsyncFinanceSummaryRequestFinanceSummaryResponse재무 요약 MetricsStatsAsyncMetricsStatsRequestMetricsStatsResponse요청량 통계