-1

My plan is to fetch a bunch of different API's results and then nicely aggregate the results for users but I'm having trouble figuring out how to handle as many users as possible while not breaking any rules when using APIs I have access to. The plan was to use Flask/Python but the APIs have all a bit different limitations and I'd really appreciate any pointers how to handle that (across multiple workers).

API usage requirements (I might want to add more in the future):
API #1: 2 req/s
API #2: 10k req/mo
API #3: 100k req/mo

I thought about making a central controller that returns if the worker may use the APIs it needs but that sounds slow, would it?

davidism
  • 121,510
  • 29
  • 395
  • 339
Avamander
  • 497
  • 16
  • 31

1 Answers1

1

For these types of problems are good distributed task queues. On Python, popular task queue is Celery.

There you can setup periodic tasks or limiting task rate: How to put rate limit on a celery queue?.

Andrej Kesely
  • 168,389
  • 15
  • 48
  • 91