{
"city": "Dublin",
"coordinates": {
"lat": 53.3493795,
"lon": -6.2605593
},
"display_name": "Dublin, County Dublin, Leinster, Éire / Ireland",
"current_weather": {
"time": "2026-10-23T12:30",
"interval": 900,
"temperature": 9.8,
"windspeed": 28.4,
"winddirection": 297,
"is_day": 1,
"weathercode": 3
},
"units": {
"time": "iso8601",
"interval": "seconds",
"temperature": "°C",
"windspeed": "km/h",
"winddirection": "°",
"is_day": "",
"weathercode": "wmo code"
}
}
curl --location --request GET 'https://zylalabs.com/api/14386/weather+and+air+quality+api/36151/current+weather+and+short+forecast?city=Dublin' --header 'Authorization: Bearer YOUR_API_KEY'
{
"city": "Dublin",
"coordinates": {
"lat": 53.3493795,
"lon": -6.2605593
},
"display_name": "Dublin, County Dublin, Leinster, Éire / Ireland",
"daily": {
"time": [
"2026-10-23",
"2026-10-24",
"2026-10-25",
"2026-10-26",
"2026-10-27",
"2026-10-28",
"2026-10-29"
],
"temperature_2m_max": [
10.2,
14.9,
11.1,
17.5,
15.7,
15.6,
14.4
],
"temperature_2m_min": [
6.4,
7.2,
7.6,
7.9,
9.4,
9.4,
10
],
"precipitation_sum": [
27.4,
7.2,
0.98,
6.7,
0.2,
0.3,
0
],
"weathercode": [
63,
61,
53,
61,
51,
51,
3
]
},
"units": {
"time": "iso8601",
"temperature_2m_max": "°C",
"temperature_2m_min": "°C",
"precipitation_sum": "mm",
"weathercode": "wmo code"
}
}
curl --location --request GET 'https://zylalabs.com/api/14386/weather+and+air+quality+api/36152/multi-day+weather+forecast?city=Dublin' --header 'Authorization: Bearer YOUR_API_KEY'
{
"city": "Dublin",
"coordinates": {
"lat": 53.3493795,
"lon": -6.2605593
},
"display_name": "Dublin, County Dublin, Leinster, Éire / Ireland",
"current": {
"time": "2026-10-23T12:00",
"interval": 3600,
"european_aqi": 30,
"us_aqi": 31,
"pm2_5": 2.8,
"pm10": 7.9,
"ozone": 79
},
"units": {
"time": "iso8601",
"interval": "seconds",
"european_aqi": "EAQI",
"us_aqi": "USAQI",
"pm2_5": "μg/m³",
"pm10": "μg/m³",
"ozone": "μg/m³"
}
}
curl --location --request GET 'https://zylalabs.com/api/14386/weather+and+air+quality+api/36153/air+quality+and+pollutant+levels?city=Dublin' --header 'Authorization: Bearer YOUR_API_KEY'
注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 天气和空气质量 API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。
|
实时天气状况、多日预测及任何城市的空气质量,以干净的JSON格式返回,并附带匹配的坐标
开放的气象和地理编码来源在每次请求时都实时查询,因此值反映了当前条件而不是缓存快照
每个调用返回一个城市 更高的计划有更大的请求限制,因此您可以在单个批次中循环遍历多个城市
不 发送城市名称后坐标将为您解析并返回在响应中
当前天气和短期预报端点返回当前温度、风速、风向和坐标 多天天气预报提供每日温度、状况和降水量 空气质量和污染物水平端点提供空气质量指数和污染物浓度
关键字段包括“城市”、“坐标”、“当前天气”(用于当前条件),“每日”(用于预报)和“当前”(用于空气质量)每个部分包含特定的指标,如温度、风速和污染物水平
响应以JSON格式构建,包含城市信息、坐标和特定数据部分的顶级键(例如,当前天气、每日预测)每个部分包含组织在数组或对象中的相关指标,便于访问
当前天气接口提供实时天气数据 多日天气预报提供每日温度最高和最低值 降水量和天气代码 空气质量接口包括空气质量指数和PM2.5和臭氧等污染物的浓度
用户可以在请求中指定城市名称以检索定制的天气和空气质量数据 API会根据提供的城市名称自动解析坐标确保准确的数据检索
“temperature”表示当前温度(单位:°C)“windspeed”显示风速(单位:km/h)而“european_aqi”代表欧洲标准的空气质量指数。每个字段旨在提供关于天气和空气质量的清晰可行的见解
典型的使用案例包括旅行计划的天气预报、出于健康原因监测空气质量,以及将实时天气数据集成到应用程序中以增强用户体验
通过查询实时气象和地理编码源来确保数据准确性,这些源提供实时更新 API持续获取最新数据,反映当前情况而不是依赖缓存信息