Results 1 to 9 of 9

Thread: A discussion about issues the API WITH reasonable suggestions. (Not new enhancements)

  1. #1

    Lightbulb A discussion about issues the API WITH reasonable suggestions. (Not new enhancements)

    I think most of us can agree that the API for the War Leagues at the moment is in bad shape to the point of being almost unusable. While this post is ostensibly geared toward fixing the War Leagues, I think there are some good passive changes that can be made to the other API end-points too.

    First let's discuss some of the prevailing issues with what we can easily see in the game but can't get via the API.


    • For non-league wars you can only get the currently active war. In the game you can go back and see the details for the past two wars (if they took place within the last 2-3 days). It would be nice to be able to go back to those wars via the API. The biggest problem with this is that if a clan starts war too fast after a war ends and the matchmaking gods match quickly you could end up with an unfinished war and never get the final end result.
    • Clan War League: There is no way to tell which members are actually participating in any given war. I realize there is a complication for prep days where the members can be switched at will, however I have a suggestion for this below.


    My suggestions for these two issues:


    • Clan War leagues introduced the concept of warTags! This is FANTASTIC! However I think these need to be extended to regular wars too, doing this would cover #1 above and allow us to look up war results by tag. Knowing that it's possible we could get a null result for wars that are too old and are no longer cached.
    • For the member list issue should be as simple as when getting the specific war it lists only those active in it. And during prepDay of a WarLeague War it should be part of documentation that the 15 listed could change and wouldn't be final until the war actually starts.


    /clans/{clanTag}/currentwar - Add warTag attribute.
    /clans/{clanTag}/warlog - Add warTag attribute to at least the wars that you can retrieve. null should be allowed for those that you can't.
    /clans/wars/{warTag} - NEW endpoint to get wars by warTag regardless of it being league or non-league. Add to the War object an attribute that indicates the type of war it is: Friendly, League, or Normal. This should only return the actual members of the war in league wars, knowing that throughout prep-day the member list could change.
    /clanwarleagues/wars/{warTag} - should be deprecated entirely in favor of the above
    /clans/{clanTag}/currentwar/leaguegroup - this one is perfect and should not be changed All of the members should remain listed in this endpoint.

    Any other thoughts from others who consume this API?

  2. #2
    Centennial Club
    Join Date
    Feb 2015
    Posts
    143
    "There is no way to tell which members are actually participating in any given war."

    I need this fixed to update my discord bot. It's literally the only thing stopping me. I would love war tags to be made available, but I suspect war tag are only relevant for league wars. Other things I really want updated, is the village opt in/out status for war, and whether a hero is upgrading or not. But the only thing I truly care about right now is not being able to tell what villages are in the current league war.

    I've posted here about it, on reddit, and messaged support in game and have gotten no response. If they'd at least acknowledge the issue, that would make me feel quite a bit better.
    Last edited by speakers; 2 Weeks Ago at 01:27 AM.

  3. #3
    @speakers, Complete agree there could be plenty of things that would be nice to have as an enhancement to the API, I would also like to have the Gold/Elixir values of each base so I could figure out war weights automatically. But I wanted to try to keep this to just things that are actively problematic with the API so as to hopefully get their attention and make it something doable more quickly than a bunch of nice-to-haves.

  4. #4

  5. #5
    Centennial Club
    Join Date
    Feb 2016
    Posts
    189
    Hey there Gnomesgames here from Clash of Stats! I agree with the requests especially the war tag!
    However for prepDay apparently in game you cannot see the selected enemy village till battle day, so giving them in the API on the day would be bad (it would give info not available ingame). But as soon as prep day finishes it should give only the selected like in game 🙂!

  6. #6
    Senior Member Agester's Avatar
    Join Date
    Jun 2014
    Posts
    463
    I'd like to add to the list that the current war during a CWL should show the actual current war and not stay in the preparation stage the entire length of the CWL other than the last match.
    "Some people talk to you in their free time while others free their time to talk to you. It's important to understand the difference" -Some internet guru

  7. #7
    Senior Member Agester's Avatar
    Join Date
    Jun 2014
    Posts
    463
    Quote Originally Posted by LightningSt0rm View Post
    /clans/wars/{warTag} - NEW endpoint to get wars by warTag regardless of it being league or non-league. Add to the War object an attribute that indicates the type of war it is: Friendly, League, or Normal.
    This would be great.
    "Some people talk to you in their free time while others free their time to talk to you. It's important to understand the difference" -Some internet guru

  8. #8
    Banned
    Join Date
    Apr 2015
    Location
    .
    Posts
    2,679
    A REST api for clashofclans is a bad idea. While it is useful for getting stats of a player, bots such as warmatch have to send a request every 10 minutes to get info on updated war attacks. This isn't the best method and can lead to memory problems while downloading the entire HTTP stream into memory.

    For live updates, WebSocket (https://en.wikipedia.org/wiki/WebSocket) is the best way, imo. Instead of having to send an HTTP request on intervals, you can connect to a websocket, and it sends data real time. This has many advantages:

    1) Supports JSON (JavaScript Object Notation) as well as ETF (Erlang Term Format) encoding.
    2) Reduces the constant HTTP requests to the API, reducing memory issues for both Supercell and the end user.
    3) Has real time datafeeds instead of intervals.

    WS isn't a new concept and is already used in production by a lot of companies, including Discord.

    A smaller alternative would be a webhook, after entering a URL, supercell will create a POST request to that URL, with details of an attack in the FormData. The user can identify the request coming from supercell with an HTTP Header (Authorization). However, websocket is still a safer and better way.

  9. #9
    Here we are in the 2nd war league and this is still a problem. Supercell, the API for war league is effectively unusable, we need desperately to fix the war players in active war.

Tags for this Thread

Posting Permissions

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