Battle.net Decks API

Hearthstone deck lookup

OpenAPI Specification

battle-net-decks-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Battle.net Hearthstone Game Data Card Backs Decks API
  description: The Hearthstone Game Data API provides access to Hearthstone card data, card back collections, deck building, and metadata. Authenticate with OAuth 2.0 client credentials flow to obtain an access token for use in all requests.
  version: '1.0'
  contact:
    name: Blizzard Developer Relations
    url: https://community.developer.battle.net/
  termsOfService: https://www.blizzard.com/en-us/legal/a2989b50-54f6-43f3-b55c-fa78e0ca3b38/blizzard-developer-api-terms-of-use
  x-generated-from: documentation
servers:
- url: https://us.api.blizzard.com
  description: US Region
- url: https://eu.api.blizzard.com
  description: EU Region
- url: https://apac.api.blizzard.com
  description: APAC Region
security:
- oauth2: []
tags:
- name: Decks
  description: Hearthstone deck lookup
paths:
  /hearthstone/deck:
    get:
      operationId: getDeck
      summary: Battle.net Get Hearthstone Deck
      description: Finds a deck by its deck code.
      tags:
      - Decks
      parameters:
      - name: code
        in: query
        required: true
        description: A code that identifies a deck. You can copy a deck code by right-clicking on a deck in the Hearthstone client and selecting Copy.
        schema:
          type: string
        example: AAECAf0EAA8A
      - name: locale
        in: query
        description: The locale to reflect in localized data.
        schema:
          type: string
        example: en_US
      responses:
        '200':
          description: A Hearthstone deck object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deck'
              examples:
                GetDeck200Example:
                  summary: Default getDeck 200 response
                  x-microcks-default: true
                  value:
                    deckCode: AAECAf0EAA8A
                    version: 1
                    format: standard
                    class:
                      slug: mage
                      id: 3
                      name: Mage
                    cards:
                    - id: 52119
                      count: 1
                      slug: 52119-ragnaros-the-firelord
                      name: Ragnaros the Firelord
                    cardCount: 30
        '404':
          description: Deck not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    DeckCard:
      type: object
      title: Deck Card
      description: A card included in a deck.
      properties:
        id:
          type: integer
          description: The card ID.
          example: 52119
        count:
          type: integer
          description: Number of copies of this card in the deck.
          example: 2
        slug:
          type: string
          description: The card slug.
          example: 52119-ragnaros-the-firelord
        name:
          type: string
          description: The card name.
          example: Ragnaros the Firelord
    DeckClass:
      type: object
      title: Deck Class
      description: The class associated with a deck.
      properties:
        slug:
          type: string
          description: The class slug.
          example: mage
        id:
          type: integer
          description: The class ID.
          example: 3
        name:
          type: string
          description: The class name.
          example: Mage
    Deck:
      type: object
      title: Deck
      description: A Hearthstone deck.
      properties:
        deckCode:
          type: string
          description: The deck code string.
          example: AAECAf0EAA8A
        version:
          type: integer
          description: The deck version.
          example: 1
        format:
          type: string
          description: The deck format (standard, wild, classic).
          example: standard
        class:
          $ref: '#/components/schemas/DeckClass'
        cards:
          type: array
          items:
            $ref: '#/components/schemas/DeckCard'
          description: The cards in the deck.
        cardCount:
          type: integer
          description: Total number of cards in the deck.
          example: 30
    ErrorResponse:
      type: object
      title: Error Response
      description: An error response from the API.
      properties:
        code:
          type: integer
          description: HTTP error code.
          example: 404
        type:
          type: string
          description: Error type.
          example: BLZWEBAPI00000404
        detail:
          type: string
          description: A description of the error.
          example: Not Found
  securitySchemes:
    oauth2:
      type: oauth2
      description: Battle.net OAuth 2.0 authentication. Use client credentials flow for game data APIs.
      flows:
        clientCredentials:
          tokenUrl: https://oauth.battle.net/token
          scopes: {}