{
  "openapi": "3.1.0",
  "info": {
    "title": "SuperDuperBundle Game Price API",
    "version": "1.0.0",
    "summary": "Lowest listed PC game key prices across the stores SuperDuperBundle compares.",
    "description": "Look up a game by name, Steam app ID or store URL and get the lowest listed price in US dollars, the store, when it was checked, and the compare page on SuperDuperBundle. Free, no key. Show the attribution and link every price to the game's `url`. Terms: https://superduperbundle.com/tools/api/#terms",
    "contact": {
      "name": "SuperDuperBundle team",
      "email": "contact@superduperbundle.com",
      "url": "https://superduperbundle.com/tools/api/"
    },
    "termsOfService": "https://superduperbundle.com/tools/api/#terms",
    "license": {
      "name": "SuperDuperBundle API terms (client code: MIT)",
      "url": "https://superduperbundle.com/tools/api/#terms"
    }
  },
  "security": [
    {},
    {
      "apiKey": []
    }
  ],
  "servers": [
    {
      "url": "https://superduperbundle.com/api/v1"
    }
  ],
  "externalDocs": {
    "url": "https://superduperbundle.com/tools/api/",
    "description": "Documentation and examples"
  },
  "paths": {
    "/lookup/": {
      "get": {
        "operationId": "lookup",
        "summary": "Find games and their lowest listed prices",
        "description": "Pass exactly one of q, slug, slugs, steam_id, steam_ids, url. Batches take up to 50 values. Answers are cached for 15 minutes.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 80
            },
            "description": "Game name (typos, nicknames and numerals are handled: \"rdr2\", \"gta 5\")."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5,
              "default": 1
            },
            "description": "Results for q."
          },
          {
            "name": "slug",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Our game id."
          },
          {
            "name": "slugs",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated game ids (up to 50)."
          },
          {
            "name": "steam_id",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Steam app ID."
          },
          {
            "name": "steam_ids",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated Steam app IDs (up to 50)."
          },
          {
            "name": "url",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "description": "A Steam store page or one of our game pages."
          },
          {
            "name": "client",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]{0,31}$"
            },
            "description": "Your app name; tags the compare links so we can see which tools send visitors."
          }
        ],
        "responses": {
          "200": {
            "description": "Results (empty when nothing matched).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LookupResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unknown or disabled API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many uncached lookups from one address or key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Price data temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Optional free key from https://superduperbundle.com/tools/api/#keys: 2,500 uncached games per 10 minutes (10,000 for partner keys) instead of 600 per address."
      }
    },
    "schemas": {
      "Offer": {
        "type": "object",
        "required": [
          "store",
          "store_name",
          "store_type",
          "price",
          "drm",
          "region",
          "checked_at"
        ],
        "properties": {
          "store": {
            "type": "string",
            "description": "Store id (our store page: /store/{store}/).",
            "examples": [
              "eneba"
            ]
          },
          "store_name": {
            "type": "string",
            "examples": [
              "Eneba"
            ]
          },
          "store_type": {
            "type": "string",
            "description": "official, retailer or marketplace.",
            "examples": [
              "marketplace"
            ]
          },
          "price": {
            "type": "number",
            "description": "Lowest listed price in US dollars, as the store lists it (the store sets fees and the final total at checkout).",
            "examples": [
              26.49
            ]
          },
          "drm": {
            "type": [
              "string",
              "null"
            ],
            "description": "Where the key activates.",
            "examples": [
              "Steam",
              "GOG",
              "DRM-free"
            ]
          },
          "region": {
            "type": [
              "string",
              "null"
            ],
            "description": "Region the store states for the key.",
            "examples": [
              "Global",
              "US",
              "North America"
            ]
          },
          "checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When this price was last checked at the store."
          }
        }
      },
      "Game": {
        "type": "object",
        "required": [
          "id",
          "name",
          "steam_app_id",
          "url",
          "image",
          "state",
          "currency",
          "list_price",
          "lowest",
          "lowest_steam_key",
          "store_count",
          "offer_count",
          "offers"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Our game id (slug).",
            "examples": [
              "elden-ring"
            ]
          },
          "name": {
            "type": "string",
            "examples": [
              "ELDEN RING"
            ]
          },
          "steam_app_id": {
            "type": [
              "integer",
              "null"
            ],
            "examples": [
              1245620
            ]
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Compare page with every offer. Link to this URL whenever you show a price."
          },
          "image": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Portrait cover (our copy)."
          },
          "state": {
            "type": "string",
            "enum": [
              "price",
              "free",
              "unreleased",
              "not_on_sale"
            ]
          },
          "currency": {
            "type": "string",
            "const": "USD"
          },
          "list_price": {
            "type": [
              "number",
              "null"
            ],
            "description": "Steam's regular (undiscounted) price."
          },
          "lowest": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Offer"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "discount_pct": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "description": "Percent below list_price; null when not below it."
                      }
                    }
                  }
                ]
              }
            ],
            "description": "Cheapest PC key of any kind (see drm)."
          },
          "lowest_steam_key": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Offer"
              }
            ],
            "description": "Cheapest key that activates on Steam."
          },
          "store_count": {
            "type": "integer",
            "description": "Stores with an in-stock PC offer. Below 2, do not present the price as a comparison."
          },
          "offer_count": {
            "type": "integer"
          },
          "offers": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/Offer"
            },
            "description": "Up to 10 offers, cheapest first."
          }
        }
      },
      "LookupResponse": {
        "type": "object",
        "required": [
          "api",
          "count",
          "results",
          "attribution",
          "terms"
        ],
        "properties": {
          "api": {
            "type": "string",
            "const": "v1"
          },
          "query": {
            "type": "object"
          },
          "not_found": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Requested ids with no game in our catalogue."
          },
          "count": {
            "type": "integer"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Game"
            }
          },
          "attribution": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              }
            }
          },
          "terms": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}