Closed harshraj22 closed 1 year ago
No, which need your own customization
I opted for something like this
async def dynamic_rate_limiter(request: Request, response: Response):
# logic here, if free, else if premium ...
await RateLimiter(times=1, seconds=60)(request, response)
@router.get(
"/v1/dummy",
dependencies=[Depends(dynamic_rate_limiter)],
)
def get_dummy():
return {"dummy": "dummy"}
I want to have a subscription based api service. there are 3 types of subscription: Free: 10 api calls per 24hour Basic: 30 api calls per 24hour Advanced: 80 api calls per 24hour.
Along with the request body, suppose the detaiils about the subscription is also available. Can such scenario be handled by your library ? I am using fastapi, and I would prefer using a library than writing my own rate limiter using reddis.