CardAttributes
This query will return a maximum of 100 cards.
Paginate the response using the page parameter.
Each field below can be used as a query parameter. By default, fields that have a singular value such as rarity, set, and name will always use a logical “or” operator when querying with a list of values. Fields that can have multiple values such as colors, supertypes, and subtypes can use a logical “and” or a logical “or” operator.
The accepted delimiters when querying fields are the pipe character or a comma character. The pipe represents a logical “or”, and a comma represents a logical “and”. The comma can only be used with fields that accept multiple values (like colors).
Example:name=nissa, worldwaker|jace|ajani, caller More examples: colors=red,white,blue versus colors=red|white|blue
Tags
Table of Contents
Properties
- $artist : ?string|null
- $border : ?string|null
- $cmc : int
- $colorIdentity : ?array<string|int, string>|null
- $colors : ?array<string|int, string>|null
- $contains : ?string|null
- $flavor : ?string|null
- $gameFormat : ?string|null
- $id : ?string|null
- $imageUrl : ?string|null
- $language : ?string|null
- $layout : ?string|null
- $legality : ?string|null
- $loyalty : ?int|null
- $manaCost : ?string|null
- $multiverseid : ?int|null
- $name : ?string|null
- $names : ?array<string|int, mixed>|null
- $number : ?string|null
- $orderBy : ?string|null
- $page : ?int|null
- $pageSize : ?int|null
- $power : ?string|null
- $random : ?string|null
- $rarity : ?string|null
- $releaseDate : ?Carbon|null
- $rulings : ?ExCollectionInterface<string|int, Rulings>|array<string|int, Rulings>|null
- $set : ?string|null
- $setName : ?string|null
- $subtypes : ?array<string|int, string>|null
- $supertypes : ?array<string|int, string>|null
- $text : ?string|null
- $toughness : ?string|null
- $type : ?string|null
- $types : ?array<string|int, string>|null
- $variations : ?array<string|int, mixed>|null
Methods
- getArtist() : string|null
- Gets the name of the artist who illustrated the card.
- getCmc() : int
- Gets the converted mana cost of the card.
- getColorIdentity() : array<string|int, string>|null
- Gets the color identity of the card.
- getColors() : array<string|int, string>|null
- Gets the colors of the card.
- getContains() : string|null
- Gets the "contains" field filter.
- getFlavor() : string|null
- Gets the card's flavor text.
- getGameFormat() : string|null
- Gets the game format used to filter legality.
- getId() : string|null
- Gets the card's unique id.
- getLanguage() : string|null
- Gets the language used when querying foreign card names.
- getLayout() : string|null
- Gets the layout of the card.
- getLegality() : string|null
- Gets the legality status used to filter results.
- getLoyalty() : int|null
- Gets the planeswalker's starting loyalty.
- getMultiverseid() : int|null
- Gets the card's Gatherer multiverse id.
- getName() : string|null
- Gets the name of the card.
- getNumber() : string|null
- Gets the card's collector number within its set.
- getOrderBy() : string|null
- Gets the field results are ordered by.
- getPage() : int|null
- Gets the results page number.
- getPageSize() : int|null
- Gets the number of results per page.
- getPower() : string|null
- Gets the creature's power.
- getRandom() : bool|null
- Gets whether a random card was requested.
- getRarity() : string|null
- Gets the rarity of the card.
- getSet() : string|null
- Gets the code of the set the card belongs to.
- getSetName() : string|null
- Gets the full name of the set the card belongs to.
- getSubtypes() : array<string|int, string>|null
- Gets the subtypes of the card.
- getSupertypes() : array<string|int, string>|null
- Gets the supertypes of the card.
- getText() : string|null
- Gets the card's oracle rules text.
- getToughness() : string|null
- Gets the creature's toughness.
- getType() : string|null
- Gets the type of the card.
- getTypes() : array<string|int, string>|null
- Gets the types of the card.
- setArtist() : self
- Sets the name of the artist who illustrated the card.
- setCmc() : $this
- Sets the converted mana cost of the card.
- setColorIdentity() : $this
- Sets the color identity of the card.
- setColors() : $this
- Sets the colors of the card.
- setContains() : self
- Restricts results to cards that have the named field(s) present.
- setFlavor() : self
- Sets the card's flavor text.
- setGameFormat() : self
- Sets the game format to filter legality against (e.g. "Standard", "Modern").
- setId() : self
- Sets the card's unique id (a hash of set code, name and collector number).
- setLanguage() : self
- Sets the language to match foreign card names against when querying.
- setLayout() : $this
- Sets the layout of the card.
- setLegality() : self
- Sets the legality status to filter by ("Legal", "Banned" or "Restricted").
- setLoyalty() : self
- Sets the planeswalker's starting loyalty.
- setMultiverseid() : self
- Sets the card's Gatherer multiverse id.
- setName() : $this
- Sets the name of the card.
- setNumber() : self
- Sets the card's collector number within its set.
- setOrderBy() : self
- Sets the field to order results by.
- setPage() : self
- Sets the results page number to request (1-based pagination).
- setPageSize() : self
- Sets the number of results per page.
- setPower() : self
- Sets the creature's power. A string because it may be non-numeric (e.g. "*").
- setRandom() : self
- Requests a single random card matching the other filters. Only a truthy value has an effect; `false`/`null` leaves the flag unset.
- setRarity() : self
- Sets the rarity of the card (e.g. "Common", "Rare", "Mythic Rare").
- setSet() : self
- Sets the code of the set the card belongs to.
- setSetName() : self
- Sets the full name of the set the card belongs to.
- setSubtypes() : self
- Sets the subtypes of the card (e.g. "Human", "Wizard", "Equipment").
- setSupertypes() : $this
- Sets the supertypes of the card.
- setText() : self
- Sets the card's oracle rules text.
- setToughness() : self
- Sets the creature's toughness. A string because it may be non-numeric (e.g. "*").
- setType() : $this
- Sets the type of the card.
- setTypes() : self
- Sets the types of the card.
Properties
$artist
public
?string|null
$artist
The artist of the card. May not match what is on the card as MTGJSON corrects many card misprints.
$border read-only
public
?string|null
$border
$cmc
public
int
$cmc
Converted mana cost. Always a number.
$colorIdentity
public
?array<string|int, string>|null
$colorIdentity
The card’s color identity, by color code. E.g., [“Red”, “Blue”] becomes [“R”, “U”]. Includes colors from the card’s rules text.
$colors
public
?array<string|int, string>|null
$colors
The card colors. Usually derived from the casting cost, but some cards are special (like the back of dual sided cards and Ghostfire).
$contains
public
?string|null
$contains
Filter cards based on whether or not they have a specific field available (like imageUrl).
$flavor
public
?string|null
$flavor
The flavor text of the card.
$gameFormat
public
?string|null
$gameFormat
The game format, such as Commander, Standard, Legacy, etc. (when used, legality defaults to Legal unless supplied).
$id
public
?string|null
$id
A unique id for this card. It is made up by doing an SHA1 hash of setCode + cardName + cardImageName.
$imageUrl read-only
public
?string|null
$imageUrl
$language
public
?string|null
$language
The language the card is printed in. Use this parameter along with the name parameter when searching by foreignName.
$layout
public
?string|null
$layout
The card layout. Possible values: normal, split, flip, double-faced, token, plane, scheme, phenomenon, leveler, vanguard, aftermath.
$legality
public
?string|null
$legality
The legality of the card for a given format, such as Legal, Banned or Restricted.
$loyalty
public
?int|null
$loyalty
The loyalty of the card. Only present for planeswalkers.
$manaCost read-only
public
?string|null
$manaCost
$multiverseid
public
?int|null
$multiverseid
The multiverseid of the card on Wizard’s Gatherer web page. Cards from sets that do not exist on Gatherer will NOT have a multiverseid.
The fields below are also part of the response (if not null), but cannot currently be used as query parameters
$name
public
?string|null
$name
The card name. For split, double-faced and flip cards, just the name of one side of the card. Each ‘sub-card’ has its own record.
$names read-only
public
?array<string|int, mixed>|null
$names
$number
public
?string|null
$number
The card number. Printed at the bottom-center of the card in small text. This is a string, not an integer, because some cards have letters in their numbers.
$orderBy
public
?string|null
$orderBy
The field to order by in the response results.
$page
public
?int|null
$page
The page of data to request.
$pageSize
public
?int|null
$pageSize
The amount of data to return in a single request. The default (and max) is 100.
$power
public
?string|null
$power
The power of the card. Only present for creatures. This is a string, not an integer, because some cards have powers like: “1+*”.
$random
public
?string|null
$random
Fetch any number of cards (controlled by pageSize) randomly.
$rarity
public
?string|null
$rarity
The rarity of the card. Examples: Common, Uncommon, Rare, Mythic Rare, Special, Basic Land.
$releaseDate read-only
public
?Carbon|null
$releaseDate
$rulings read-only
public
?ExCollectionInterface<string|int, Rulings>|array<string|int, Rulings>|null
$rulings
Array of rulings, each containing "date" and "text".
$set
public
?string|null
$set
The set the card belongs to (set code).
$setName
public
?string|null
$setName
The set name the card belongs to.
$subtypes
public
?array<string|int, string>|null
$subtypes
The subtypes of the card. These appear to the right of the dash in a card type. Each word is its own subtype. Example: Trap, Arcane, Equipment, Aura, Human, Rat, Squirrel, etc.
$supertypes
public
?array<string|int, string>|null
$supertypes
The supertypes of the card. These appear to the far left of the card type. Example: Basic, Legendary, Snow, World, Ongoing.
$text
public
?string|null
$text
The oracle text of the card. May contain mana symbols and other symbols.
$toughness
public
?string|null
$toughness
The toughness of the card. Only present for creatures. This is a string, not an integer, because some cards have toughness like: “1+*”.
$type
public
?string|null
$type
The card type. This is the type you would see on the card if printed today. Note: The dash is a UTF8 ‘long dash’ as per the MTG rules.
$types
public
?array<string|int, string>|null
$types
The types of the card. These appear to the left of the dash in a card type. Example: Instant, Sorcery, Artifact, Creature, Enchantment, Land, Planeswalker.
$variations read-only
public
?array<string|int, mixed>|null
$variations
Methods
getArtist()
Gets the name of the artist who illustrated the card.
public
getArtist() : string|null
Return values
string|nullgetCmc()
Gets the converted mana cost of the card.
public
getCmc() : int
Return values
intgetColorIdentity()
Gets the color identity of the card.
public
getColorIdentity() : array<string|int, string>|null
Return values
array<string|int, string>|nullgetColors()
Gets the colors of the card.
public
getColors() : array<string|int, string>|null
Return values
array<string|int, string>|nullgetContains()
Gets the "contains" field filter.
public
getContains() : string|null
Return values
string|nullgetFlavor()
Gets the card's flavor text.
public
getFlavor() : string|null
Return values
string|nullgetGameFormat()
Gets the game format used to filter legality.
public
getGameFormat() : string|null
Return values
string|nullgetId()
Gets the card's unique id.
public
getId() : string|null
Return values
string|nullgetLanguage()
Gets the language used when querying foreign card names.
public
getLanguage() : string|null
Return values
string|nullgetLayout()
Gets the layout of the card.
public
getLayout() : string|null
Return values
string|nullgetLegality()
Gets the legality status used to filter results.
public
getLegality() : string|null
Return values
string|nullgetLoyalty()
Gets the planeswalker's starting loyalty.
public
getLoyalty() : int|null
Return values
int|nullgetMultiverseid()
Gets the card's Gatherer multiverse id.
public
getMultiverseid() : int|null
Return values
int|nullgetName()
Gets the name of the card.
public
getName() : string|null
Return values
string|nullgetNumber()
Gets the card's collector number within its set.
public
getNumber() : string|null
Return values
string|nullgetOrderBy()
Gets the field results are ordered by.
public
getOrderBy() : string|null
Return values
string|nullgetPage()
Gets the results page number.
public
getPage() : int|null
Return values
int|nullgetPageSize()
Gets the number of results per page.
public
getPageSize() : int|null
Return values
int|nullgetPower()
Gets the creature's power.
public
getPower() : string|null
Return values
string|nullgetRandom()
Gets whether a random card was requested.
public
getRandom() : bool|null
Return values
bool|nullgetRarity()
Gets the rarity of the card.
public
getRarity() : string|null
Return values
string|nullgetSet()
Gets the code of the set the card belongs to.
public
getSet() : string|null
Return values
string|nullgetSetName()
Gets the full name of the set the card belongs to.
public
getSetName() : string|null
Return values
string|nullgetSubtypes()
Gets the subtypes of the card.
public
getSubtypes() : array<string|int, string>|null
Return values
array<string|int, string>|nullgetSupertypes()
Gets the supertypes of the card.
public
getSupertypes() : array<string|int, string>|null
Return values
array<string|int, string>|nullgetText()
Gets the card's oracle rules text.
public
getText() : string|null
Return values
string|nullgetToughness()
Gets the creature's toughness.
public
getToughness() : string|null
Return values
string|nullgetType()
Gets the type of the card.
public
getType() : string|null
Return values
string|nullgetTypes()
Gets the types of the card.
public
getTypes() : array<string|int, string>|null
Return values
array<string|int, string>|nullsetArtist()
Sets the name of the artist who illustrated the card.
public
setArtist(string|null $artist) : self
Parameters
- $artist : string|null
-
Artist name.
Return values
selfsetCmc()
Sets the converted mana cost of the card.
public
setCmc([int $cmc = 0 ]) : $this
Parameters
- $cmc : int = 0
-
Converted mana cost of the card.
Return values
$thissetColorIdentity()
Sets the color identity of the card.
public
setColorIdentity(array<string|int, string>|null $colorIdentity) : $this
Parameters
- $colorIdentity : array<string|int, string>|null
-
Color identity of the card.
Return values
$thissetColors()
Sets the colors of the card.
public
setColors(array<string|int, string>|null $colors) : $this
Parameters
- $colors : array<string|int, string>|null
-
Colors of the card.
Return values
$thissetContains()
Restricts results to cards that have the named field(s) present.
public
setContains(string|null $contains) : self
Parameters
- $contains : string|null
-
Comma-separated field names.
Return values
selfsetFlavor()
Sets the card's flavor text.
public
setFlavor(string|null $flavor) : self
Parameters
- $flavor : string|null
-
Flavor text.
Return values
selfsetGameFormat()
Sets the game format to filter legality against (e.g. "Standard", "Modern").
public
setGameFormat(string|null $gameFormat) : self
Parameters
- $gameFormat : string|null
-
Game format name.
Return values
selfsetId()
Sets the card's unique id (a hash of set code, name and collector number).
public
setId(string|null $id) : self
Parameters
- $id : string|null
-
Card id.
Return values
selfsetLanguage()
Sets the language to match foreign card names against when querying.
public
setLanguage(string|null $language) : self
Parameters
- $language : string|null
-
Language name.
Return values
selfsetLayout()
Sets the layout of the card.
public
setLayout(string|null $layout) : $this
Parameters
- $layout : string|null
-
Layout of the card.
Return values
$thissetLegality()
Sets the legality status to filter by ("Legal", "Banned" or "Restricted").
public
setLegality(string|null $legality) : self
Parameters
- $legality : string|null
-
Legality status.
Return values
selfsetLoyalty()
Sets the planeswalker's starting loyalty.
public
setLoyalty(int|null $loyalty) : self
Parameters
- $loyalty : int|null
-
Starting loyalty.
Return values
selfsetMultiverseid()
Sets the card's Gatherer multiverse id.
public
setMultiverseid(int|null $multiverseid) : self
Parameters
- $multiverseid : int|null
-
Multiverse id.
Return values
selfsetName()
Sets the name of the card.
public
setName(string|null $name) : $this
Parameters
- $name : string|null
-
Name of the card.
Return values
$thissetNumber()
Sets the card's collector number within its set.
public
setNumber(string|null $number) : self
Parameters
- $number : string|null
-
Collector number.
Return values
selfsetOrderBy()
Sets the field to order results by.
public
setOrderBy(string|null $orderBy) : self
Parameters
- $orderBy : string|null
-
Field name.
Return values
selfsetPage()
Sets the results page number to request (1-based pagination).
public
setPage(int|null $page) : self
Parameters
- $page : int|null
-
Page number.
Return values
selfsetPageSize()
Sets the number of results per page.
public
setPageSize(int|null $pageSize) : self
Parameters
- $pageSize : int|null
-
Page size, 1-100.
Tags
Return values
selfsetPower()
Sets the creature's power. A string because it may be non-numeric (e.g. "*").
public
setPower(string|null $power) : self
Parameters
- $power : string|null
-
Power.
Return values
selfsetRandom()
Requests a single random card matching the other filters. Only a truthy value has an effect; `false`/`null` leaves the flag unset.
public
setRandom(bool|null $random) : self
Parameters
- $random : bool|null
-
Whether to return a random card.
Return values
selfsetRarity()
Sets the rarity of the card (e.g. "Common", "Rare", "Mythic Rare").
public
setRarity(string|null $rarity) : self
Parameters
- $rarity : string|null
-
Rarity of the card.
Return values
selfsetSet()
Sets the code of the set the card belongs to.
public
setSet(string|null $set) : self
Parameters
- $set : string|null
-
Set code.
Return values
selfsetSetName()
Sets the full name of the set the card belongs to.
public
setSetName(string|null $setName) : self
Parameters
- $setName : string|null
-
Set name.
Return values
selfsetSubtypes()
Sets the subtypes of the card (e.g. "Human", "Wizard", "Equipment").
public
setSubtypes(array<string|int, string>|null $subtypes) : self
Parameters
- $subtypes : array<string|int, string>|null
-
Subtypes of the card.
Return values
selfsetSupertypes()
Sets the supertypes of the card.
public
setSupertypes(array<string|int, string>|null $supertypes) : $this
Parameters
- $supertypes : array<string|int, string>|null
-
Supertypes of the card.
Return values
$thissetText()
Sets the card's oracle rules text.
public
setText(string|null $text) : self
Parameters
- $text : string|null
-
Rules text.
Return values
selfsetToughness()
Sets the creature's toughness. A string because it may be non-numeric (e.g. "*").
public
setToughness(string|null $toughness) : self
Parameters
- $toughness : string|null
-
Toughness.
Return values
selfsetType()
Sets the type of the card.
public
setType(string|null $type) : $this
Parameters
- $type : string|null
-
Type of the card.
Return values
$thissetTypes()
Sets the types of the card.
public
setTypes(array<string|int, string>|null $types) : self
Parameters
- $types : array<string|int, string>|null
-
Types of the card.