A Java wrapper for the official Cardmarket API
cardmarket4j tries to implement every feature offered by the official REST API in form of services.
All methods are accessed through the CardMarketService
class.
- AccountService
- Get Account details
- Get Messages
- Set Vacation Status
- AuthenticationService
- Authenticate your connection using OAuth
- MarketplaceService
- Get Products based on productId or ProductFilter
- Get Articles based on productId or ArticleFilter
- OrderService
- Get a list of your orders (sales, purchases)
- StockService
- Get a list of your listed articles
- Add articles to your stock
- Remove articles from your stock
- Edit your articles (Quantity, Price, Condition, Comment...)
CardMarketService cardMarket = new CardMarketService("wnyJdqZJHKy2eQ28", "Jh7aj2jiR5RsFMbeKn2VijlEpjwK1nf3",
"YHEpS1HRHkIjixlFJAHfdqHVw3r3ZS7C", "VtADsKQR7OUgN77QP8IX2DkKetxo5kU9");
List<Conversation> listConversations = cardMarket.getAccountService().getMessages();
ProductFilter productFilter = new ProductFilter("Liliana");
productFilter.setGame(Game.MTG);
productFilter.setLanguage(LanguageCode.en);
Set<Product> setProducts = cardMarket.getMarketplaceService().getProduct(productFilter);
for (Product product : setProducts) {
System.out.println(product);
}
List<Order> listPaidSales = cardMarket.getOrderService().getOrders(OrderType.SALE, OrderState.PAID, 10);
listPaidSales.get(0).getBuyer().getAddress();
List<Article> listStock = cardMarket.getStockService().getStock();