JSON
Example of API response
{
"coord": {
"lon": -122.08,
"lat": 37.39
},
"weather": [
{
"id": 800,
"main": "Clear",
"description": "clear sky",
"icon": "01d"
}
],
"base": "stations",
"main": {
"temp": 282.55,
"feels_like": 281.86,
"temp_min": 280.37,
"temp_max": 284.26,
"pressure": 1023,
"humidity": 100
},
"visibility": 16093,
"wind": {
"speed": 1.5,
"deg": 350
},
"clouds": {
"all": 1
},
"dt": 1560350645,
"sys": {
"type": 1,
"id": 5122,
"message": 0.0139,
"country": "US",
"sunrise": 1560343627,
"sunset": 1560396563
},
"timezone": -25200,
"id": 420006353,
"name": "Mountain View",
"cod": 200
}
Fields in API response
coord
coord.lon
City geo location, longitudecoord.lat
City geo location, latitude
weather
(more info Weather condition codes)weather.id
Weather condition idweather.main
Group of weather parameters (Rain, Snow, Extreme etc.)weather.description
Weather condition within the group. You can get the output in your language. Learn moreweather.icon
Weather icon id
base
Internal parametermain
main.temp
Temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.main.feels_like
Temperature. This temperature parameter accounts for the human perception of weather. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.main.pressure
Atmospheric pressure (on the sea level, if there is no sea_level or grnd_level data), hPamain.humidity
Humidity, %main.temp_min
Minimum temperature at the moment. This is minimal currently observed temperature (within large megalopolises and urban areas). Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.main.temp_max
Maximum temperature at the moment. This is maximal currently observed temperature (within large megalopolises and urban areas). Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.main.sea_level
Atmospheric pressure on the sea level, hPamain.grnd_level
Atmospheric pressure on the ground level, hPa
wind
wind.speed
Wind speed. Unit Default: meter/sec, Metric: meter/sec, Imperial: miles/hour.wind.deg
Wind direction, degrees (meteorological)wind.gust
Wind gust. Unit Default: meter/sec, Metric: meter/sec, Imperial: miles/hour
clouds
clouds.all
Cloudiness, %
rain
rain.1h
Rain volume for the last 1 hour, mmrain.3h
Rain volume for the last 3 hours, mm
snow
snow.1h
Snow volume for the last 1 hour, mmsnow.3h
Snow volume for the last 3 hours, mm
dt
Time of data calculation, unix, UTCsys
sys.type
Internal parametersys.id
Internal parametersys.message
Internal parametersys.country
Country code (GB, JP etc.)sys.sunrise
Sunrise time, unix, UTCsys.sunset
Sunset time, unix, UTC
timezone
Shift in seconds from UTCid
City IDname
City namecod
Internal parameter
XML
Example of API response
<current>
<city id="0" name="Mountain View">
<coord lon="-122.09" lat="37.39" />
<country>US</country>
<timezone>-28800</timezone>
<sun rise="2020-01-07T15:22:59" set="2020-01-08T01:05:37" />
</city>
<temperature value="278.07" min="273.15" max="282.59" unit="kelvin" />
<feels_like value="275.88" unit="kelvin" />
<humidity value="86" unit="%" />
<pressure value="1026" unit="hPa" />
<wind>
<speed value="0.93" unit="m/s" name="Calm" />
<gusts />
<direction value="23" code="NNE" name="North-northeast" />
</wind>
<clouds value="1" name="clear sky" />
<visibility value="16093" />
<precipitation mode="no" />
<weather number="800" value="clear sky" icon="01n" />
<lastupdate value="2020-01-07T11:33:40" />
</current>
Parameters:
city
city.id
City IDcity.name
City namecity.coord
city.coord.lon
City geo location, longitudecity.coord.lat
City geo location, latitude
city.country
Country code (GB, JP etc.)timezone
Shift in seconds from UTCcity.sun
city.sun.rise
Sunrise timecity.sun.set
Sunset time
temperature
temperature.value
Temperaturetemperature.min
Minimum temperature at the moment of calculation. This is minimal currently observed temperature (within large megalopolises and urban areas), use this parameter optionally.temperature.max
Maximum temperature at the moment of calculation. This is maximal currently observed temperature (within large megalopolises and urban areas), use this parameter optionally.temperature.unit
Unit of measurements. Possilbe valure is Celsius, Kelvin, Fahrenheit.
feels_like
feels_like.value
Temperature. This temperature parameter accounts for the human perception of weather.feels_like.unit
Unit of measurements. Possilbe valure is Celsius, Kelvin, Fahrenheit. Unit Default: Kelvin
humidity
humidity.value
Humidity valuehumidity.unit
Humidity units, %
pressure
pressure.value
Pressure valuepressure.unit
Pressure units, hPa
wind
wind.speed
wind.speed.value
Wind speedwind.speed.unit
Wind speed units, m/swind.speed.name
Type of the wind
wind.direction
wind.direction.value
Wind direction, degrees (meteorological)wind.direction.code
Code of the wind direction. Possilbe value is WSW, N, S etc.wind.direction.name
Full name of the wind direction.
clouds
clouds.value
Cloudinessclouds.name
Name of the cloudiness
visibility
visibility.value
Visibility, meter
precipitation
precipitation.value
Precipitation, mmprecipitation.mode
Possible values are 'no", name of weather phenomena as 'rain', 'snow'
weather
weather.number
Weather condition idweather.value
Weather condition nameweather.icon
Weather icon id
lastupdate
lastupdate.value
Last time when data was updated
沒有留言:
張貼留言