{
  "openapi": "3.1.0",
  "info": {
    "title": "Hearthstone API",
    "version": "1.0.0",
    "description": "Every Hearthstone card from Blizzard's data with class, set, cost, rarity, mechanics and text, twice-daily refresh.\n\nHearthstone card database from Blizzard's own card data, refreshed twice daily: search cards by name, class, set, type, rarity, cost and mechanics, or fetch a card by slug with its full text and stats.",
    "contact": {
      "name": "Data and APIs",
      "url": "https://dataandapis.com/contact"
    },
    "termsOfService": "https://dataandapis.com/terms-of-service",
    "license": {
      "name": "Data and APIs Terms of Service",
      "url": "https://dataandapis.com/terms-of-service"
    },
    "x-logo": {
      "url": "https://dataandapis.com/images/hearthstone.webp"
    }
  },
  "externalDocs": {
    "description": "Documentation, live tester and pricing",
    "url": "https://dataandapis.com/apis/hearthstone"
  },
  "servers": [
    {
      "url": "https://hearthstone.dataandapis.com"
    }
  ],
  "tags": [
    {
      "name": "Gaming",
      "description": "Hearthstone API belongs to the Gaming category of the Data and APIs catalog."
    }
  ],
  "paths": {
    "/v1/cards/{slug}": {
      "get": {
        "operationId": "getCardById",
        "summary": "Get Card By Id",
        "description": "Get Card By Id endpoint of the Hearthstone API. Costs 5 tokens per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/hearthstone/get-card-by-id"
        },
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "a-light-in-the-darkness"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "collectible": 1,
                  "slug": "a-light-in-the-darkness",
                  "artistName": "Zoltan Boros",
                  "manaCost": 2,
                  "name": "A Light in the Darkness",
                  "text": "<b>Discover</b> a minion. Give it +1/+1.",
                  "flavorText": "Wait, how can you have a light in the dark? If you turn on a light while it’s dark, doesn’t that mean it’s no longer dark?",
                  "duels": {
                    "relevant": true,
                    "constructed": true
                  },
                  "hasImage": true,
                  "hasImageGold": false,
                  "hasCropImage": true,
                  "keywords": [
                    {
                      "slug": "discover",
                      "name": "Discover",
                      "refText": "Choose one of three cards to add to your hand.",
                      "text": "Choose one of three cards to add to your hand.",
                      "gameModes": []
                    }
                  ],
                  "rarity": {
                    "slug": "common",
                    "craftingCost": [
                      40,
                      400
                    ],
                    "dustValue": [
                      5,
                      50
                    ],
                    "name": "Common"
                  },
                  "class": {
                    "slug": "paladin",
                    "name": "Paladin"
                  },
                  "type": {
                    "slug": "spell",
                    "name": "Spell",
                    "gameModes": []
                  },
                  "cardSet": {
                    "name": "Whispers of the Old Gods",
                    "slug": "whispers-of-the-old-gods",
                    "type": "expansion",
                    "collectibleCount": 134,
                    "collectibleRevealedCount": 134,
                    "nonCollectibleCount": 36,
                    "nonCollectibleRevealedCount": 34
                  },
                  "spellSchool": {
                    "slug": "holy",
                    "name": "Holy"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/cards": {
      "get": {
        "operationId": "getCards",
        "summary": "Get Cards",
        "description": "Get Cards endpoint of the Hearthstone API. Costs 5 tokens per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/hearthstone/get-cards"
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "1"
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "1"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "cards": [
                    {
                      "collectible": 1,
                      "slug": "a-light-in-the-darkness",
                      "artistName": "Zoltan Boros",
                      "manaCost": 2,
                      "name": "A Light in the Darkness",
                      "text": "<b>Discover</b> a minion. Give it +1/+1.",
                      "flavorText": "Wait, how can you have a light in the dark? If you turn on a light while it’s dark, doesn’t that mean it’s no longer dark?",
                      "duels": {
                        "relevant": true,
                        "constructed": true
                      },
                      "hasImage": true,
                      "hasImageGold": false,
                      "hasCropImage": true,
                      "keywords": [
                        {
                          "slug": "discover",
                          "name": "Discover",
                          "refText": "Choose one of three cards to add to your hand.",
                          "text": "Choose one of three cards to add to your hand.",
                          "gameModes": [
                            {
                              "slug": "constructed",
                              "name": "Standard & Wild Formats"
                            },
                            {
                              "slug": "battlegrounds",
                              "name": "Battlegrounds"
                            },
                            {
                              "slug": "duels",
                              "name": "Current Duels Cards"
                            },
                            {
                              "slug": "standard",
                              "name": "Standard"
                            }
                          ]
                        }
                      ],
                      "rarity": {
                        "slug": "common",
                        "craftingCost": [
                          40,
                          400
                        ],
                        "dustValue": [
                          5,
                          50
                        ],
                        "name": "Common"
                      },
                      "class": {
                        "slug": "paladin",
                        "name": "Paladin"
                      },
                      "type": {
                        "slug": "spell",
                        "name": "Spell",
                        "gameModes": [
                          {
                            "slug": "constructed",
                            "name": "Standard & Wild Formats"
                          },
                          {
                            "slug": "battlegrounds",
                            "name": "Battlegrounds"
                          },
                          {
                            "slug": "duels",
                            "name": "Current Duels Cards"
                          },
                          {
                            "slug": "standard",
                            "name": "Standard"
                          }
                        ]
                      },
                      "cardSet": {
                        "name": "Whispers of the Old Gods",
                        "slug": "whispers-of-the-old-gods",
                        "type": "expansion",
                        "collectibleCount": 134,
                        "collectibleRevealedCount": 134,
                        "nonCollectibleCount": 36,
                        "nonCollectibleRevealedCount": 34
                      },
                      "spellSchool": {
                        "slug": "holy",
                        "name": "Holy"
                      }
                    },
                    {
                      "collectible": 1,
                      "slug": "a-new-challenger",
                      "artistName": "James Ryman",
                      "manaCost": 7,
                      "name": "A New Challenger...",
                      "text": "<b>Discover</b> a 6-Cost minion. Summon it with <b>Taunt</b> and <b>Divine Shield</b>.",
                      "flavorText": "… Arrives? Approaches? TELL US ALREADY!",
                      "hasImage": true,
                      "hasImageGold": true,
                      "hasCropImage": true,
                      "keywords": [
                        {
                          "slug": "taunt",
                          "name": "Taunt",
                          "refText": "Enemies must attack minions that have Taunt.",
                          "text": "Enemies must attack this minion.",
                          "gameModes": [
                            {
                              "slug": "constructed",
                              "name": "Standard & Wild Formats"
                            },
                            {
                              "slug": "battlegrounds",
                              "name": "Battlegrounds"
                            },
                            {
                              "slug": "duels",
                              "name": "Current Duels Cards"
                            },
                            {
                              "slug": "standard",
                              "name": "Standard"
                            },
                            {
                              "slug": "mercenaries",
                              "name": "Mercenaries"
                            }
                          ]
                        },
                        {
                          "slug": "divine-shield",
                          "name": "Divine Shield",
                          "refText": "The first time a Shielded minion takes damage, ignore it.",
                          "text": "The first time this minion takes damage, ignore it.",
                          "gameModes": [
                            {
                              "slug": "constructed",
                              "name": "Standard & Wild Formats"
                            },
                            {
                              "slug": "battlegrounds",
                              "name": "Battlegrounds"
                            },
                            {
                              "slug": "duels",
                              "name": "Current Duels Cards"
                            },
                            {
                              "slug": "standard",
                              "name": "Standard"
                            }
                          ]
                        },
                        {
                          "slug": "discover",
                          "name": "Discover",
                          "refText": "Choose one of three cards to add to your hand.",
                          "text": "Choose one of three cards to add to your hand.",
                          "gameModes": []
                        }
                      ],
                      "rarity": {
                        "slug": "epic",
                        "craftingCost": [
                          400,
                          1600
                        ],
                        "dustValue": [
                          100,
                          400
                        ],
                        "name": "Epic"
                      },
                      "class": {
                        "slug": "paladin",
                        "name": "Paladin"
                      },
                      "type": {
                        "slug": "spell",
                        "name": "Spell",
                        "gameModes": []
                      },
                      "cardSet": {
                        "name": "Rastakhan’s Rumble",
                        "slug": "rastakhans-rumble",
                        "type": "expansion",
                        "collectibleCount": 135,
                        "collectibleRevealedCount": 135,
                        "nonCollectibleCount": 31,
                        "nonCollectibleRevealedCount": 29
                      },
                      "spellSchool": null
                    },
                    {
                      "collectible": 1,
                      "slug": "aberrant-berserker",
                      "artistName": "Jim Nelson",
                      "health": 5,
                      "attack": 3,
                      "manaCost": 4,
                      "name": "Aberrant Berserker",
                      "text": "Has +2 Attack while damaged.",
                      "flavorText": "I berserk, therefore I am.",
                      "duels": {
                        "relevant": true,
                        "constructed": true
                      },
                      "hasImage": true,
                      "hasImageGold": false,
                      "hasCropImage": true,
                      "keywords": [],
                      "rarity": {
                        "slug": "common",
                        "craftingCost": [
                          40,
                          400
                        ],
                        "dustValue": [
                          5,
                          50
                        ],
                        "name": "Common"
                      },
                      "class": {
                        "slug": "neutral",
                        "name": "Neutral"
                      },
                      "type": {
                        "slug": "minion",
                        "name": "Minion",
                        "gameModes": [
                          {
                            "slug": "constructed",
                            "name": "Standard & Wild Formats"
                          },
                          {
                            "slug": "battlegrounds",
                            "name": "Battlegrounds"
                          },
                          {
                            "slug": "duels",
                            "name": "Current Duels Cards"
                          },
                          {
                            "slug": "standard",
                            "name": "Standard"
                          },
                          {
                            "slug": "mercenaries",
                            "name": "Mercenaries"
                          }
                        ]
                      },
                      "cardSet": {
                        "name": "Whispers of the Old Gods",
                        "slug": "whispers-of-the-old-gods",
                        "type": "expansion",
                        "collectibleCount": 134,
                        "collectibleRevealedCount": 134,
                        "nonCollectibleCount": 36,
                        "nonCollectibleRevealedCount": 34
                      },
                      "spellSchool": null
                    },
                    {
                      "collectible": 1,
                      "slug": "abominable-bowman",
                      "artistName": "L. Lullabi & K. Turovec",
                      "health": 7,
                      "attack": 6,
                      "manaCost": 7,
                      "name": "Abominable Bowman",
                      "text": "<b>Deathrattle:</b> Summon a random friendly Beast that died this game.",
                      "flavorText": "Frosty the Bowman... was an angry hateful soul... with a fresh hewn bow and a missing nose...",
                      "hasImage": true,
                      "hasImageGold": false,
                      "hasCropImage": true,
                      "keywords": [
                        {
                          "slug": "deathrattle",
                          "name": "Deathrattle",
                          "refText": "Does something when it dies.",
                          "text": "Does something when it dies.",
                          "gameModes": [
                            {
                              "slug": "constructed",
                              "name": "Standard & Wild Formats"
                            },
                            {
                              "slug": "battlegrounds",
                              "name": "Battlegrounds"
                            },
                            {
                              "slug": "duels",
                              "name": "Current Duels Cards"
                            },
                            {
                              "slug": "standard",
                              "name": "Standard"
                            },
                            {
                              "slug": "mercenaries",
                              "name": "Mercenaries"
                            }
                          ]
                        }
                      ],
                      "rarity": {
                        "slug": "epic",
                        "craftingCost": [
                          400,
                          1600
                        ],
                        "dustValue": [
                          100,
                          400
                        ],
                        "name": "Epic"
                      },
                      "class": {
                        "slug": "hunter",
                        "name": "Hunter"
                      },
                      "type": {
                        "slug": "minion",
                        "name": "Minion",
                        "gameModes": []
                      },
                      "cardSet": {
                        "name": "Knights of the Frozen Throne",
                        "slug": "knights-of-the-frozen-throne",
                        "type": "expansion",
                        "collectibleCount": 135,
                        "collectibleRevealedCount": 135,
                        "nonCollectibleCount": 113,
                        "nonCollectibleRevealedCount": 51
                      },
                      "spellSchool": null
                    },
                    {
                      "collectible": 1,
                      "slug": "abominable-lieutenant",
                      "artistName": "Dave Allsop",
                      "health": 5,
                      "attack": 3,
                      "manaCost": 8,
                      "name": "Abominable Lieutenant",
                      "text": "At the end of your turn, eat a random enemy minion and gain its stats.",
                      "flavorText": "If you can't join 'em, eat 'em.",
                      "hasImage": true,
                      "hasImageGold": false,
                      "hasCropImage": true,
                      "keywords": [],
                      "rarity": {
                        "slug": "epic",
                        "craftingCost": [
                          400,
                          1600
                        ],
                        "dustValue": [
                          100,
                          400
                        ],
                        "name": "Epic"
                      },
                      "class": {
                        "slug": "neutral",
                        "name": "Neutral"
                      },
                      "type": {
                        "slug": "minion",
                        "name": "Minion",
                        "gameModes": []
                      },
                      "cardSet": {
                        "name": "Fractured in Alterac Valley",
                        "slug": "fractured-in-alterac-valley",
                        "type": "expansion",
                        "collectibleCount": 170,
                        "collectibleRevealedCount": 170,
                        "nonCollectibleCount": 373,
                        "nonCollectibleRevealedCount": 70
                      },
                      "spellSchool": null
                    }
                  ],
                  "cardCount": 4305,
                  "pageCount": 861,
                  "page": "1"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Create a free key at https://dataandapis.com/sign-up. 500 tokens a month on the Free plan; this API costs 5 tokens per call."
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}