JSON Object - how to take forecast for an hour, how to for a day...

  • 1
  • Question
  • Updated 6 years ago
Hi,

I have written script which deals with downlaoding weather data from service. I use JSON format. Let's assume that I have URL like that:

http://api.wunderground.com/api/API_K...

For how long it gives me forecast? For an hour? For all day? How I can get info from JSON for what time it has been forecasted?

Thank you in advance
Photo of shakethatbutty

shakethatbutty

  • 9 Posts
  • 0 Reply Likes
  • confiused

Posted 6 years ago

  • 1
Photo of Brendan Hayes

Brendan Hayes, Official Rep

  • 962 Posts
  • 122 Reply Likes
add /forecast/ to your URL after /conditions/
Photo of shakethatbutty

shakethatbutty

  • 9 Posts
  • 0 Reply Likes
I do not get it. So what is the data what I have got so far? Isn't forecast? Where can I find a documentation with all possibile things?

Thanks in advance
Photo of afelicioni

afelicioni

  • 227 Posts
  • 43 Reply Likes
You can get all the info about allowed features at http://www.wunderground.com/weather/a...

One interesting thing is that you can combine two or more of them in a query.
Photo of shakethatbutty

shakethatbutty

  • 9 Posts
  • 0 Reply Likes
Right, I've already found it but I still cannot create URL which gives me forecast for next hour, for next 2 hours etc...
Photo of afelicioni

afelicioni

  • 227 Posts
  • 43 Reply Likes
if a simple answer is fine for this, you're just looking for hourlyor hourly10day feature:


hourly
Returns an hourly forecast for the next 36 hours immediately following the API request.
docs: http://www.wunderground.com/weather/a...
example: http://api.wunderground.com/api/YOURA...



hourly10day
Returns an hourly forecast for the next 10 days
docs: http://www.wunderground.com/weather/a...
example: http://api.wunderground.com/api/YOURA...
Photo of shakethatbutty

shakethatbutty

  • 9 Posts
  • 0 Reply Likes
Thank you very much !!!

But now, which parameter is precipitaion?

{
"FCTTIME": {
"hour": "15","hour_padded": "15","min": "00","sec": "0","year": "2012","mon": "11","mon_padded": "11","mon_abbrev": "Nov","mday": "27","mday_padded": "27","yday": "331","isdst": "0","epoch": "1354024800","pretty": "3:00 PM CET on November 27, 2012","civil": "3:00 PM","month_name": "November","month_name_abbrev": "Nov","weekday_name": "Tuesday","weekday_name_night": "Tuesday Night","weekday_name_abbrev": "Tue","weekday_name_unlang": "Tuesday","weekday_name_night_unlang": "Tuesday Night","ampm": "PM","tz": "","age": ""
},
"temp": {"english": "45", "metric": "7"},
"dewpoint": {"english": "43", "metric": "6"},
"condition": "Chance of Rain",
"icon": "chancerain",
"icon_url":"http://icons-ak.wxug.com/i/c/k/chance...",
"fctcode": "12",
"sky": "91",
"wspd": {"english": "4", "metric": "7"},
"wdir": {"dir": "WNW", "degrees": "284"},
"wx": "",
"uvi": "0",
"humidity": "91",
"windchill": {"english": "-9998", "metric": "-9998"},
"heatindex": {"english": "-9998", "metric": "-9998"},
"feelslike": {"english": "45", "metric": "7"},
"qpf": {"english": "", "metric": ""},
"snow": {"english": "", "metric": ""},
"pop": "20",
"mslp": {"english": "29.61", "metric": "1002"}
}
Photo of afelicioni

afelicioni

  • 227 Posts
  • 43 Reply Likes
An answer from a WU representative could be needed to clear this; the nearest I can guess is in qpf response struct with english values in inches and metric in millimeteres. Also when values are missing, could be equivalent to 0.00