Discuss the Card Hunter API here

Discussion in 'API' started by Jon, Dec 19, 2013.

  1. Jon

    Jon Blue Manchu Staff Member

    Jayce and neoncat like this.
  2. Phaselock

    Phaselock Bugblatter

    erm, how to I query for battle data specific to player name ? Or do I have to process post-query ?
     
  3. Lusus121

    Lusus121 Goblin Champion

    Exited to see this. Thanks Jon!
     
  4. neoncat

    neoncat Feline Outline

    Sweeeeeeet!

    Hmmm.... I expect that you will hear much clamoring for access to player rating/ranking. I would guess that it makes the most sense to return that data with a battle query, if it's been stored at all.

    (Also, apologies, I will probably hit 150 queries very quickly as I poke at the API.)
     
  5. Jon

    Jon Blue Manchu Staff Member

    I don't believe that filtering is available yet but it's certainly something we could look at adding.
     
  6. Jon

    Jon Blue Manchu Staff Member

    Player rating is coming, yes.
     
    Qui11 and Flaxative like this.
  7. Phaselock

    Phaselock Bugblatter

    Great ! My first tots are targeted at the AI...tracking daily win rates on the wiki and rating fluctuations. Would also help see if changes to the AI behavior routines work, as well as lotsa other stuff... whee, fun times !!
     
  8. Kalin

    Kalin Begat G'zok

    I have no idea how I'm supposed to use this. I'm trying this URL:
    http://test-api.cardhunter.com/items?battle_id=155558&player_index=0&character_index=0

    And I'm getting I'm getting a completely different battle:

    Code:
    {"meta":{"total":155561,"first":"/items?count=10&page=first","last":"/items?count=10&page=last","prev":null,"next":"/items?count=10&page=next&demarc=9413:1:1:746"},"items":
    [{"id":"9413:1:0:152","battleId":9413,"playerIndex":1,"characterIndex":0,"itemId":152,"count":1},
    {"id":"9413:1:0:429","battleId":9413,"playerIndex":1,"characterIndex":0,"itemId":429,"count":1},
    {"id":"9413:1:0:1023","battleId":9413,"playerIndex":1,"characterIndex":0,"itemId":1023,"count":1},
    {"id":"9413:1:0:1521","battleId":9413,"playerIndex":1,"characterIndex":0,"itemId":1521,"count":1},
    {"id":"9413:1:0:1644","battleId":9413,"playerIndex":1,"characterIndex":0,"itemId":1644,"count":1},
    {"id":"9413:1:0:1673","battleId":9413,"playerIndex":1,"characterIndex":0,"itemId":1673,"count":1},
    {"id":"9413:1:0:100197","battleId":9413,"playerIndex":1,"characterIndex":0,"itemId":100197,"count":1},
    {"id":"9413:1:0:100294","battleId":9413,"playerIndex":1,"characterIndex":0,"itemId":100294,"count":1},
    {"id":"9413:1:0:100362","battleId":9413,"playerIndex":1,"characterIndex":0,"itemId":100362,"count":1},
    {"id":"9413:1:1:746","battleId":9413,"playerIndex":1,"characterIndex":1,"itemId":746,"count":1}]}
     
  9. neoncat

    neoncat Feline Outline

    There is no battle 15555 on the test server yet, so it's probably returning the latest battle, which is 9413.
     
  10. neoncat

    neoncat Feline Outline

  11. neoncat

    neoncat Feline Outline

  12. Kalin

    Kalin Begat G'zok

    Okay, trying it with test server IDs works better:
    http://test-api.cardhunter.com/items?battleId=180

    Note that I'm using "battleId" not "battle_id". Still can't change the player or character values.

    The question I was testing: "Is it possible to get items from a character during the battle?"
    The answer appears to be "Yes, but only the first character of the first player."

    PS. These last five posts should probably be a separate thread, maybe "Idiot's Guide to the API"
     
  13. Kalin

    Kalin Begat G'zok

    Is it time to update this thread? Or is it not ready for testing yet?
    api.png
     
    ParodyKnaveBob likes this.

Share This Page