Topic: Deckbox non-official API

Hi,

I've been working on a non-official version of the Deckbox API.
Give it a try: http://deckbox-api.herokuapp.com/ and tell me what you think!

This application is not supported by Deckbox.
This application rely on the site HTML (HTML parser), so any changes to it would break the API.
To detect these changes, I implemented a series of tests (executed twice a day for now) that send a warning when the page layout changed, so I can fixe the API as soon as possible.

Any comments are welcome!

My tradelist as example: http://deckbox-api.herokuapp.com/api/us … /tradelist

Last edited by ToraTora (2014-02-16 03:03:48)

Re: Deckbox non-official API

New feature:


Upcoming features:

  • Add Type, Edition, Format, Rarity, Color filters

  • Add decks sideboard

  • Add card prices

Last edited by ToraTora (2014-02-12 15:02:02)

Re: Deckbox non-official API

Hi there,

Writing with my tablet - that's why I won't put mich effort now in writing perfect english - next time i'll be on my PC - promised big_smile

I just had a look into your API noticing one thing. If you search for a user, You habe to use his logonname not his profilname. Indeed it confused me for about 2minutes 'till noticing my profilsite is an automatic generate unqiue number while connecting deckbox to facebook. You are able to change it in your profile , so it's not that kind of a big deal. But maybe you want to document it wink

Great effort though!

Are you already building an Android APP for deckbox vor got already requests by doing so?
My Only experiences in mobile development were 2 years ago for Windows mobile phone with xaml and csharp - I already Bad a quick look Into Androiddevelopment. Xamarin seems to enable a quickstart for me as csharp developer hence gaining experience in Java as well AS Android development for a quick Start seems a lil bit troubling to me. Free Version should be enable everything we need since se won't rely in third Party libraries.
http://xamarin.com/android

Typos, wrong words and so on are due to german autocorrect, for ans grammatical mistakes I'll beg for apologize since I always failed english in school.

Hope to read from you soon wink

Re: Deckbox non-official API

Hi,

I didn't try the login with facebook, thanks for pointed that out.
I've added information how to get a username.

I'm not building any mobile app yet, as I'm focused on this API wink

Re: Deckbox non-official API

Hi there,

your filter seems to be buggy.

Using your example returns an internal server error which is caused by the part "{"rules":{"operator":"contains","value":"trample"}".
Without this part, filtering works perfectly and using only these parameters  returns an internal server error again.

Kind regards

Edit:

Some suggestions:

Extra Card Information would be useful - like Power/Thoughness and Abilities - and for our fellow gatherers maybe even the flavor Text/Artwork Artist.

Maybe even some cool shit like Rarity depending on different Formats.
As example:
Doom Blade has been printed common as well as uncommon - in Standard Pauper, Doom blade is currently unplayable whilst in Modern it's legal.
Perhaps you want to consider this while implementing Formats for Cards smile

Last edited by 100000520842029 (2014-02-12 14:41:29)

Re: Deckbox non-official API

I edited my previous post, I refactored the way I parse the filters, "rules" has been changed to "rules_text".

I can get the extra card information from a card page but not from a deck page.
So P/T, formats, flavor text will be available when you get data from a specific cards.
I will also provide the format of a deck and the colors used in it.

Re: Deckbox non-official API

Hi there,

I just coded about 2 hours, developing the business logic.

Currently I am writing all the code to serialize those Objects - 'cause of that, I noticed that searching for a special Card (e.g. Anax and Cymede) returns its type as a single string (Legendary Creature) - while looking it up in one of your sets returns a string[] (Legendary, Creature).

I would like to ask you, to change the type in a single CardRequest into a string[] (and renaming to types) as well as renaming subtype into subtypes (Single Card = subtype, Requesting Set = subtypes) - it would make it easier for me and your code would be straight up forward

Kind regards

Edit:

As well, it'll be nice, if you could add the rarity to a single cardrequest (Again as string[])

Edit2: Nevermind - I Just noticed, it's displayed in the Editions name...it's late big_smile

Last edited by 100000520842029 (2014-02-15 01:48:37)

Re: Deckbox non-official API

New feature:

  • The card resource now returns: Formats, Flavor text, Gatherer link, Power/Toughness or Loyality and Rules.


Fixed bugs:

  • Fixed card resource types/subtypes inconsistencies in field name and value type.

Re: Deckbox non-official API

If everyone would release new Features and Bugfixes like you are, the world would be a better place big_smile

Then again, I did notice an inconsistence:

Requesting all Sets, they got a Property called Name. Requesting a specific Set its name is Property title.

Could you be so kind and change it to one? "name" is which I prefer.

Kind regards

Edit:

Are you able to get a Link to a cards picture while viewing a single set?
That would dramatically decrease my requests to enable a Spoiler view.


And j4i - a lil Screenshot of my TestTool:

http://i.imgur.com/t39bMxm.png

Last edited by 100000520842029 (2014-02-15 18:44:13)

Re: Deckbox non-official API

New feature:

  • Added tooltip/image fields to card resources.
    The image field is only available on /api/card/:cardname yet. The tooltip field will provide a raw image.

  • Remove trailing slash when accessing a resource:
    Ex: /api/users/:username/ becomes /api/users/:username

  • Implemented sideboard.

  • Renamed "title" field "name".


Thanks for you feedback.

Re: Deckbox non-official API

Hey there,

just a lil thing - till now, each source of "Image" has been defined as "picture" (e.g. Users profile).

Could you please choose one? Thanks again! smile

Edit:

I am not able to visit following deck:

http://deckbox.org/sets/532625

API Link:

http://deckbox-api.herokuapp.com/api/us … ets/532625

kind regards

Edit2:

Hey there,

just wanted to ask if you still exist tongue

Anyway, I started developing the AndroidApp today and wanted to share some Screenshot of 3 Hours developing:

A total of four Images
http://imgur.com/sviiH6n,9HsJ7Hj,N8Dr1YA,Z0TInZz#0

I know it's now yet the best design you every have seen but I'll focus on functions till now smile

Edit 3:

yet another Bug: Requesting Friends does not return all Friends -->

http://deckbox-api.herokuapp.com/api/us … 9/friends/ - shows only 3 of 4
(http://deckbox.org/users/100000520842029/friends)



Edit4:

Are you able to implement a CardSearch which will give you all Cards which contains the SearchString?

Result of the Searchstring Nicol would be both, the Creature and the Planeswalker

Edit5:
I did some research regarding the bug of friendscount.
As a result I can say, that in your own profile you see all of your friends - even these with pending friend request.
Thats not the case if you are logged out and searching for a specific users friends. Cause deckbox won't show, that a friend request is pending this confused me.

Last edited by 100000520842029 (2014-02-27 16:36:24)

Re: Deckbox non-official API

Hey,

I found the reason why this partial Setloading fails.

This Set contains the card: http://deckbox.org/mtg/Lim-D%C3%BBl's%20Vault which will return an error in your app.

There will be a problem with the û smile




Edit: Didn't meant to reply.. sry

Last edited by 100000520842029 (2014-02-27 17:11:46)

Re: Deckbox non-official API

Thanks for doing my QA smile
I'll take a look at that this weekend.

Re: Deckbox non-official API

New feature:

  • Renamed "picture" field to "image"

Fixed bugs:

  • Fixed cards with special characters.

You were right, special characters (like û) caused the issue.
You can already search card with a specific string with the filters: /api/cards/?filters={"name":{"operator":"contains","value":"Nicol"}}

Re: Deckbox non-official API

Great work dude.

My work on the App struggles a bit, since I got a lil problem with Android.
But I keep going and think, that it'll hit mid April.

I am going to contact you soon, since I got some questions smile

Didn't find any Bugs till now!

Last edited by 100000520842029 (2014-03-18 22:21:29)

Re: Deckbox non-official API

If you say you don't find errors, you will find errors.

Card with "//" in their title will fail to load:

Example:

http://deckbox.org/mtg/Give%20//%20Take
http://deckbox-api.herokuapp.com/api/ca … 0//%20Take



Kind regards

Last edited by 100000520842029 (2014-03-20 15:31:01)

Re: Deckbox non-official API

Oh, I fixed it, thanks.


Fixed bugs:

  • Fixed cards API with cards containing slashes.

Re: Deckbox non-official API

Pressing any of the "Try it" buttons returns text junk like this:

{"status": 404, "message": "Not Found. You have requested this URI [/api/users/deckbox_api/] but did you mean /api/users/<string:username> or /api/users/<string:username>/tradelist or /api/users/<string:username>/sets/ ?"}

Your trade list example is a giant list of text. How is this supposed to be used? Is it not meant for human reading? I'm using the most recent version of Firefox and don't think I have any add-ons that should affect this. Any idea what the problem may be?

Last edited by BetweenWalls (2014-03-23 08:33:27)

Re: Deckbox non-official API

Hello,

Only the first button was broke, I fixed it.
You're right, it's not meant for human reading.
This is an API, it's an interface between external application (such as mobile app) and deckbox.

Re: Deckbox non-official API

@Between:

Use this link:

http://jsonviewer.stack.hu/

Copy the results of ToraToras API and see the Magic smile

Re: Deckbox non-official API

I've updated the API to parse the new html layout.

Some functionalities are missing due to this new layout:

  • /api/cards/ : missing type, subtype, edition, cost and rules

  • /api/users/ : missing trade score

I'll try to have theses data back.