Fun fact: mtgox (the Bitcoin exchange) originally stood for "Magic: The Gathering Online Exchange" and was a site for buying/selling "Magic: The Gathering" cards.
The insinuation is that the current site is somehow tainted by it's use back in 2007, but as far as I can find [1] it was never anything but a "coming soon"page.
It's fairly common to ridicule it's current use in the Bitcoin world by associating the currency exchange with playing cards.
These people are not my close friends (I occasionally contacted them by IRC or E-mail for support, probably more often their employees) but
I am pretty sure that Jed was the person who started the business, and he sold it to MagicalTux. This would indicate that it's a coincidence that MT in MagicalTux is like MT in MtGox. Maybe MagicalTux chose his nickname for this reason.
Another recently popular game which may be of interest to HN is Android: Netrunner. It is an asymmetrical game wherein one player is the corporation who has a set of servers and is trying to advance adgenda cards while the other player is the runner, who is trying to hack into the corporation's servers with a set of programs, hardware and other resources. Like Magic, there is the actual game play, but then also the meta game play of picking cards to customize decks to play each role.
It shares the same designer as Magic (Richard Garfield), but is a Living Card Game rather than a Collectable Card Game. The difference being that in Magic you spend tons of money hoping for the random drop of particular rare cards or buy them individually from dealers. In A:NR, they release a new "data pack" about once a month and then have mini-expansions maybe once a year. It's more like a subscription model, but the net effect is that every card is worth the same as every other card. Still not a cheap hobby, but capped, at least (maybe about $175 to buy every card ever made up to today).
Not only that but the game is completely different to Magic. It comes from an earlier time, before the idea of "turn cards sideways to show they've been used" took hold. It has a very different economy and the two sides play completely differently.
The LCG data-pack model is great for people playing constructed formats, but it does make drafting more of a challenge. Mature LCGs are also quite difficult for latecomers to get into, especially if key packs go out of print.
I didn't say that it predated magic, I said that it came about before the idea of turning cards sideways (as "tapping", "kneeling", "exhausting", "rotating") became an entrenched mechanic.
Luckily it looks like A:NR is at least an order of magnitude more popular than previous LCGs so the cards should stay in print for a while - a bigger issue is that at a certain point, the need to have a 'complete' set is going to be a very expensive proposition. But I agree, the downside of not having a built-in obsolescence/reissue function is that old cards might go out of print.
On the other hand, it's just so much better to play. It actually feels like they made a big list of everything that is wrong about MTG and fixed it.
They also had the chance to undo mistakes and rebalance things from the original Netrunner.
The constant release of new data packs is eventually going to become really tough for new players. I hope they run some kind of restricted tournament format (e.g., only the core + most recent data pack cycle + most recent big box expansion) so that the keen newbie doesn't have so much of a buy-in, but they can grow into the open constructed format later.
Thanks for posting this. Looks interesting. Something to play with my eldest daughter I think.
I ended up being the local card exchange at university for MTG which was uber-popular. Selling cards made me a fortune simply by enforcing scarcity on some of them and auctioning by email (I wrote an auction system in procmail and perl designed to maximise profit). Made £1320 profit in a year!
Edit: just found my old card database. Had 1540 cards at one point! Still have a box in the cupboard as well according to my wife.
Until I saw Mox Perl, I had no idea that web pages could be dynamically-generated by computer programs. It truly blew my mind and triggered a year-long love affair with Perl.
It looks like you're using the Oracle text for every version (for example, http://mtgapi.com/api/v1/fetch/id/198 and http://mtgapi.com/api/v1/fetch/id/226588 have the same rules text, though they appeared differently when printed). Is there any way to get that information? That could be really cool for mining information about how terminology has changed over time.
Now someone needs to use this to make a passable Magic AI. Shandalar is ancient at this point, but it's still the best attempt I've seen, and the only Magic computer game I still play.
I was about to post the same comment. Forge is actually pretty good. And I agree that it's better than Shandalar. I played Shandalar again maybe 5 years ago and the AI gets predictable so fast.
I was not aware of Forge. Thanks! I guess I stopped paying attention about 10 years ago, shortly after WotC killed Apprentice. I figured, based on their behavior, that they would never let any unlicensed innovative MTG software come out. I'm glad they proved me wrong.
Cockatrice is the successor to Apprentice, and is still around even after a recent C&D from WotC. The reason the C&Ds come along is because they all tend to use terms and concepts that WotC owns, like tapping cards.
There is a Wizards product called Duels of the Planeswalkers that includes an updated Magic AI. $10 on the consoles or Steam. It is targeted as an entry-level way to learn Magic.
It focuses on premade decks with limited means of customization, rather than open freeform deckbuilding. (Of course they want you to start buying Magic proper to do that.) But it is the only official way to play modern Magic against an adequate AI.
Ahh Magic cards! The first website I ever made was a magic card trivia page, oh about 15 years ago. If I had known about this API, I would have used it back then ;)
By the way, there is an awesome program called lackeyCCG[1] that I use whenever I feel the need for a quick fix, it's almost like a free version of magic online. Plus you can use it to test your own CCG's if you ever had the urge to make one.
Ahh Magic. That's the game that inspired me to build my own TCG engine.
It uses websockets and modern javascript to let anyone create their own TCG/CCG in the browser. Unlike Lacky or similar all the cards and actions are automated so there's no work for the player. It's currently in beta.
This is one of the games that have been built on it:
Thanks, I wanted to build a really really easy engine that truly anyone can use, not just developers. This is the first time I've heard of OCTGN too. Checking it out.
This is very nicely done. Wish this was available when I was developing CardSplice as it would have saved me some time.
Shameless plug for CardSplice[1] since hacker news is talking about MTG. I had a ton of fun developing this awesome app that lets you quickly feed Magic Cards behind your mobile and uses some advanced image processing and OCR to detect the cards and upload the list into the cloud. Amazing for draft deck building and organizing.
A slight OT anecdotal - most of the best MtG players I personally knew are now stock brokers.
The game itself, meta-game and the entire ecosystem around it taught me a lot about value, perceived value, sales, psychology... I don't regret any of the thousands dollars spent on it more than a decade ago.
(The Github project itself is many things, and very experimental, but hopes to, one day, achieve the Holy Grail of being able to enforce rules through NLP. Yeah, I’m holding my breath too.)
This looks great! I would be interested in talking to the creator about making a plugin based on this for DuckDuckGo if they're around and so inclined.
No joke, I wasn't aware of how much value there is in MTG until a friend of mine put down $6000 investing in a bunch of cards. Then again, I don't know all that much about the game, but you can see that the market for cards on eBay is really active.
Some of my friends made good money playing the market: They bought during the summer drought and sold just after Christmas, when the kids had gotten money as presents.
Unfortunately, and I say this from excruciating experience, this isn't a complete/accurate representation of all M:TG cards.
I spent the summer of 2011 scraping Gather to build out a product catalog and API for a start up that didn't start. I really wish that I had taken the time to put the data out as a torrent.
M:TG has 20 years of strangeness to take into account when creating a data model... And Gatherer has its own issues. For example, the way symbols are represented in card text is inconsistent. (e.g. The tap symbol can be represented as both "ocT" and "{T}", and the representations for mana symbols have evolved inconsistently as well.)
Wizards of the Coast are the only ones who can build this API legally. They hold the copyright on all of the data related to M:TG and I truly wish that they would open up it up so that we, as a people, wouldn't have to spend hundreds of hours recreating the wheel. Poorly. [0]
Fortunately, I stopped what I was doing and started on a board gaming "thingy" with friends instead: http://www.shutupandsitdown.com/
[0]: That isn't to say that the mtgapi.com guys/gals did a shoddy job. It's just a big task that WotC should be forward looking enough to do themselves.
While I have WotC on the line... Why wasn't the D&D 5th Edition SRD hosted on GitHub during development?
Even without counting the two Collector's Edition print runs of the original core set, it's also missing the Anthologies printing, the FNM promo printing and the judge promo printing along with the version that appeared in the Coldsnap theme deck "Kjeldoran Cunning" (which kept the Ice Age art and expansion symbol but put it in the modern card frame).
Meanwhile, this has all of those printings listed:
While I have WotC on the line... Why wasn't the D&D 5th Edition SRD hosted on GitHub during development?
Hell yeah. I'm tempted to contact some of the creators of some of my favorite RPG systems (Jason Bulmahn, Jonathan Tweet, Monte Cook), and beg them to agree to make a completely free RPG. Or at least design the core mechanics. I'm thinking maybe some Creative Commons license, which would allow commercial use. Get them to make a bid, as to how much it would cost to have their work-for-hire for however long they estimate it would take to make the Core Rules of this game...
...and then have a Kickstarter, to raise the funds to do it.
And make implementations of the Core Rules in several programming languages, probably JavaScript first (good for the Browser, or for Node.JS), with Reach Goals for other languages...
Let me tell my personal story: I was a DM for D&D 3rd Edition, and I chose to run through Return to the Temple of Elemental Evil. I had a hard time running it, though, so I made an electronic version of the campaign book. I scanned every single page, I made a wiki on my laptop, one for each NPC. I made a wiki page, with the scanned content for every single monster that showed up. I made wiki pages for every spell (with the scanned content of every spell, right there.) I didn't have to settle for the OGL content, I had the ACTUAL CONTENT FROM THE BOOKS, so my rule-lawyering players couldn't complain that the DM's rules were slightly different from their rules. I made hot-clickable maps, to take me to rooms. I made spreadsheets with every NPC, and their Initiatives, and Hit Points, and any effects on them...
...and now that I've made this thing, for personal use, it would be ILLEGAL for me to share this with anyone.
That sucks.
I've also played around with making computer role playing games, based off of some fantasy role playing game, but most of the "FREE" ones out there, are not available for commercial use, or I'd have to pay a licensing fee.
That sucks.
Ah well, I'm done rambling for now...
One more quick point: I don't begrudge people for making copyrighted, commercial art like games and campaigns. But I think the time for the "Linux" of Fantasy Role Playing Games has come.
I've also dealt with the data and can confirm it's a stunning headache. Try building a search UI around the inconsistencies and you'll go insane. Even Gatherer has issues!
From what I can tell, there's only one or two guys at WotC that come close to understanding the data. With the rest of the organization in mind, I highly doubt WotC will open up their data - the business guys wouldn't understand it. It's a closed-source kind of company.
Wow, just looking at the example card on that makes me realize how ridiculous MTG has gotten in terms of powerful cards. Each edition seems to get closer to a "tap to win game" card.
The dev team learned their lesson from the earlier days[1] and do strict evaluations of cards and interactions before releasing them. The most popular format, "Standard", is played with the last 2 "blocks" (3 sets of card "sets"), and 1 "Core Set". So basically the last 1.5—2 years worth of cards. Those interactions are studied carefully before being released. Very infrequently do you run into something truly overpowered and needing to be banned from the competitive scene.
Not to mention, in the most basic sense, cards like Counterspell[2] will probably never be printed in a Standard playable set, but cards like Cancel[3] will. One being too cheap to cast and being almost game breaking, while the other has its power balanced just right for the cost.
Yeah, after the hellish Tempest/Urza block they really cut back, Mercadian Masques was almost critically under-powered, and they've gotten so much better since that time at providing balance.
If you haven't played in a while, you should check it out again. There's a game[1] now for Steam/Xbox/PS3/Android/iOS to get you back into the swing of things and show you many of the current cards.
The API was just a feature. The actual product was a multi-merchant market place w/ a shipping estimator that was a 1-1 implementation of EasyPost (YC S13).
I have previously written a crawler for http://gatherer.wizards.com/Pages/Default.aspx in Perl that was fairly effective, but never actually finished with the project. That may be a potential source for the data, though.
Just be careful because Wizards of the Coast might disagree with you about what is and isn't public information. Especially when you are showing the rating and number of votes and rating straight from Gatherer.
Part of my research is to semi-automatically generate client libraries for web APIs. For funsies, I made this site a definition and ran it through, producing bindings in Racket, Python, and Java.
Are you planning anything beyond multiverse ID and text search? I usually need to filter by many attributes. Specifically searching in the flavor text, filtering by format legality, card color, converted mana cost, etc.
Gatherer offers all of these abilities but not in an easy to use API. Even if you query gatherer programmatically you're still stuck scraping the page to get the data.
It looks really good but there is a little bit of a problem with your data structure. Technically rarity, flavor text, number, and artist can all be unique per set. You would be better off including that information in your "prints" sub-array with each set.
The big one with rarity is Serra Angel and Hypnotic Spectre as both of those have switched between uncommon and rare, as well as the original Planeswalkers were just rare in Lorwyn, not mythic as that rarity did not exist at that time.
Another suggestion is to remove the empty fields. It doesn't really matter too much normally, but it could be a slight boost in performance for mobile apps taking advantage of this API as they would essentially be pulling down less data, especially if it is a multi-card search. (100 bytes isn't too much for 1 card, but 100 cards suddenly makes that 9.7kb of extra data that isn't necessary.)
I also made a set of files (not on Github (yet)) that indicate a card's keywords and other properties (e.g. flying, protection, split card, etc etc). I found it very hard (read: ~impossible) to extract this kind of info reliably from the card text.
A couple of years ago, I had a student who wanted to do a kind of MtG assistant for his master's thesis. It would have a database with the functionality of each card stored in a symbolic format, and it would use that for applications like giving you advice during play, with the possibility of implementing other applications in the future (once you have the functionality of cards encoded in a format easy to process by machines, you can do many interesting things).
I told him that it could be a great project and I would be happy to supervise it, but the first thing he needed to do was to ensure there would be no legal problems. So I told him to write to the WotC legal department. He wrote a nice email saying if it would be OK to do this, taking into account that it was not for profit, he would recognize all copyrights, not use illustrations (just raw data about the cards), etc.
I don't think it is in Australia at least. Simply collecting such data and making it available isn't illegal; only creative works are under copyright. We've had cases with the phone book being reproduced, and this understanding is apparently correct.
Facts are not copyrightable. Collections of facts might be. I think collecting products and prices for sale @ WF is allowable, in the same sense that it is OK to distribute baseball box scores.
As long as you aren't directly republishing without modification a collection of facts, you aren't violating c.r.
You could still be liable, depending whether your efforts create a negative business affect (torturious interference).
Dang. A nice looking system that does exactly what I was hoping to do with a project of mine that lost my interest.....
Oh well. I appreciate the whole api but what I would really enjoy is the source to where the database is acquired from. I presume it is gatherer but could be wrong because there is at least another site that could be scraped. That or they are scraping a storefront which would be interesting and efficient.
And does it handle double sided cards? That's the thing that buggered my scrapping to the point of annoyance. Damn Innistrad and it's double sided creatures!
I wish you luck, they are painful unless you feel like trying to parse card text. At that point you might as well write a bot that plays magic for you....
I can transfer it to your official Mashape account. You can continue documenting it there (on top of managing users, getting analytics, etc). Let me know! - chris@mashape.com
I was thinking it would be cool to make an open source digital trading card game based on a bitcoin like protocol to insure card existence and distribution probability. (plus there's the nice circular reference)
I'm sure I'll tinker with this idea eventually, but if anyone would like to collaborate give me a buzz. I'll spin up a repo and get the ball rolling.
id# is in the 200000s ? Are these allocated sequentially and contiguously ? If so, M:tG _really_ got away from me since I stopped paying attention to it.
I don't think they are allocated sequentially (and there aren't that many unique cards/versions). But IIRC Gatherer's using the IDs from the internal "Multiverse" DB, which also includes all the brainstormed card ideas that never made it into an actually-released set, which would tend to inflate the numbers.
Edit: and they are not allocated sequentially. These two cards have only ever appeared in the 2014 core set, and have sequential collector numbers in the set but not sequential IDs:
Cool! I did a similar project[1], but I use magiccards.info as a datasource, so it uses the same (not very intuitive, but quite flexible) query parameters.
"During the Beta Period, everyone has access to the API. Please test it and try it out." So you want us to beta-test your stuff for free, but later you will close it? Not interested, thanks, test it yourself.
as one of contributors to the tutor project, I'd recommend Tutor as way to programmatically query gatherer on the command line in a way that handles a lot of the edge cases. I use it on http://cuesbey.com to import into my own data model.