scry-cards {scryr}R Documentation

Retrieve information about cards

Description

Cards represent individual Magic: The Gathering playing cards that players could obtain and add to their collection (with a few minor exceptions).

Cards are the API's most complex object. You are encouraged to thoroughly read this document and also vignette("layouts").

Usage

scry_cards(
  q,
  unique = "cards",
  order = "name",
  dir = "auto",
  include_extras = FALSE,
  include_multilingual = FALSE,
  include_variations = FALSE,
  page = NULL
)

scry_card(id, source = "scryfall")

scry_card_name(name, mode = c("fuzzy", "exact"), set = NULL)

scry_card_number(number, set, lang = "en")

scry_card_random(q = NULL)

Arguments

q

A search query using the same fulltext search system that Scryfall uses. For more information see vignette("syntax").

unique

The strategy for omitting similar cards. The options are:

  • cards: Removes duplicate gameplay objects (cards that share a name and have the same functionality). For example, if your search matches more than one print of Pacifism, only one copy of Pacifism will be returned.

  • art: Returns only one copy of each unique artwork for matching cards. For example, if your search matches more than one print of Pacifism, one card with each different illustration for Pacifism will be returned, but any cards that duplicate artwork already in the results will be omitted.

  • prints: Returns all prints for all cards matched (disables rollup). For example, if your search matches more than one print of Pacifism, all matching prints will be returned.

order

The method to sort returned cards. The options are:

  • name: Sort cards by name, A -> Z.

  • set: Sort cards by their set and collector number: AAA/#1 -> ZZZ/#999.

  • released: Sort cards by their release date: Newest -> Oldest.

  • rarity: Sort cards by their rarity: Common -> Mythic.

  • color: Sort cards by their color and color identity: WUBRG -> multicolor -> colorless.

  • usd: Sort cards by their lowest known U.S. Dollar price: 0.01 -> highest, NA last.

  • tix: Sort cards by their lowest known TIX price: 0.01 -> highest, NA last.

  • eur: Sort cards by their lowest known Euro price: 0.01 -> highest, NA last.

  • cmc: Sort cards by their converted mana cost: 0 -> highest.

  • power: Sort cards by their power: NA -> highest.

  • toughness: Sort cards by their toughness: NA -> highest.

  • edhrec: Sort cards by their EDHREC ranking: lowest -> highest.

  • artist: Sort cards by their front-side artist name: A -> Z.

  • review: Sort cards how podcasts review sets, usually color & CMC, lowest -> highest, with Booster Fun cards at the end.

dir

The direction to sort cards. The options are:

  • auto: Scryfall will automatically choose the most intuitive direction to sort.

  • asc: Sort ascending (the direction of the arrows in the previous argument).

  • desc: Sort descending (flip the direction of the arrows in the previous argument).

include_extras

If TRUE, extra cards (tokens, planes, etc) will be included. Equivalent to adding include:extras to the search query.

include_multilingual

If TRUE, cards in every language supported by Scryfall will be included.

include_variations

If TRUE, rare care variants will be included, like the Hairy Runesword.

page

The results' page number to return. If NULL (the default), all available results will be returned.

id

Unique card identifier. May refer to any supported source.

source

Source to which id refers. Can be any one of scryfall, multiverse, mtgo, arena, tcgplayer or cardmarket.

name

A string with a card's name (or part of it).

mode

Search mode. Can be either fuzzy (name may be part of a card's name, allows misspellings and partial words to be provided too) or exact (name has to match exactly, case insensitive).

set

The three to five-letter set code.

number

The card's collector number for a set.

lang

The 2-3 character language code. For more information, see vignette("languages")

Value

A data frame with 1 or more rows and the following columns:

References

https://scryfall.com/docs/api/cards

Examples


# Get all legendary vampires
scry_cards("t:vampire t:legend")

# Get card using an ID
scry_card("913dd06f-ed2f-4128-9c9d-9cd0d8a55425")

# Get card using a name
scry_card_name("Anje Falkenrath")

# Get card using a collector number and a set
scry_card_number(37, "c19")

# Just get a random legendary vampires
scry_card_random("t:vampire t:legend")



[Package scryr version 1.0.0 Index]