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
coordcoord.lonCity geo location, longitudecoord.latCity geo location, latitude
weather(more info Weather condition codes)weather.idWeather condition idweather.mainGroup of weather parameters (Rain, Snow, Extreme etc.)weather.descriptionWeather condition within the group. You can get the output in your language. Learn moreweather.iconWeather icon id
baseInternal parametermainmain.tempTemperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.main.feels_likeTemperature. This temperature parameter accounts for the human perception of weather. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.main.pressureAtmospheric pressure (on the sea level, if there is no sea_level or grnd_level data), hPamain.humidityHumidity, %main.temp_minMinimum 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_maxMaximum 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_levelAtmospheric pressure on the sea level, hPamain.grnd_levelAtmospheric pressure on the ground level, hPa
windwind.speedWind speed. Unit Default: meter/sec, Metric: meter/sec, Imperial: miles/hour.wind.degWind direction, degrees (meteorological)wind.gustWind gust. Unit Default: meter/sec, Metric: meter/sec, Imperial: miles/hour
cloudsclouds.allCloudiness, %
rainrain.1hRain volume for the last 1 hour, mmrain.3hRain volume for the last 3 hours, mm
snowsnow.1hSnow volume for the last 1 hour, mmsnow.3hSnow volume for the last 3 hours, mm
dtTime of data calculation, unix, UTCsyssys.typeInternal parametersys.idInternal parametersys.messageInternal parametersys.countryCountry code (GB, JP etc.)sys.sunriseSunrise time, unix, UTCsys.sunsetSunset time, unix, UTC
timezoneShift in seconds from UTCidCity IDnameCity namecodInternal 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:
citycity.idCity IDcity.nameCity namecity.coordcity.coord.lonCity geo location, longitudecity.coord.latCity geo location, latitude
city.countryCountry code (GB, JP etc.)timezoneShift in seconds from UTCcity.suncity.sun.riseSunrise timecity.sun.setSunset time
temperaturetemperature.valueTemperaturetemperature.minMinimum temperature at the moment of calculation. This is minimal currently observed temperature (within large megalopolises and urban areas), use this parameter optionally.temperature.maxMaximum temperature at the moment of calculation. This is maximal currently observed temperature (within large megalopolises and urban areas), use this parameter optionally.temperature.unitUnit of measurements. Possilbe valure is Celsius, Kelvin, Fahrenheit.
feels_likefeels_like.valueTemperature. This temperature parameter accounts for the human perception of weather.feels_like.unitUnit of measurements. Possilbe valure is Celsius, Kelvin, Fahrenheit. Unit Default: Kelvin
humidityhumidity.valueHumidity valuehumidity.unitHumidity units, %
pressurepressure.valuePressure valuepressure.unitPressure units, hPa
windwind.speedwind.speed.valueWind speedwind.speed.unitWind speed units, m/swind.speed.nameType of the wind
wind.directionwind.direction.valueWind direction, degrees (meteorological)wind.direction.codeCode of the wind direction. Possilbe value is WSW, N, S etc.wind.direction.nameFull name of the wind direction.
cloudsclouds.valueCloudinessclouds.nameName of the cloudiness
visibilityvisibility.valueVisibility, meter
precipitationprecipitation.valuePrecipitation, mmprecipitation.modePossible values are 'no", name of weather phenomena as 'rain', 'snow'
weatherweather.numberWeather condition idweather.valueWeather condition nameweather.iconWeather icon id
lastupdatelastupdate.valueLast time when data was updated
沒有留言:
張貼留言