这个API可以帮助您获取当前天气数据以及预测数据。您可以查看接下来的五天和十六天的天气!
这个API可以接收我们想要查看的城市的邮政编码、城市名称,或者地点的经纬度。所有这些信息将为我们提供当前或预测天气的详细数据。
这个API非常适合那些希望将气候信息与他们的应用程序集成的公司,或者将其集成到他们的网站中。
这个API也可以帮助多个组织查看预测天气,并根据他们的活动确定气候条件是否适宜。
除了每月的API调用限制:
使用这个端点可以从您选择的任何地点获取当前天气信息
您将收到实际天气状况、温度、体感温度、风速等信息
您可以通过城市名称或经纬度进行更精确的查询
此端点将根据公制或英制系统检索数据。此外,您可以选择以JSON或XML格式接收数据
输出JSON响应示例:
{
"coord": {
"lon": -71.0598,
"lat": 42.3584
},
"weather": [
{
"id": 803,
"main": "云",
"description": "破碎的云",
"icon": "04d"
}
],
"base": "站点",
"main": {
"temp": 301.78,
"feels_like": 302.92,
"temp_min": 299.23,
"temp_max": 303.93,
"pressure": 1013,
"humidity": 55
},
"visibility": 10000,
"wind": {
"speed": 4.12,
"deg": 240,
"gust": 8.23
},
"clouds": {
"all": 75
},
"dt": 1657304108,
"sys": {
"type": 2,
"id": 2013408,
"country": "美国",
"sunrise": 1657271716,
"sunset": 1657326177
},
"timezone": -14400,
"id": 4930956,
"name": "波士顿",
"cod": 200
}
当前天气 - 端点功能
| 对象 | 描述 |
|---|---|
q |
[必需] The name of the city and country you want to check data from. EX: boston,US |
lat |
可选 Insert the latitude of the city you want to check data from. EX: 37.774929 |
long |
可选 Insert the longitude of the city you want to check data from. EX: -122.419418 |
units |
可选 You can use different types of metric systems by units = metric or imperial |
lang |
可选 You can use lang parameter to get output in your language. We support the following languages that you can use with the corresponded lang values: English - en, Russian - ru, Italian - it, Spanish - sp, Ukrainian - ua, German - de, Portuguese - pt, Romanian - ro, Polish - pl, Finnish - fi, Dutch - nl, French - fr, Bulgarian - bg, Swedish - se, Chinese Traditional - zhtw, Chinese Simplified - zhcn, Turkish - tr |
mode |
可选 If left blank will default to JSON output. Ability to retrieve data in XML or HTML. |
{"coord":{"lon":150.6,"lat":-34.9667},"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],"base":"stations","main":{"temp":16.6,"feels_like":15.7,"temp_min":16.07,"temp_max":18.36,"pressure":1005,"humidity":53},"visibility":10000,"wind":{"speed":6.71,"deg":280,"gust":9.83},"clouds":{"all":21},"dt":1687491111,"sys":{"type":2,"id":2010723,"country":"AU","sunrise":1687467934,"sunset":1687503217},"timezone":36000,"id":2166893,"name":"Falls Creek","cod":200}
curl --location --request GET 'https://zylalabs.com/api/39/current+weather+and+forecasted+weather+api/111/current+weather?q=boston,US&units=metric&lang=en&mode=json' --header 'Authorization: Bearer YOUR_API_KEY'
此端点将允许您以每3小时的间隔获取未来5天的预测数据
因此,您将能够通过获取每3小时的间隔信息来查看未来几天气候将如何变化
在此端点中,您可以通过城市名称、纬度和经度以及邮政编码进行查询
输出JSON响应示例:
{
"cod": "200",
"message": 0,
"cnt": 40,
"list": [
{
"dt": 1657314000,
"main": {
"temp": 292.44,
"feels_like": 292.25,
"temp_min": 292.3,
"temp_max": 292.44,
"pressure": 1018,
"sea_level": 1018,
"grnd_level": 1015,
"humidity": 70,
"temp_kf": 0.14
},
"weather": [
{
"id": 801,
"main": "Clouds",
"description": "few clouds",
"icon": "02d"
}
],
"clouds": {
"all": 15
},
"wind": {
"speed": 5.99,
"deg": 264,
"gust": 8.73
},
"visibility": 10000,
"pop": 0,
"sys": {
"pod": "d"
},
"dt_txt": "2022-07-08 21:00:00"
}预测数据 - 五天 - 端点功能
| 对象 | 描述 |
|---|---|
q |
[必需] The name of the city and country you want to check data from. EX: boston,US |
units |
可选 You can use different types of metric systems by units = metric or imperial |
mode |
可选 If left blank will default to JSON output. Ability to retrieve data in XML or HTML. |
lat |
可选 Insert the latitude of the city you want to check data from. EX: 37.774929 |
long |
可选 Insert the longitude of the city you want to check data from. EX: -122.419418 |
lang |
可选 You can use lang parameter to get output in your language. We support the following languages that you can use with the corresponded lang values: English - en, Russian - ru, Italian - it, Spanish - sp, Ukrainian - ua, German - de, Portuguese - pt, Romanian - ro, Polish - pl, Finnish - fi, Dutch - nl, French - fr, Bulgarian - bg, Swedish - se, Chinese Traditional - zhtw, Chinese Simplified - zhcn, Turkish - tr |
zip |
可选 The ZIP code of the city you want to check data from. |
{"cod":"200","message":0,"cnt":40,"list":[{"dt":1667250000,"main":{"temp":16.32,"feels_like":16.04,"temp_min":15.48,"temp_max":16.32,"pressure":1013,"sea_level":1013,"grnd_level":1010,"humidity":78,"temp_kf":0.84},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"clouds":{"all":75},"wind":{"speed":1.32,"deg":232,"gust":1.51},"visibility":10000,"pop":0,"sys":{"pod":"d"},"dt_txt":"2022-10-31 21:00:00"},{"dt":1667260800,"main":{"temp":15.72,"feels_like":15.33,"temp_min":14.51,"temp_max":15.72,"pressure":1012,"sea_level":1012,"grnd_level":1009,"humidity":76,"temp_kf":1.21},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"clouds":{"all":83},"wind":{"speed":2.72,"deg":265,"gust":3.04},"visibility":10000,"pop":0,"sys":{"pod":"d"},"dt_txt":"2022-11-01 00:00:00"},{"dt":1667271600,"main":{"temp":13.69,"feels_like":13.31,"temp_min":12.38,"temp_max":13.69,"pressure":1012,"sea_level":1012,"grnd_level":1009,"humidity":84,"temp_kf":1.31},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"clouds":{"all":72},"wind":{"speed":3.33,"deg":243,"gust":4.44},"visibility":10000,"pop":0,"sys":{"pod":"n"},"dt_txt":"2022-11-01 03:00:00"},{"dt":1667282400,"main":{"temp":12,"feels_like":11.63,"temp_min":12,"temp_max":12,"pressure":1012,"sea_level":1012,"grnd_level":1010,"humidity":91,"temp_kf":0},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"clouds":{"all":51},"wind":{"speed":3.53,"deg":242,"gust":5.17},"visibility":10000,"pop":0,"sys":{"pod":"n"},"dt_txt":"2022-11-01 06:00:00"},{"dt":1667293200,"main":{"temp":13.04,"feels_like":12.72,"temp_min":13.04,"temp_max":13.04,"pressure":1011,"sea_level":1011,"grnd_level":1009,"humidity":89,"temp_kf":0},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"clouds":{"all":81},"wind":{"speed":3.84,"deg":216,"gust":5.57},"visibility":10000,"pop":0,"sys":{"pod":"n"},"dt_txt":"2022-11-01 09:00:00"},{"dt":1667304000,"main":{"temp":12.95,"feels_like":12.62,"temp_min":12.95,"temp_max":12.95,"pressure":1010,"sea_level":1010,"grnd_level":1008,"humidity":89,"temp_kf":0},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"clouds":{"all":79},"wind":{"speed":3.71,"deg":201,"gust":5.92},"visibility":10000,"pop":0,"sys":{"pod":"n"},"dt_txt":"2022-11-01 12:00:00"},{"dt":1667314800,"main":{"temp":12.86,"feels_like":12.47,"temp_min":12.86,"temp_max":12.86,"pressure":1009,"sea_level":1009,"grnd_level":1007,"humidity":87,"temp_kf":0},"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"clouds":{"all":89},"wind":{"speed":4.6,"deg":161,"gust":7.11},"visibility":10000,"pop":0.03,"sys":{"pod":"d"},"dt_txt":"2022-11-01 15:00:00"},{"dt":1667325600,"main":{"temp":12.61,"feels_like":12.2,"temp_min":12.61,"temp_max":12.61,"pressure":1010,"sea_level":1010,"grnd_level":1008,"humidity":87,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":94},"wind":{"speed":6.09,"deg":265,"gust":11.73},"visibility":7480,"pop":0.66,"rain":{"3h":1.6},"sys":{"pod":"d"},"dt_txt":"2022-11-01 18:00:00"},{"dt":1667336400,"main":{"temp":11.6,"feels_like":10.8,"temp_min":11.6,"temp_max":11.6,"pressure":1010,"sea_level":1010,"grnd_level":1008,"humidity":76,"temp_kf":0},"weather":[{"id":501,"main":"Rain","description":"moderate rain","icon":"10d"}],"clouds":{"all":100},"wind":{"speed":7.71,"deg":276,"gust":11.22},"visibility":10000,"pop":1,"rain":{"3h":5.53},"sys":{"pod":"d"},"dt_txt":"2022-11-01 21:00:00"},{"dt":1667347200,"main":{"temp":12.15,"feels_like":11.38,"temp_min":12.15,"temp_max":12.15,"pressure":1011,"sea_level":1011,"grnd_level":1009,"humidity":75,"temp_kf":0},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"clouds":{"all":64},"wind":{"speed":8.21,"deg":276,"gust":11.59},"visibility":10000,"pop":0.8,"sys":{"pod":"d"},"dt_txt":"2022-11-02 00:00:00"},{"dt":1667358000,"main":{"temp":11.35,"feels_like":10.53,"temp_min":11.35,"temp_max":11.35,"pressure":1014,"sea_level":1014,"grnd_level":1012,"humidity":76,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"clouds":{"all":2},"wind":{"speed":6.53,"deg":283,"gust":10.21},"visibility":10000,"pop":0,"sys":{"pod":"n"},"dt_txt":"2022-11-02 03:00:00"},{"dt":1667368800,"main":{"temp":11.12,"feels_like":10.27,"temp_min":11.12,"temp_max":11.12,"pressure":1016,"sea_level":1016,"grnd_level":1014,"humidity":76,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"clouds":{"all":10},"wind":{"speed":4.36,"deg":271,"gust":6.44},"visibility":10000,"pop":0,"sys":{"pod":"n"},"dt_txt":"2022-11-02 06:00:00"},{"dt":1667379600,"main":{"temp":10.82,"feels_like":9.99,"temp_min":10.82,"temp_max":10.82,"pressure":1016,"sea_level":1016,"grnd_level":1015,"humidity":78,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10n"}],"clouds":{"all":98},"wind":{"speed":3.47,"deg":265,"gust":5.68},"visibility":10000,"pop":0.35,"rain":{"3h":0.51},"sys":{"pod":"n"},"dt_txt":"2022-11-02 09:00:00"},{"dt":1667390400,"main":{"temp":10.69,"feels_like":9.75,"temp_min":10.69,"temp_max":10.69,"pressure":1017,"sea_level":1017,"grnd_level":1015,"humidity":74,"temp_kf":0},"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}],"clouds":{"all":99},"wind":{"speed":3.17,"deg":271,"gust":4.32},"visibility":10000,"pop":0.33,"sys":{"pod":"n"},"dt_txt":"2022-11-02 12:00:00"},{"dt":1667401200,"main":{"temp":10.23,"feels_like":9.21,"temp_min":10.23,"temp_max":10.23,"pressure":1018,"sea_level":1018,"grnd_level":1016,"humidity":73,"temp_kf":0},"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"clouds":{"all":97},"wind":{"speed":2.83,"deg":281,"gust":3.76},"visibility":10000,"pop":0.04,"sys":{"pod":"d"},"dt_txt":"2022-11-02 15:00:00"},{"dt":1667412000,"main":{"temp":12.09,"feels_like":10.97,"temp_min":12.09,"temp_max":12.09,"pressure":1019,"sea_level":1019,"grnd_level":1017,"humidity":62,"temp_kf":0},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"clouds":{"all":84},"wind":{"speed":3.29,"deg":281,"gust":4.32},"visibility":10000,"pop":0,"sys":{"pod":"d"},"dt_txt":"2022-11-02 18:00:00"},{"dt":1667422800,"main":{"temp":12.61,"feels_like":11.44,"temp_min":12.61,"temp_max":12.61,"pressure":1018,"sea_level":1018,"grnd_level":1016,"humidity":58,"temp_kf":0},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"clouds":{"all":37},"wind":{"speed":5.36,"deg":274,"gust":6.46},"visibility":10000,"pop":0,"sys":{"pod":"d"},"dt_txt":"2022-11-02 21:00:00"},{"dt":1667433600,"main":{"temp":11.73,"feels_like":10.66,"temp_min":11.73,"temp_max":11.73,"pressure":1018,"sea_level":1018,"grnd_level":1016,"humidity":65,"temp_kf":0},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"clouds":{"all":47},"wind":{"speed":6.19,"deg":281,"gust":8.05},"visibility":10000,"pop":0,"sys":{"pod":"d"},"dt_txt":"2022-11-03 00:00:00"},{"dt":1667444400,"main":{"temp":10.93,"feels_like":9.91,"temp_min":10.93,"temp_max":10.93,"pressure":1018,"sea_level":1018,"grnd_level":1016,"humidity":70,"temp_kf":0},"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02n"}],"clouds":{"all":21},"wind":{"speed":6.45,"deg":293,"gust":9.8},"visibility":10000,"pop":0.01,"sys":{"pod":"n"},"dt_txt":"2022-11-03 03:00:00"},{"dt":1667455200,"main":{"temp":10.8,"feels_like":9.71,"temp_min":10.8,"temp_max":10.8,"pressure":1018,"sea_level":1018,"grnd_level":1016,"humidity":68,"temp_kf":0},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"clouds":{"all":59},"wind":{"speed":6.32,"deg":294,"gust":9.7},"visibility":10000,"pop":0,"sys":{"pod":"n"},"dt_txt":"2022-11-03 06:00:00"},{"dt":1667466000,"main":{"temp":9.94,"feels_like":6.85,"temp_min":9.94,"temp_max":9.94,"pressure":1018,"sea_level":1018,"grnd_level":1016,"humidity":73,"temp_kf":0},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"clouds":{"all":66},"wind":{"speed":7.03,"deg":306,"gust":9.56},"visibility":10000,"pop":0.04,"sys":{"pod":"n"},"dt_txt":"2022-11-03 09:00:00"},{"dt":1667476800,"main":{"temp":8.72,"feels_like":6.25,"temp_min":8.72,"temp_max":8.72,"pressure":1018,"sea_level":1018,"grnd_level":1016,"humidity":74,"temp_kf":0},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03n"}],"clouds":{"all":49},"wind":{"speed":4.38,"deg":344,"gust":8.15},"visibility":10000,"pop":0,"sys":{"pod":"n"},"dt_txt":"2022-11-03 12:00:00"},{"dt":1667487600,"main":{"temp":7.81,"feels_like":6.06,"temp_min":7.81,"temp_max":7.81,"pressure":1020,"sea_level":1020,"grnd_level":1018,"humidity":73,"temp_kf":0},"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],"clouds":{"all":23},"wind":{"speed":2.73,"deg":349,"gust":3.12},"visibility":10000,"pop":0,"sys":{"pod":"d"},"dt_txt":"2022-11-03 15:00:00"},{"dt":1667498400,"main":{"temp":10.18,"feels_like":8.79,"temp_min":10.18,"temp_max":10.18,"pressure":1022,"sea_level":1022,"grnd_level":1020,"humidity":59,"temp_kf":0},"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],"clouds":{"all":16},"wind":{"speed":2.07,"deg":355,"gust":2.87},"visibility":10000,"pop":0,"sys":{"pod":"d"},"dt_txt":"2022-11-03 18:00:00"},{"dt":1667509200,"main":{"temp":11.88,"feels_like":10.43,"temp_min":11.88,"temp_max":11.88,"pressure":1022,"sea_level":1022,"grnd_level":1020,"humidity":50,"temp_kf":0},"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],"clouds":{"all":11},"wind":{"speed":2.65,"deg":289,"gust":3.58},"visibility":10000,"pop":0,"sys":{"pod":"d"},"dt_txt":"2022-11-03 21:00:00"},{"dt":1667520000,"main":{"temp":11.77,"feels_like":10.52,"temp_min":11.77,"temp_max":11.77,"pressure":1021,"sea_level":1021}}],"_note":"Response truncated for documentation purposes"}
curl --location --request GET 'https://zylalabs.com/api/39/current+weather+and+forecasted+weather+api/112/forecasted+data+-+five+days?q=san francisco, US&units=metric&mode=json&lang=en' --header 'Authorization: Bearer YOUR_API_KEY'
| 标头 | 描述 |
|---|---|
授权
|
[必需] 应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。 |
无长期承诺。随时升级、降级或取消。 免费试用包括最多 50 个请求。
当前天气端点返回实时天气状况,包括温度、湿度、风速和天气描述 五天预测端点提供每三小时的预测数据,详细列出接下来五天的温度、湿度、风速和天气描述
关键字段包括“temp”(温度)、 “feels_like”(体感温度)、 “humidity”(湿度水平)、 “wind”(风速和方向)以及“weather”(天气状况,如晴天或多云)。每个字段提供了关于当前和预测天气的重要见解
响应数据以JSON格式组织,包含嵌套对象以提供详细信息。例如,“main”对象包含温度和湿度,而“weather”数组提供条件的描述和图标,便于解析和使用
用户可以使用城市名称、邮政编码或地理坐标(纬度和经度)等参数查询端点。这种灵活性允许在获取天气数据时进行精准的位置定位
当前天气接口提供当前气象状况,包括温度、风速和天气描述 五天预报接口提供详细的天气预报,包括温度变化、湿度水平和每三小时的风况
用户可以通过指定位置参数(城市名称、邮政编码或坐标)来自定义请求,并选择公制或英制单位。此外,他们可以选择响应格式为JSON或XML,以满足他们的应用需求
该API从各种气象来源聚合天气数据,确保全面覆盖和准确性 数据定期更新以反映当前条件和预测,保持高质量和可靠性
常见的用例包括将天气信息集成到移动应用程序、网站和仪表板中 企业可以利用这些数据根据天气条件进行活动规划 而个人则可以查询旅行或户外活动的天气预报
服务级别:
100%
响应时间:
11,987ms
服务级别:
100%
响应时间:
875ms
服务级别:
100%
响应时间:
7,076ms
服务级别:
100%
响应时间:
400ms
服务级别:
100%
响应时间:
838ms
服务级别:
100%
响应时间:
1,015ms
服务级别:
100%
响应时间:
233ms
服务级别:
100%
响应时间:
830ms
服务级别:
100%
响应时间:
992ms
服务级别:
100%
响应时间:
746ms
服务级别:
100%
响应时间:
1,254ms
服务级别:
83%
响应时间:
564ms
服务级别:
100%
响应时间:
159ms
服务级别:
100%
响应时间:
39ms
服务级别:
100%
响应时间:
97ms
服务级别:
100%
响应时间:
112ms
服务级别:
100%
响应时间:
121ms
服务级别:
100%
响应时间:
498ms
服务级别:
100%
响应时间:
517ms
服务级别:
100%
响应时间:
445ms