MTG Gatherer Search
A simple search for getting card info form search on Gatherer.
What is this?
MTG Gatherer Search is a simple search module that I use in my card database project. It scrapes search results from Magic: The Gathering Gatherer portal for searching cards. It returns a json that contains essential card info: name, mana cost, image url and multiverse id. It's written in JavaSciprt as a module that can be used in Node.js or web frameworks.
Usage
You can install mtg-gatherer-search via npm
or yarn
or any other Node.js package manager that connects to npm repository.
Install
$ npm i -P mtg-gatherer-search
or with Yarn
$ yarn add mtg-gatherer-search
Import
Once module is installed just import it into your JS file.
const mtgGathererSearch = ;// Or in ES6;
Scrape
Now just call the function and get your search results in a json.
const result = await ;/*[{title: 'Black Lotus',mana: {Any: 0,Red: 0,White: 0,Green: 0,Blue: 0,Black: 0,Artifact: 0,Total: 0},imageUrl: 'http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=382866&type=card',multiverseId: 382866},...]*/
License
MIT © Dušan Simić