3
7 Comments

Ask IH: How to limit API requests for per plans? [SaaS]

this product

Greetings all!

I have a technical question. I'm planning to publish the paid plans for BotDelive. But, I'm curious about what is the best practice to limit the quota and other specifications for each API. I will have 4 different monthly subscription plans that will have different offers.

Should I code the API limitation thing from scratch or use the services like Amazon API Gateway or something similar? What is your advice?

Thanks.

  1. 3

    What you're looking for is an API Gateway - tons out there and definitely worth using one instead of trying to roll your own

    Here's a massively popular open source gateway: https://konghq.com

    It'll do other key things like analytics, security etc.

    Having previously done an RFP for a client on gateways, I would say that Apigee is the best in the market - But not free!

    1. 1

      I will definitely check KongHQ. Thanks!

  2. 2

    Which language/framework have you used in the backend. I remember for our product - Cryptlex (https://cryptlex.com) it just took us few hours to add rate limiting support due to already existing libraries for our backend framework.

    Using Amazon API Gateway or any other service for this small feature seems like an overkill, and unnecessarily adds a vendor lock.

    1. 1

      I'm using NodeJS and ExpressJS. I think you're right. I will code it by myself. Do you have any library recommendation for NodeJS (if you're a user of it, of course)? Thank you. πŸ™

  3. 2

    You can build your own rate limiting for your APIs. Or you focus on your core product and try one of the API gateways to start (like Amazon one), a lot of them have free or low cost plans to start.

    If you getting a lot users and you feel that the API gateway cost is too high, you can always build your own later. Or pay, at least you have traction already. It is a nice problem to have.

    1. 1

      Yes, I think for the long-term perspective, I should code it from now. Thank you. 😊

  4. 1

    This is an old thread, but ranks high on google search as an informational piece. Hence I thought I'd add a few words (and insert a shameless plug at the end).

    As mentioned, API Gateway products such as AWS API Gateway, Apigee and Kong are all suitable tools as they have built-in support for rate limiting. To varying extents, they also allow you to implement quotas and usage plans. But there is considerable set up involved, and complexity to wrap your head around as they are a complete API management solution, not merely for limiting API requests.

    Now, on to the self promotion bit.


    I'm currently building Limiter, applimiter.com, which is a targeted solution that lets you apply limits and quotas to your SaaS products in less than 20 lines of code. If you are a solo maker, freelancer or small startup, and you have too much on your plates to roll out your own solution, do give this a shot :)