1

The Xively API is rate-limited but I'm trying to understand what the limits are so that I can adjust my client accordingly. In fact there seems to be more than one limit: in some cases I see a 406 (Not acceptable) HTTP response, and other times I see a 403 (Rate too fast) HTTP response.

I think the 406 occurs when the number of API calls exceeds a certain rate - in my test the limit seems to be around 25 API calls per minute. The HTTP response includes a "Retry-After: 5" header. If my test queries more than one device the limit still seems to be 25 API calls per minute - I don't think this limit is per device. The 406 error code is not mentioned in the Xively API documentation.

The 403 error code is described in the Xively documentation: https://xively.com/dev/docs/api/communicating/usage_limits/

The page talks about per-device limits and suggests the limit is different for reading and writing but doesn't really give any more detail than that.

Can anyone shed any more light on what the limits actually are? I am currently using a development-mode account - it's possible the 406 error only occurs in development mode. However the link mentioned above suggests you can get the 403 error in production mode too.

errordeveloper
  • 6,716
  • 6
  • 41
  • 54
RobM
  • 49
  • 6
  • The 403/406 discrepancy turns out to be a red-herring: if the request includes an "accept: application/json" header you get a 403 response (with a JSON body) otherwise you get a 406 response. – RobM Oct 06 '14 at 09:56
  • After further testing it seems to the rate is limited to 25 requests per minute across a rolling 3-minute window. I have run tests that query a single device and two different devices - I can see no evidence that the rate limit is per-device. I have even tried using different API keys for each device, in case the rate was per API key. Neither can I see any evidence that the rate is different for reading or writing to a device - the results seem very similar in either case. – RobM Oct 06 '14 at 09:57

0 Answers0