{
"location": {
"latitude": 40.7484,
"longitude": -73.9967,
"city": "New York",
"state": "NY",
"time_zone": "America/New_York",
"forecast_office": "OKX"
},
"updated": "2026-11-20T06:32:09+00:00",
"units": "us",
"periods": [
{
"name": "Overnight",
"start": "2026-11-20T05:00:00-05:00",
"end": "2026-11-20T06:00:00-05:00",
"is_daytime": false,
"temperature": 44,
"temperature_unit": "F",
"precipitation_chance_percent": 0,
"wind_speed": "3 mph",
"wind_direction": "W",
"summary": "Partly Cloudy",
"detail": "Partly cloudy, with a low around 44. West wind around 3 mph."
},
{
"name": "Friday",
"start": "2026-11-20T06:00:00-05:00",
"end": "2026-11-20T18:00:00-05:00",
"is_daytime": true,
"temperature": 67,
"temperature_unit": "F",
"precipitation_chance_percent": 0,
"wind_speed": "6 mph",
"wind_direction": "W",
"summary": "Sunny",
"detail": "Sunny. High near 67, with temperatures falling to around 62 in the afternoon. West wind around 6 mph."
},
{
"name": "Friday Night",
"start": "2026-11-20T18:00:00-05:00",
"end": "2026-11-21T06:00:00-05:00",
"is_daytime": false,
"temperature": 45,
"temperature_unit": "F",
"precipitation_chance_percent": 0,
"wind_speed": "5 mph",
"wind_direction": "N",
"summary": "Mostly Clear",
"detail": "Mostly clear, with a low around 45. North wind around 5 mph."
}
],
"source": "US National Weather Service (weather.gov)"
}
curl --location --request GET 'https://zylalabs.com/api/15110/us+weather+api/40158/7-day+forecast?lat=40.7128&lon=-74.006&zip=10001&units=us' --header 'Authorization: Bearer YOUR_API_KEY'
{
"location": {
"latitude": 40.7484,
"longitude": -73.9967,
"city": "New York",
"state": "NY",
"time_zone": "America/New_York",
"forecast_office": "OKX"
},
"updated": "2026-11-20T06:32:09+00:00",
"units": "us",
"hours": [
{
"start": "2026-11-20T05:00:00-05:00",
"end": "2026-11-20T06:00:00-05:00",
"is_daytime": false,
"temperature": 44,
"temperature_unit": "F",
"precipitation_chance_percent": 0,
"wind_speed": "3 mph",
"wind_direction": "W",
"summary": "Partly Cloudy",
"humidity_percent": 73
},
{
"start": "2026-11-20T06:00:00-05:00",
"end": "2026-11-20T07:00:00-05:00",
"is_daytime": true,
"temperature": 45,
"temperature_unit": "F",
"precipitation_chance_percent": 0,
"wind_speed": "3 mph",
"wind_direction": "W",
"summary": "Sunny",
"humidity_percent": 68
},
{
"start": "2026-11-20T07:00:00-05:00",
"end": "2026-11-20T08:00:00-05:00",
"is_daytime": true,
"temperature": 44,
"temperature_unit": "F",
"precipitation_chance_percent": 0,
"wind_speed": "3 mph",
"wind_direction": "W",
"summary": "Sunny",
"humidity_percent": 70
}
],
"source": "US National Weather Service (weather.gov)"
}
curl --location --request GET 'https://zylalabs.com/api/15110/us+weather+api/40159/hourly+forecast?lat=40.7128&lon=-74.006&zip=10001&units=us&hours=24' --header 'Authorization: Bearer YOUR_API_KEY'
{
"location": {
"latitude": 40.7484,
"longitude": -73.9967,
"city": "New York",
"state": "NY",
"time_zone": "America/New_York",
"forecast_office": "OKX"
},
"station": {
"id": "KNYC",
"name": "New York City, Central Park"
},
"observed_at": "2026-11-20T09:51:00+00:00",
"summary": "Clear",
"temperature_c": 11.1,
"temperature_f": 52,
"feels_like_c": null,
"feels_like_f": null,
"dewpoint_c": 0.6,
"humidity_percent": 48,
"wind_speed_kmh": 7.6,
"wind_speed_mph": 4.7,
"wind_direction_degrees": 290,
"wind_gust_kmh": null,
"pressure_hpa": 1027.1,
"visibility_km": 16.1,
"source": "US National Weather Service (weather.gov)"
}
curl --location --request GET 'https://zylalabs.com/api/15110/us+weather+api/40160/current+conditions+from+the+nearest+weather+station?lat=40.7128&lon=-74.006&zip=10001' --header 'Authorization: Bearer YOUR_API_KEY'
{"count":1,"alerts":[{"id":"urn:oid:2.49.0.1.840.0.ef2cf1609df4ccaacd0257e7294d1ccf2c1d2855.001.1","event":"Rip Current Statement","severity":"Moderate","urgency":"Expected","certainty":"Likely","headline":"Rip Current Statement issued November 20 at 9:14AM EST until November 20 at 7:00PM EST by NWS Miami FL","area":"Coastal Broward County; Coastal Miami Dade County","effective":"2026-11-20T09:14:00-05:00","expires":"2026-11-20T19:00:00-05:00","ends":"2026-11-20T19:00:00-05:00","sender":"NWS Miami FL","description":"* WHAT...Dangerous rip currents.\n\n* WHERE...Coastal Broward County and Coastal Miami Dade County.\n\n* WHEN...Until 7 PM EST this evening.\n\n* IMPACTS...Rip currents can sweep even the best swimmers away\nfrom shore into deeper water.","instruction":"Swim near a lifeguard. If caught in a rip current, relax and\nfloat. Don't swim against the current. If able, swim in a\ndirection following the shoreline. If unable to escape, face the\nshore and call or wave for help."}],"source":"US National Weather Service (weather.gov)"}
curl --location --request GET 'https://zylalabs.com/api/15110/us+weather+api/40161/active+weather+alerts?lat=40.7128&lon=-74.006&zip=10001' --header 'Authorization: Bearer YOUR_API_KEY'
注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 美国天气 API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。
|
美国国家气象局(公共领域)
仅限于美国及其领土 当前情况来自最近的站点 可能已有一个小时的时间
它返回未来七天的天气预报时段,通常分为白天和夜间时段。每个时段都包含其名称、开始和结束时间、是否为白天、温度、降水概率、风况、摘要和详细描述。 .
位置对象通过纬度、经度、城市、州、时区和预报办公室标识预报地点。使用这些字段显示已解析的位置,并以正确的当地时间解读时间戳。
预报时间戳采用带时区偏移的 ISO 8601 格式,例如 `2026-11-20T06:00:00-05:00`。预报响应通过 `units: "us"` 标识单位制,并以华氏度提供温度,以英里每小时提供风速.
它返回最近报告站点的最新观测数据,包括站点身份、观测时间、摘要、温度、体感温度、露点、湿度、风、气压、能见度和站点位置。未报告的字段可能为空值。
警报响应包含一个计数和一个警报数组。每条警报可以包含其事件、严重程度、紧急程度、确定性、标题、受影响区域、生效和过期时间、发布方、描述以及安全说明
请求可以通过地理坐标或邮政编码指定美国境内的位置。基于坐标的请求使用纬度和经度,而基于邮政编码的请求会先识别对应的美国位置,然后返回预报、观测数据或警报
将 null 字段视为不可用的观测值,而不是零值。例如,如果气象站未报告 `feels_like_f` 或 `wind_gust_mph`,这些字段可能为 null。应用程序应省略这些字段、为其添加标记,或以其他方式妥善处理不可用字段