Java client library for the Mana Pool API. The library wraps common buyer, seller, inventory, price, card, account, and order endpoints in Java model classes.
- Java 21 or newer
- Maven 3.x
- A Mana Pool account email and API token
Add the Maven dependency to your project:
<dependency>
<groupId>com.github.nicho92</groupId>
<artifactId>manapool-api-java</artifactId>
<version>0.0.13</version>
</dependency>Create a ManaPoolAPIService with your Mana Pool email address and API token:
import org.api.manapool.services.ManaPoolAPIService;
public class Example {
public static void main(String[] args) throws Exception {
var service = new ManaPoolAPIService("you@example.com", "your-api-token");
service.getSellerInventory().forEach(item -> {
System.out.println(
item.getProduct().getName() + " - " +
item.getQuantity() + " copies at " +
item.getPriceValue()
);
});
}
}You can also load credentials from a Java properties file:
EMAIL=you@example.com
TOKEN=your-api-tokenimport java.io.File;
import org.api.manapool.services.ManaPoolAPIService;
var service = new ManaPoolAPIService(new File(System.getProperty("user.home") + "/manapool.properties"));var card = service.cardInfo("Lightning Bolt");
System.out.println(card.getName());For multiple cards:
var cards = service.cardInfo(List.of("Lightning Bolt", "Counterspell"));var inventory = service.getSellerInventory();
inventory.forEach(item -> System.out.println(item.getProduct().getName()));Use pagination when you only need a subset:
var firstPage = service.getSellerInventory(50, 0);Fetch a specific inventory entry by product type and Scryfall ID:
import org.api.manapool.model.enums.EnumType;
var item = service.getSellerInventoryById(
EnumType.SINGLE,
"df9ec379-bcef-4607-a6e4-aa194e09bc73"
);import java.util.List;
import org.api.manapool.model.ProductQueryEntry;
import org.api.manapool.model.enums.EnumCondition;
import org.api.manapool.model.enums.EnumFinish;
import org.api.manapool.model.enums.EnumLangages;
var entry = new ProductQueryEntry(
"df9ec379-bcef-4607-a6e4-aa194e09bc73",
EnumLangages.EN,
EnumFinish.NF,
EnumCondition.NM,
2.50,
4
);
var updatedInventory = service.addInventoryItems(List.of(entry));entry.setPrice(3.00);
entry.setQuantity(2);
var updatedItem = service.updateInventoryItems(entry);
var deletedItem = service.deleteInventoryItems(entry);Warning:
clearSellerInventory()deletes every item from the seller inventory.
service.clearSellerInventory();var singles = service.listSinglesPrices();
var sealed = service.listSealedPrices();
var variants = service.listVariantsPrices();var soldOrders = service.listSellsOrders(50, 0);
var boughtOrders = service.listBoughtOrders(50, 0);
var soldOrder = service.getSellsOrderById(soldOrders.get(0).getId());
var boughtOrder = service.getBoughtOrderById(boughtOrders.get(0).getId());var account = service.userAccount();
var credit = service.userCredits();| Enum | Meaning |
|---|---|
NM |
Near Mint |
LP |
Lightly Played |
MP |
Moderately Played |
HP |
Heavily Played |
DMG |
Damaged |
| Enum | Meaning |
|---|---|
NF |
Non-Foil |
FO |
Foil |
EF |
Etched Foil |
| Enum | Meaning |
|---|---|
EN |
English |
JA |
Japanese |
FR |
French |
IT |
Italian |
DE |
German |
ES |
Spanish |
AR |
Arabic |
CS |
Chinese Simplified |
CT |
Chinese Traditional |
EL |
Ancient Greek |
HE |
Hebrew |
KO |
Korean |
LA |
Latin |
PH |
Phyrexian |
PT |
Portuguese (Brazil) |
RU |
Russian |
SA |
Sanskrit |
| Enum | Mana Pool product type |
|---|---|
SINGLE |
mtg_single |
SEALED |
mtg_sealed |
Clone the repository and build it with Maven:
git clone https://github.com/nicho92/manapool-api-java.git
cd manapool-api-java
mvn testCreate a local package:
mvn packageThe src/test/java/org/api/manapool/tests/Testers.java file is a manual smoke-test helper that expects ~/manapool.properties with EMAIL and TOKEN values.
This project is licensed under the Apache License, Version 2.0.