Null results when calling the api

  • 1
  • Problem
  • Updated 6 months ago
For some reason the API often returns NULL  for certain values. These values are usually the once in the current forecast period (daypart). While I understand that it might not make much sense to return a forecast for the current period, it is offer and should not be NULL.

Even more confusing it is, that it sometimes returns values for the current period. My theory is, that there must be enough time left in the current period ... so it will return result for 1 or 2 hours post the daypart started and than stop doing it, return NULL.

Any reason behind it?
Photo of Enno Lueckel

Enno Lueckel

  • 21 Posts
  • 1 Reply Like

Posted 6 months ago

  • 1
Photo of Victoria Gardner

Victoria Gardner, Official Rep

  • 642 Posts
  • 91 Reply Likes
Enno, would you please provide some concrete examples?  I can't help without something to work with.

Be sure not to expose your API key.

You can also email me directly, but this may be of interest to others, so perhaps addressing it in public is better.

--Victoria
Photo of joegr

joegr

  • 22 Posts
  • 9 Reply Likes
Okay, here's some examples from right now.  That said, I thought that this was/is the way it is supposed to work.
https://api.weather.com/v3/wx/forecast/daily/5day?geocode=30.449631,-89.019246&units=e&langu...

...
"temperatureMax":[null,72,74,65,58,63],...
The max for the day has passed, so null is reported instead.

...iconCode":[null,27,11,47,4,4,39,12,26,26,26,27],...
Today's forecast is done, so it reports null for today's forecast icon.

At this moment, more than 40 nulls are being reported. However, it's not a problem if they are allowed for.



Photo of Victoria Gardner

Victoria Gardner, Official Rep

  • 642 Posts
  • 91 Reply Likes
That is how it's supposed to work.  But I wanted to make sure that was what Enno was seeing before I said so.

--Victoria