Java SDK for using the magicthegathering.io APIs.
Note that API use is free and does not require authentication or registration, but some rate limits apply. Read the official API website for more information.
Add the dependency to your project and you're good to go! If you are on Android make sure you call on a seperate thread than the main.
- Java JDK 7 or higher
<dependency>
<groupId>io.magicthegathering</groupId>
<artifactId>javasdk</artifactId>
<version>0.0.18</version>
</dependency>
implementation 'io.magicthegathering:javasdk:0.0.18'
<dependency org="io.magicthegathering" name="javasdk" rev="0.0.18"/>
int multiverseId = 1;
Card card = CardAPI.getCard(multiverseId);
List<Card> cards = CardAPI.getAllCards();
String setCode = "KLD";
MtgSet set = SetAPI.getSet(setCode);
This does not populate the card lists by default. This is to improve perfomance if all you need is a set list. Filter also does not currently load set lists. Will be adding in a future release.
List<MtgSet> sets = SetAPI.getAllSets();
List<MtgSet> sets = SetAPI.getAllSetsWithCards();
String setCode = "KLD";
List<Card> booster = SetAPI.getBooster(setCode);
MTGAPI.setConnectTimeout(60);
MTGAPI.setReadTimeout(60);
MTGAPI.setWriteTimeout(60);
This project is licensed under MIT license.