Add odds of hitting rate-limit to every response

Many people want to know what the rate limit when calling any square API endpoint, and I see that square staff do not want to share that info.

Until they change their mind, I’m thinking they should add to the output of every request something that would indicate the odds of one hitting their rate limit.

For example.

maybe add a key named “limitreachability” with one of the following values:

0 = Nothing to worry about. Make tons of requests if you want.
1 = You put some load on the server. try to slow down
2 = You’re being a little aggressive. Slow down.
3 = You better add delays to your code. you could be rate limited real soon.

etc.

Just something so people have an idea where they stand.

Why? because trying to do an exponential back-off on the server PHP script could create large delays for the end customer depending on the steps in the backoff. Its worse if the increment in the backoff is small.

We’re constantly working to improve our features based on feedback like this, so I’ll be sure to share your request to the API product team. :slightly_smiling_face:

Many people want to know what the rate limit when calling any square API endpoint, and I see that square staff do not want to share that info.

Until they change their mind, I’m thinking they should add to the output of every request something that would indicate the odds of one hitting their rate limit.

For example.

maybe add a key named “limitreachability” with one of the following values:

0 = Nothing to worry about. Make tons of requests if you want.
1 = You put some load on the server. try to slow down
2 = You’re being a little aggressive. Slow down.
3 = You better add delays to your code. you could be rate limited real soon.

etc.

Just something so people have an idea where they stand.

Why? because trying to do an exponential back-off on the server PHP script could create large delays for the end customer depending on the steps in the backoff. Its worse if the increment in the backoff is small.