CardsApiJs

class CardsApiJs(config: ScryfallConfig = ScryfallConfig())

JavaScript-friendly wrapper for CardsApi.

Usage:

const api = new CardsApiJs();
const results = await api.search('lightning bolt', { unique: 'prints' });
const card = await api.random();

Constructors

Link copied to clipboard
constructor(config: ScryfallConfig = ScryfallConfig())

Functions

Link copied to clipboard

Get autocomplete suggestions for card names.

Link copied to clipboard

Get a card by Arena ID.

Link copied to clipboard

Get a card by Cardmarket ID.

Link copied to clipboard

Get a card by MTGO ID.

Link copied to clipboard

Get a card by Multiverse ID.

Link copied to clipboard

Get a card by Scryfall ID.

Link copied to clipboard

Get a card by set code and collector number.

Link copied to clipboard

Get a card by TCGPlayer ID.

Link copied to clipboard

Fetch multiple cards at once by their identifiers. Maximum of 75 identifiers per request.

Link copied to clipboard
fun namedExact(name: String, options: CardOptions?): Promise<JsCard>

Get a card by exact name.

Link copied to clipboard
fun namedFuzzy(name: String, options: CardOptions?): Promise<JsCard>

Get a card by fuzzy name match.

Link copied to clipboard

Get a random card.

Link copied to clipboard

Search for cards using Scryfall fulltext search syntax.