0

I have a "search" endpoint in my API that requires quite a lot of work in the backend.

For that reason, I've added a Rate limit per minutes (10 req/m) but I also would like to add a rate limit per day to avoid abuse.

The issue I'm facing is regarding the X-Rate-Limit headers. Which one do I display? Is there a technique to display two "values" like in my case?

halfer
  • 19,824
  • 17
  • 99
  • 186
Cyril N.
  • 38,875
  • 36
  • 142
  • 243

1 Answers1

1

My experience with the X-Rate-Limit header is limited to working with the League of Legends API.

According to their documentation here, rate limits are comma-separated and use the same unit of time. For instance, a rate limit of 100 calls per minute, and 500 calls per hour would be X-Rate-Limit-Count: 100:1,500:60 if minutes are your unit of time

They use seconds as their unit of time. I don't know whether or not this is standard practice or if any unit of time is acceptable. If seconds are preferred, the above example would look like X-Rate-Limit-Count: 100:60,500:3600.

CStrach
  • 88
  • 1
  • 7