发送一个带有参数q的GET请求,指定位置(例如城市名称或坐标),以接收JSON格式的天气警报数组
获取天气警报 - 端点功能
| 对象 | 描述 |
|---|---|
q |
[必需] |
{"location":{"name":"London","region":"City of London, Greater London","country":"United Kingdom","lat":51.5171,"lon":-0.1062,"tz_id":"Europe/London","localtime_epoch":1732205001,"localtime":"2024-11-21 16:03"},"alerts":{"alert":[{"headline":"Yellow Snow-ice Warning issued for United Kingdom - London & South East England | South West England","msgtype":"Alert","severity":"Moderate","urgency":"Future","areas":"London & South East England | South West England","category":"Met","certainty":"Likely","event":"Yellow ice warning","note":"","effective":"2024-11-21T10:21:16+00:00","expires":"2024-11-22T10:00:00+00:00","desc":"Icy stretches are expected to form on untreated surfaces during Thursday evening and overnight into Friday morning as temperatures drop below freezing. A few wintry showers are also likely at times, particularly across the far west of the warning area, which may give a further 1 to 2 cm snowfall above 200 metres.\n\nWhat should I do?\n\nKeep yourself and your family safe when it is icy. Plan to leave the house at least five minutes earlier than normal. Not needing to rush, reduces your risk of accidents, slips, and falls.\n\nIf you need to make a journey on foot, try to use pavements along main roads which are likely to be less slippery. Similarly, if cycling, try and stick to main roads which are more likely to have been treated.\n\nGive yourself the best chance of avoiding delays by checking road conditions if driving, or bus and train timetables, amending your travel plans if necessary.\n\nBe prepared for weather warnings to change: when a weather warning is issued, the Met Office recommends staying up to date with the weather forecast in your area. For further details see https://www.metoffice.gov.uk/weather/warnings-and-advice/uk-warnings","instruction":"What to expect: Probably some icy patches on some untreated roads, pavements and cycle paths; Some injuries from slips and falls on icy surfaces."},{"headline":"Yellow Snow-ice Warning issued for United Kingdom - London & South East England | South West England","msgtype":"Alert","severity":"Moderate","urgency":"Future","areas":"London & South East England | South West England","category":"Met","certainty":"Likely","event":"Yellow ice warning","note":"","effective":"2024-11-21T10:21:16+00:00","expires":"2024-11-22T10:00:00+00:00","desc":"Icy stretches are expected to form on untreated surfaces during Thursday evening and overnight into Friday morning as temperatures drop below freezing. A few wintry showers are also likely at times, particularly across the far west of the warning area, which may give a further 1 to 2 cm snowfall above 200 metres.\n\nWhat should I do?\n\nKeep yourself and your family safe when it is icy. Plan to leave the house at least five minutes earlier than normal. Not needing to rush, reduces your risk of accidents, slips, and falls.\n\nIf you need to make a journey on foot, try to use pavements along main roads which are likely to be less slippery. Similarly, if cycling, try and stick to main roads which are more likely to have been treated.\n\nGive yourself the best chance of avoiding delays by checking road conditions if driving, or bus and train timetables, amending your travel plans if necessary.\n\nBe prepared for weather warnings to change: when a weather warning is issued, the Met Office recommends staying up to date with the weather forecast in your area. For further details see https://www.metoffice.gov.uk/weather/warnings-and-advice/uk-warnings","instruction":"What to expect: Probably some icy patches on some untreated roads, pavements and cycle paths; Some injuries from slips and falls on icy surfaces."}]}}
curl --location --request GET 'https://zylalabs.com/api/5589/real+time+weather+alerts+api/7237/get+weather+alerts?q=london' --header 'Authorization: Bearer YOUR_API_KEY'
| 标头 | 描述 |
|---|---|
授权
|
[必需] 应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。 |
无长期承诺。随时升级、降级或取消。 免费试用包括最多 50 个请求。
实时天气预警API提供来自可信政府机构的多种严重天气事件的通知,包括飓风、洪水、热浪和其他危险情况
要访问特定地点的天气警报,您可以在向 API 发出请求时提供地点查询(q),例如城市名称或地理坐标
实时天气警报API的天气警报以易读的JSON格式传递,使其易于集成到各种应用程序中
是的 该API支持多样的地理区域 允许开发者为美国 英国 欧洲及全球其他地区的用户提供本地化提醒
紧急规划者 物流公司 旅行应用程序和任何需要实时天气洞察的人都可以从这个API中受益,因为它帮助用户保持信息灵通并为恶劣天气条件做好准备
获取天气警报端点返回一个天气警报数组,包括警报类型、严重性和受影响区域等详细信息,以及城市名称、地区、国家和地理坐标等位置信息
响应中的关键字段包括“位置”(带有子字段,如名称、区域、国家、纬度、经度)和“警报”(包含一个警报对象数组,详细说明天气预警的性质)
响应数据采用JSON格式结构化,顶层对象包含“location”和“alerts”字段。“alerts”字段包含一个警报对象数组,每个对象详细说明特定的天气警报
获取天气警报接口的主要参数是“q”,可以接受城市名称或地理坐标(纬度和经度)来指定请求警报的位置
用户可以通过为“q”参数提供不同的值来定制他们的请求,从而允许他们获取不同位置的警报,无论是按城市名称还是特定坐标
实时天气警报API的数据来源于世界各地受信任的政府机构,确保警报在严重天气条件下是可靠和最新的
典型的使用案例包括将天气警报集成到旅行者的移动应用中 为物流公司提供实时更新 以及增强公共安全应用以支持应急规划者
如果API返回部分或空结果,这可能意味着指定位置没有活动警报。用户应在其应用程序中实施检查,以优雅地处理此类情况,也许通过通知用户当前没有可用的警报
服务级别:
100%
响应时间:
2,566ms
服务级别:
100%
响应时间:
198ms
服务级别:
100%
响应时间:
162ms
服务级别:
77%
响应时间:
315ms
服务级别:
100%
响应时间:
143ms
服务级别:
100%
响应时间:
1,287ms
服务级别:
100%
响应时间:
393ms
服务级别:
100%
响应时间:
875ms
服务级别:
100%
响应时间:
7,076ms
服务级别:
100%
响应时间:
11,987ms