deckstats.net

Author Topic: Deckstats API?  (Read 478 times)

ascii_

  • New Member
  • *
  • Posts: 3
  • Karma: 7
    • View Profile
  • Decks
Deckstats API?
« on: November 05, 2018, 10:34:18 pm »
Hello, sorry if this is the wrong place to ask, but it seemed like the closet. But does Deckstats have any sorta api? My friends are working on a program to import decks into tabletop sim, he mostly has tapped out done but eventually wants to try and get deckstats and mtggoldfish too.
So I figured I could do some leg work and see what we have to work with. Thanks

Morganator 2.0

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1105
  • Karma: 727
    • View Profile
  • Decks
Re: Deckstats API?
« Reply #1 on: November 06, 2018, 08:42:30 pm »
I can't answer if Deckstats has an API (I don't even know what it is). Nils is the one who can answer that.

In the meantime, tell me more about what you're making. It sounds interesting.

ascii_

  • New Member
  • *
  • Posts: 3
  • Karma: 7
    • View Profile
  • Decks
Re: Deckstats API?
« Reply #2 on: November 08, 2018, 10:43:46 pm »
Well, when I first started playing (around a year or two ago) we used TableTop Sim on steam as it was an easy way to play the game cheap. So my friends have forked another projects that downloaded the card images and make an object for tabletop. With the popularity of scryfall they changed the image importer to download from them because they have great image quality.

Right now the importer only works for TappedOut and because I mainly use deckstats, he wanted to add support for you all too.

Here is the current dev version: https://github.com/erieflin/TTSDeckImporterTappedOut/tree/overhaul

kiochy

  • Jr. Member
  • **
  • Posts: 59
  • Karma: 43
    • View Profile
  • Decks
Re: Deckstats API?
« Reply #3 on: November 08, 2018, 10:53:06 pm »
if everything else fails, try contacting him directly?

https://deckstats.net/?lng=en&about=1 // https://koelling.co.uk/contact.php?lng=en

Nils

  • Administrator
  • Hero Member
  • *****
  • Posts: 953
  • Karma: 250
  • <admin>
    • View Profile
  • Decks
Re: Deckstats API?
« Reply #4 on: November 09, 2018, 01:33:04 am »
Thank you for your interest in adding support for deckstats to this! In general I am happy to support this but it will depend a bit on exactly what kind of API you need.

A full public API (with user authentication etc) is something that has been on my to-do list for ages. Unfortunately that is still not close to being done.

However, if all you need is the deck list then I think you might be able to do something much simpler:

  • Ask the user for a link to the deck they want to import. It has to be saved to their account and public. Eg.: https://deckstats.net/decks/24472/1126678-guttersniplicate
  • Extract the owner ID and the deck ID (eg. 24472 and 1126678, respectively) from the URL
  • Make a request to our internal API using these IDs:
    https://deckstats.net/api.php?action=get_deck&id_type=saved&owner_id=OWNERID&id=DECKID&response_type=list

The result will look like this: https://deckstats.net/api.php?action=get_deck&id_type=saved&owner_id=24472&id=1126678&response_type=list

In principle this is an internal API that might change in the future. However, I don't anticipate any major changes to this anytime soon so you should be pretty safe using this.

Is this the kind of thing you were looking for?

ascii_

  • New Member
  • *
  • Posts: 3
  • Karma: 7
    • View Profile
  • Decks
Re: Deckstats API?
« Reply #5 on: November 09, 2018, 01:40:10 pm »
Thanks for letting me know that there is something and we don't need to scrape pages! I think eventually my friend would like to add support for making decks from private decks, I understand that it may not be supported yet.

And a question I can see my friend asking but is there any documentation on the different arguments?
action=get_deck
id_type=saved
response_type=list

onlyragrets

  • New Member
  • *
  • Posts: 1
  • Karma: 0
  • I'm not actually good right now but having fun
    • View Profile
  • Decks
Re: Deckstats API?
« Reply #6 on: October 15, 2019, 01:13:23 am »
Hello, I'm looking for a documentation or an api to use Deckstats for an app.

Is there any news on this subject ?

Thanks again.
SebeR :)