Results 1 to 6 of 6

Thread: How do popular applications handle the API limit

  1. #1
    Forum Elder Colin94's Avatar
    Join Date
    Aug 2016
    Location
    Germany
    Posts
    2,193

    How do popular applications handle the API limit

    I read that you can have 10 requests per second per key. That means if I have an app that does a request every 5 minutes, I can have 5*60*10 = 3000 requests per key. I also read that we could register up to 5 keys. That means if I use all of them, I could have 15000 requests. Don't popular applications have more? Like ClashofStats, Minion Bot or Sidekick for example. I guess I should use my own database to reduce duplicate requests but it still looks like I'm missing something here.
    Last edited by Colin94; January 20th, 2020 at 03:23 PM.

  2. #2
    Most bots/sites will store the data previously retrieved from the API in a database. It will use this data for responding to user requests until a suitable period of time has elapsed and then the data will be queued to be updated again from the API. This means API calls are only being made for data that needs to be updated.
    Clash Ninja - Upgrade Tracker and Guides
    https://www.clash.ninja - Forum Thread

  3. #3
    Forum Elder Colin94's Avatar
    Join Date
    Aug 2016
    Location
    Germany
    Posts
    2,193
    So I could update the info of 3000 clans every 5m and request the data from my database every time someone wants to access it. Could be enough. I guess I'll wait and see how many players I can reach before I think more about that.
    Last edited by Colin94; January 20th, 2020 at 03:25 PM.

  4. #4
    Trainee
    Join Date
    Sep 2019
    Location
    Finland
    Posts
    23
    I read that you can have 10 requests per second per key
    Based on my measurements you can do 70-80 requests/second before throttling starts to limit your queries.

    I do not know what other limit types there are in SC API than throttling, maybe there are others as well but even with the throttling limit type there are different tiers for example developer/bronze, developer/silver, ... and maybe the throttling limits are not the same for all tiers!
    Last edited by tparviainen; January 21st, 2020 at 06:11 AM.
    .NET Standard library for Clash of Clans API @ https://github.com/tparviainen/clashofclans

  5. #5
    Centennial Club
    Join Date
    Feb 2016
    Posts
    195
    Hi! Adrien from Clash of Stats here . Indeed limit is more around 70 rps. Iíve tried with both regular keys and silver level keys, and the throttling seems to be the same in each case. Youíre actually limited to 10keys/account, and I have 2 accounts for Clash of Stats. I use a small throttling JS library to throttle each key, and each time I want to do a request to the API I use the key with the least number of request active.
    The throttle library uses Redis to sync between processes so my website API and my batches that collect info actually share the same pool of keys
    Hopes that helps!

  6. #6
    Forum Elder Colin94's Avatar
    Join Date
    Aug 2016
    Location
    Germany
    Posts
    2,193
    Thx for sharing that information.

    How do I get other keys than the regular keys? I didn't even know there where other keys lol

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •