[portland] Creating an API with Metered Billing

Jeff Schwaber freyley at gmail.com
Thu Sep 17 01:56:40 CEST 2015


That's super interesting!

I haven't done usage limits, but I've played with the throttling stuff of
Django Rest Framework:
http://www.django-rest-framework.org/api-guide/throttling/ and you could
definitely put usage counting in there. Once you've got usage counting,
limits seem like a simple step inside that framework.

The big challenge is going to be that, naively, now all of your API
requests are database updates, and from a scalability point of view, that
sucks. Of course you could make them logging statements instead and then
have a background process reading the log to generate the current counts,
but then you'll be behind a bit, so users may bounce over the limits a bit.

Jeff

On Wed, Sep 16, 2015 at 4:44 PM, Jason Champion <jchampion at zetacentauri.com>
wrote:

> Question:
>
> Does anyone have any experience with creating APIs that have usage limits
> and metered billing? Can you suggest any good articles/howtos/resources on
> the subject?
>
> I've created plenty of APIs (REST, XMLRPC, etc.), but they've always been
> open to all with no auth or billing.
>
> Thank you,
> Jason
> _______________________________________________
> Portland mailing list
> Portland at python.org
> https://mail.python.org/mailman/listinfo/portland
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/portland/attachments/20150916/d54c2d38/attachment.html>


More information about the Portland mailing list