Magic The Gathering API - Elixir wrapper
This is a simple Elixir wrapper around the Magic The Gathering API
Installation
First, add MTG to your mix.exs dependencies:
def deps do
[{:mtg_api, "~> 0.1.0"}]
end
and run $ mix deps.get.
Usage
All the endpoints detailed in the Official API docs are available. Here's a run down of them:
- Get all Cards
iex>{:ok, cards} = MTG.cards- Get a specific card
iex>{:ok, card} = MTG.card(386616)- Advanced card search
iex>{:ok, powerful_cards} = MTG.cards(params: %{power: "gt3"})
iex>{:ok, ktk_cards} = MTG.cards(params: %{set: "ktk"})- Get all sets
iex>{:ok, sets} = MTG.sets- Get a specific set
iex>{:ok, sets} = MTG.set("ktk")- Generate a booster pack
iex>{:ok, cards} = MTG.booster("ktk")- Get all types
iex>{:ok, cards} = MTG.types- Get all supertypes
iex>{:ok, cards} = MTG.supertypes- Get all subtypes
iex>{:ok, cards} = MTG.subtypes- Get all formats
iex>{:ok, cards} = MTG.formatsSee Advanced Usage for more info
License
Copyright © 2017 Miguel Palhas
This work is free. You can redistribute it and/or modify it under the
terms of the MIT License. See the LICENSE file for more details.