search_cards | R Documentation |
Scryfall's API returns a maximum of 175 cards per page.
search_cards( q, unique = "cards", order = "name", dir = "auto", include_extras = FALSE, page = 1 )
q |
Query, using scryfall's syntax. |
unique |
Whether scryfall should remove possible duplicates in the results ("cards" (default), "art", "prints") |
order |
Method for how the returned cards should be sorted. |
dir |
The direction to sort cards. |
include_extras |
When TRUE, extra cards (e.g. tokens) will be included (default: FALSE). |
page |
Which page number to return; defaults to 1. |
A tibble containing card information.
Scryfall's search syntax reference can be found here. Below is further information on different options that can be specified for the function arguments.
unique
Further information on unique
, from scryfall's documentation:
cards (default) 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
Further information on order
, from scryfall's documentation:
name (default) 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, null last
tix Sort cards by their lowest known TIX price: 0.01 → highest, null last
eur Sort cards by their lowest known Euro price: 0.01 → highest, null last
cmc Sort cards by their converted mana cost: 0 → highest
power Sort cards by their power: null → highest
toughness Sort cards by their toughness: null → highest
edhrec Sort cards by their EDHREC ranking: lowest → highest
artist Sort cards by their front-side artist name: A → Z
dir
auto (default) Scryfall will automatically choose the most inuitive direction to sort
asc Sort ascending (the direction of the arrows in the previous table)
desc Sort descending (flip the direction of the arrows in the previous table)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.