Grabbing a specific day's forecast in the near future

  • 1
  • Question
  • Updated 2 years ago
Hello there, I'm working on a student project using the Weather Underground API and I was hoping if any of the good folks here had used the API to deliver a forecast for a date specifically within the next 10 days!  I know there's a 10 day forecast that I may be able to just fanagle with some programming to produce the proper one but I was curious if there was any functionality like this built into the API.  Cheers!
Photo of Luke Schaefer

Luke Schaefer

  • 1 Post
  • 0 Reply Likes

Posted 2 years ago

  • 1
Photo of James Anding

James Anding

  • 76 Posts
  • 58 Reply Likes
Maybe someone will have a better answer than this, but this is how I did it. I think you are mostly right about the 10 day forecast. But since the return is always an array of "days and nights" it's pretty easy to figure out what day you want. The even numbers in the array 0,2,4,6,8,10 ...  are always the day forecast and the odd numbers are the nighttime forecast. So Day 0 is today forecast, Day 2 is tomorrow forecast etc.
Guess that not real pretty, but some nice coding can make it look good and work well. Sorry, if there is another way I don't know it, maybe someone else will correct me.