了解 Json 格式的 openweathermap 结果
Understanding the Result from openweathermap in Json format
我必须获取特定位置 7 天的天气预报(使用 postal 代码 94042)。为此,我发出这样的 HTTP 请求:
http://api.openweathermap.org/data/2.5/forecast/daily?q=94042&mode=json&units=metric&cnt=7
查询结果是一个Json格式的长字符串。我没有post结果比较乱,大家可以点击link查看结果:
我对结果的某些部分感到困惑。
数组list每个元素开头的dt字段是什么意思?
数组list中每个元素的倒数第二个字段deg表示什么?
最后一个字段clouds后面跟着一个整数是什么意思?我以为 main 字段中包含有关云的描述?
参数说明:http://openweathermap.org/weather-data#current
dt
:数据接收时间(unix,UTC格式)。 dt
是unixtime GMT(格林威治标准时间)的数据接收时间。要转换此值,请使用像 momentjs.com or refer to this answer on how to convert it:
这样的第 3 方库
deg
:风向(以度为单位,气象)
clouds
: 云量也称为云量(%)
我必须获取特定位置 7 天的天气预报(使用 postal 代码 94042)。为此,我发出这样的 HTTP 请求:
http://api.openweathermap.org/data/2.5/forecast/daily?q=94042&mode=json&units=metric&cnt=7
查询结果是一个Json格式的长字符串。我没有post结果比较乱,大家可以点击link查看结果:
我对结果的某些部分感到困惑。
数组list每个元素开头的dt字段是什么意思?
数组list中每个元素的倒数第二个字段deg表示什么?
最后一个字段clouds后面跟着一个整数是什么意思?我以为 main 字段中包含有关云的描述?
参数说明:http://openweathermap.org/weather-data#current
dt
:数据接收时间(unix,UTC格式)。 dt
是unixtime GMT(格林威治标准时间)的数据接收时间。要转换此值,请使用像 momentjs.com or refer to this answer on how to convert it:
deg
:风向(以度为单位,气象)
clouds
: 云量也称为云量(%)