Include Brief Usage Statistics in Every Call Response

  • 8
  • Idea
  • Updated 5 years ago
Some people have suggested adding an API to request your license's current usage statistics (number of calls today/this minute). This doesn't make a whole lot of sense because you would have to perform an extra call just to find out if you can perform another call.

What would make more sense is to just give a current count in the response for each call that tells how many calls you have made recently. Something like this:

{
"response": {
"version": "0.1"
,"termsofService": "http://www.wunderground.com/weather/a..."
,"features": {
"history": 1
}
},
"usage": {
"today": 123,
"lastMinute": 4,
"lastCall": 1348680065 // unix timestamp
},
"history": {
... rest of response ...
}
}

(Notice the "usage" structure that I added.)

If calculating this on the fly is too much data crunching for the Wunderground servers, then maybe instead of returning it for every response only return it for responses that have an additional GET parameter, something like:

http://api.wunderground.com/api/your_...
Photo of CodeCommander

CodeCommander

  • 8 Posts
  • 1 Reply Like

Posted 6 years ago

  • 8
Photo of Brendan Hayes

Brendan Hayes, Official Rep

  • 962 Posts
  • 123 Reply Likes
This is a great idea, and I like how you've thought it out that way. I'll be sure to share this as we move into development.
Photo of afelicioni

afelicioni

  • 227 Posts
  • 43 Reply Likes
Good request!
can I post some pluses?

The request for usage struct in response could inherit existing settings format, like pws:0 or pws:1, so if developers make their function or class to make dynamic URLs to consume api could think about just one way to set up requests;

I think would be interesting also to include remaining API call quota for day and minute basis, if possible, and if "raindrop" system has been triggered.

Cheers
Photo of CodeCommander

CodeCommander

  • 8 Posts
  • 1 Reply Like
Hi there,

Has there been any progress on this issue? We have some checks in place in our client to try and prevent more than 100 calls per minute, but recently we have been using raindrops. It would make things a lot easier if we could just see our minutely/daily usage with each request instead of trying to calculate it without knowing the exact algorithm Weather Underground uses on their side.