2

I have to get weather forecast for 7 days of a particular location(with postal code 94042). For this I make a HTTP request like this:

http://api.openweathermap.org/data/2.5/forecast/daily?q=94042&mode=json&units=metric&cnt=7

The result of the query is a long string in Json format. I did not post the result as it is messy, you can click the link to view the result:

There are some parts of the result about which I am confused.

  1. What does the dt field in the beginning of every element of the array list signify?

  2. What does the second last field deg of every element in the array list signify?

  3. What does the last field clouds followed by an integer signify? I thought description about clouds was covered in the main field?

John Slegers
  • 45,213
  • 22
  • 199
  • 169
Sumeet
  • 8,086
  • 3
  • 25
  • 45

1 Answers1

6

Explanation of the parameters: http://openweathermap.org/weather-data#current

dt: Data receiving time (in unix, UTC format). dt is the time of data receiving in unixtime GMT (greenwich mean time). To convert this value, use a 3rd-party library like momentjs.com or refer to this answer on how to convert it: https://stackoverflow.com/a/847196/3412545

deg: Wind direction (in degrees, meteorological)

clouds: cloudiness also known as cloud cover (in %)

Community
  • 1
  • 1
jojo
  • 1,135
  • 1
  • 15
  • 35
  • Can u please elaborate as to why we need the dt field? – Sumeet Jun 26 '15 at 06:26
  • The `dt` field is needed to show time of data acquisition relative to GMT. It's necessary to know how old the data is so that you can refresh the data if you so desire. – jojo Apr 28 '21 at 03:07