Code Monkey home page Code Monkey logo

cr-api's People

Contributors

fourjr avatar selfish avatar smlbiobot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cr-api's Issues

API Endpoint for card stats / description

Feature

[
  {
    "name_en": "Cannon Cart",
    "name_enum": "CANNON_CART",
    "image": "/cards/cannon_card.png",
    "id": 26000001,
    "rarity": "EPIC",
    "elixir": 4,
    "arenaid": 10,
    "type": "TROOP",
    "description": "blabla"
  },
  {
    "name_en": "Bandit",
    "name_enum": "BANDIT",
    "image": "/cards/bandit.png",
    "id": 26000000,
    "rarity": "LEGENDARY",
    "elixir": 3,
    "arenaid": 9,
    "type": "TROOP",
    "description": "blabla"
  }
]

Possibly include other details like: damage, health in additional fields.

Profile API: Fails with certain tags

This is a very odd issue. The API currently fails to fetch specific profile tags even though I have verified that their tags are correct.

Example:
http://api.cr-api.com/profile/LVJCL0

This member is currently in Reddit Echo:
http://api.cr-api.com/clan/LGVV2CG

And the clan api also reported his tag:

{
    "arena": {
        "arena": "League 2",
        "arenaID": 13,
        "imageURL": "/arena/league2.png",
        "name": "Challenger II",
        "trophyLimit": 4300
    },
    "clanChestCrowns": 38,
    "currentRank": 29,
    "donations": 951,
    "expLevel": 12,
    "name": "Z3RO",
    "previousRank": 30,
    "role": 1,
    "roleName": "Member",
    "score": 4315,
    "tag": "LVJCL0",
    "trophies": 4315
}

He has also verified that it is indeed the same tag on his profile.

This just might be those unfixable bugs…

Profile API : Missing fields

Some profiles have these two fields missing. Maybe because they have not unlocked the challenges yet.

"challengeMaxWins"
"challengeCardsWon"

Can these be put to 0, just like tournament keys?

Profile API: Players without clans: need better values

Either:

  • Return null for "clan"
  • Return null for each of the fields in "clan"

Current output is:

    "clan": {
        "tag": "",
        "role": "Unknown type: alliance.roles.undefined",
        "badgeUrl": "/badge/Unknown type: badges.NaN.png"
    },

which is not desirable.

a bunch of suggested stuff

image
image

a: "legendTrophies" is shown twice
b: in "stats", what does the "level" value mean (in this case, 15)
c: add first 10* chests to "chestCycle" when you get around to it
d: maybe just delete the "seasonNumber" value of "prevSeasons" and make it a list
e: change "accountAgeInDays" to reflect the actual account age, or for the key to be changed from "accountAgeInDays" to something different to represent the actual value
f: change name of cards in "currentDeck" to be exactly what the names are in the https://github.com/smlbiobot/cr-emoji-servers/ repo made by SML, for example, the emoji is named "the_log" in the api, but "the-log" in the repo.
g: if possible, for arena, add "legendary arena" somewhere to the "arena" value because right now it just shows "League 3" and "Challenger III"

*10 is just suggested, can be 5, 10, 20, however many you want to put

TopClans returns invalid clan tag

A clan tag returned by /top/clans is invalid according to the API.

http://api.cr-api.com/top/clans

http://api.cr-api.com/top/clans

        {
            "badge": {
                "filename": "flag_c_03.png",
                "key": "flag_c_03",
                "url": "/badge/flag_c_03.png"
            },
            "memberCount": 48,
            "name": "ジェンコ・オリーブ商会",
            "previousRank": 23,
            "rank": 15,
            "region": {
                "isCountry": "true",
                "name": "Japan"
            },
            "tag": "V0U",
            "trophies": 54910
        },

http://api.cr-api.com/clan/V0U

http://api.cr-api.com/clan/V0U

{
    "error": true,
    "message": "invalid: tag too short"
}

The other tags are fine. Not sure if related to #10

P.S. I included both versions of URLs just for you 😉

Update Docs + apps: Definition of draws

win 2v2 game (draw goes up)
lost 2v2 game (draw goes up)
drew 2v2 game (draw goes up)
won ladder game (win goes up)
lost ladder game (loss goes up)
drew ladder game (draw goes up)```

Multi-profile fetch

Am trying to use the new endpoints for fetching multiple profiles. However, even though the single profiles get returned successfully, the multiple profiles calls often result in an error. Worth looking into?

Example:

returns

{
    "error": "Service Unavailable, but will be back shortly."
}

while

all returns data successfully.

Given this, I will switch back to doing it manually but would love to switch to single call so as not to have to call multiple async requests

Request new Feature: Match details

Is it possible to add to the API a way to request match details like: Players, Decks, CardPlayed, position of the card played, time of the play... ?

Clan API: Returning wrong player tag.

http://api.cr-api.com/clan/VJQ0GJ0

Returning:

......
{  
   "name":"Raiven",
   "arena":{  
      "imageURL":"/arena/arena8.png",
      "arena":"Arena 8",
      "arenaID":8,
      "name":"Frozen Peak",
      "trophyLimit":2300
   },
   "role":1,
   "expLevel":7,
   "trophies":2336,
   "donations":0,
   "currentRank":46,
   "previousRank":46,
   "clanChestCrowns":33,
   "tag":"8220RQ9Y",
   "roleName":"Member",
   "score":2336
},
......

Actual In game tag:

screenshot_20170919-091726

Include clanChestTier in the clanChest section of the API

Refer to the wiki for tier amounts and all
Percent should also be 100 and not 1.

Currently

clanChest:
    clanChestCrowns: 1600
    clanChestCrownsPercent: 1
    clanChestCrownsRequired: 1600

Suggested

clanChest:
    clanChestCrowns: 1600
    clanChestCrownsPercent: __100__
    clanChestCrownsRequired: 1600
    __clanChestTier: 10__

Firefox nicely formats it for me so I didn't run a HTTP Request

Tags file

If someone want to collect data for some kind of analysis you need a lot of users tags (especially from tops arenas). Could be an idea publish weekly a file that contains just users tags instead that everyone is trying to collect tags by himself. That will be also helping to reduce the work for the API server

Profile API: Multi-fetch

Not a priority, but if at all possible, can we fetch up to 5 profiles in one call, similar to what we do in clan API?

Same syntax would be fine, e.g. tag1,tag2,tag3

Update badge section in response

switch this:

"badge_url": :/badge/Lotus_02.png",

Into:

badge: {
    "url": "/badge/Lotus_02.png",
    "filename": "Lotus_02.png",
    "key": "Lotus_02"
},

API Error pages

It would be great if we can have a collection of sample error pages that will be returned by the API. Make them always available if possible.

.e.g. api.cr-api.com/error/tag-not-found

Or whatever you decide is best.

At the moment, there is no way for me to reliably test error handling except when it happens. And having these pages available would allow me to deal with every single scenario, e.g.

  • profile tag not found
  • clan tag not found
  • api down
  • etc etc

Clan API: Missing currentRank in Members

You may have accidentally removed currentRank from the clan API:

http://api.cr-api.com/clan/2CCCP

     "members": [
        {
            "name": "cece",
            "arena": {
                "imageURL": "/arena/league5.png",
                "arena": "League 5",
                "arenaID": 16,
                "name": "Master II",
                "trophyLimit": 5200
            },
            "role": 3,
            "expLevel": 13,
            "trophies": 5201,
            "donations": 785,
            "previousRank": 1,
            "clanChestCrowns": 109,
            "tag": "UJPPP9UL",
            "roleName": "Elder",
            "score": 5201
        },

Profile API : additional chest cycle data

I know the profile API is WIP but I would like to point it out in case its forgotten

Current Data:

"chestCycle":{  
      "position":1175,
      "superMagicalPos":1295,
      "legendaryPos":1423,
      "epicPos":1483
   }

Would like to see these positions as well:

  • Silver chest position
  • Gold chest position
  • Giant chest position
  • Magical chest position

Player API: Clan Info

Is it possible to parse the Clan name as well? If it is just an additional call to the other part of the API, I can do it myself, depending on which is more expensive.

I think that we only need clan name and clan role though. People would want the same, probably. So in fact it might not be a bad idea, if you can do it from the API side, to output:

"clan" {
    "name": "XYZ",
    "tag": "CCGPLU9",
    "role": "Leader"
}

Clan Badges: Missing Assets

A few clan badges are not mapped.

  • 16000172
  • 16000177

Values are:

{
    "16000169": "Freeze_02",
    "16000170": "Clover_01",
    "16000171": "Clover_02",
    "16000172": "flag_h_04",
    "16000173": "flag_e_02",
    "16000174": "flag_i_03",
    "16000175": "flag_e_01",
    "16000176": "flag_e_02",
    "16000177": "A_Char_Prince_03",
    "16000178": "A_Char_Bomb_01",
    "16000179": "A_Char_Bomb_02"
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.