{
  "openapi": "3.1.0",
  "info": {
    "title": "PVPWire Game Data API",
    "version": "0.1.0",
    "description": "Free structured game-mechanics data for agents and developers. Independently compiled facts. PVPWire is not affiliated with or endorsed by Blizzard Entertainment. Diablo is a trademark of Blizzard Entertainment. PVPWire serves independently compiled game-mechanics facts.",
    "contact": { "url": "https://pvpwire.com/developers/" }
  },
  "servers": [{ "url": "https://pvpwire.com" }],
  "paths": {
    "/api/d2/runewords": {
      "get": {
        "summary": "All Diablo 2 runewords",
        "operationId": "getD2Runewords",
        "responses": {
          "200": {
            "description": "Envelope with runeword entries",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Envelope" } } }
          }
        }
      }
    },
    "/api/d2/cube-recipes": {
      "get": {
        "summary": "All Horadric Cube recipes",
        "operationId": "getD2CubeRecipes",
        "responses": {
          "200": {
            "description": "Envelope with recipe entries",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Envelope" } } }
          }
        }
      }
    },
    "/api/d2/breakpoints": {
      "get": {
        "summary": "Breakpoint tables (FCR, FHR, FBR)",
        "operationId": "getD2Breakpoints",
        "parameters": [
          {
            "name": "class",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["amazon", "assassin", "barbarian", "druid", "necromancer", "paladin", "sorceress"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Envelope with breakpoint tables",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Envelope" } } }
          },
          "400": { "description": "Unknown class" }
        }
      }
    },
    "/api/stats": {
      "get": {
        "summary": "Public daily agent-traffic stats",
        "operationId": "getStats",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 14, "maximum": 90 }
          }
        ],
        "responses": {
          "200": { "description": "Daily hit counts by user-agent class" }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Envelope": {
        "type": "object",
        "properties": {
          "data": { "type": "array", "items": { "type": "object" } },
          "meta": {
            "type": "object",
            "properties": {
              "source": { "type": "string" },
              "disclaimer": { "type": "string" },
              "data_version": { "type": "string" },
              "game_patch": { "type": "string" },
              "generated_at": { "type": "string" },
              "license": { "type": "string" },
              "docs": { "type": "string" }
            }
          }
        }
      }
    }
  }
}
