Deckstats Forum

English-language Forums => General Magic => Topic started by: ascii_ on November 05, 2018, 10:34:18 pm

Title: Deckstats API?
Post by: ascii_ 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
Title: Re: Deckstats API?
Post by: Morganator 2.0 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.
Title: Re: Deckstats API?
Post by: ascii_ 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
Title: Re: Deckstats API?
Post by: kiochy 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
Title: Re: Deckstats API?
Post by: Nils 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:


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 (https://cards.deckstats.net/magiccard.php?lng=en&card=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?
Title: Re: Deckstats API?
Post by: ascii_ 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
Title: Re: Deckstats API?
Post by: onlyragrets 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.
Title: Re: Deckstats API?
Post by: Shik@93 on September 10, 2021, 12:34:24 pm
Hi!
I'm working on a Magic project and I would like to use deckstats as the back end to store users' decks.
For this reason, I'll try to revive (https://cards.deckstats.net/magiccard.php?utf8=1&lng=en&card=Revive) this thread.

So far, given a user, I have been able to programmatically get the list of folders and decks.
What I am missing right now is the ability to programmatically create new decks from scratch (cloning existing ones is not sufficient for me).
So, I am here to ask you if there is a way for me to create decks given a list of cards. I don't need an official or stable API: the way could also be slightly convoluted.

Thanks a lot!