{
  "openapi": "3.1.1",
  "info": {
    "title": "ACDatService API",
    "description": "API for the ACDatService",
    "version": "0.1.0",
    "contact": {
      "name": "Contact Info",
      "email": "petridish@gmail.com",
      "url": "https://github.com/amoeba/acdatservice"
    }
  },
  "servers": [
    {
      "url": "https://dats.treestats.net/",
      "description": "Main ACDatService Server"
    }
  ],
  "paths": {
    "/files/:file_id": {
      "get": {
        "summary": "Get a file by ID",
        "description": "Returns the raw binary content of a DAT file by its ID. The file_id can be specified as a decimal number (e.g., 16777217) or as a hex string with 0x prefix (e.g., 0x1000001). Add ?format=json to request a JSON representation for file types that support it.",
        "operation_id": "files_get",
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "description": "File ID as decimal or hex (0x-prefixed).",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "Optional response format. Use json to request a JSON representation for file types that support export.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/icons": {
      "get": {
        "summary": "List all icon IDs",
        "description": "Returns a newline-separated list of all icon IDs in the database (files with Icon subtype).",
        "operation_id": "icons_index"
      }
    },
    "/files": {
      "get": {
        "summary": "List all file IDs",
        "description": "Returns a newline-separated list of all file IDs in the database.",
        "operation_id": "files_index"
      }
    },
    "/icons/:icon_id": {
      "get": {
        "summary": "Get an icon",
        "description": "Returns a PNG icon with optional scaling applied and any provided underlay, overlay, or UI effect mixed in. Example https://dats.treestats.net/icons/26967?scale=2. All Icon IDs can be passed as decimal or hex and either absolute or relative (to 0x06000000) values can be used. For example, all of these values return the same icon: 0x6957, 0x06006957, 26967, 100690263.",
        "operation_id": "icons_get",
        "parameters": [
          {
            "name": "icon_id",
            "in": "path",
            "description": "Icon ID as decimal or hex. Accepts absolute or relative values.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scale",
            "in": "query",
            "description": "Optional integer value to scale the image by.",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1,
              "maximum": 8
            }
          },
          {
            "name": "background",
            "in": "query",
            "description": "Optional background texture. Accepts texture ID (as decimal or hex, absolute or relative) or an ItemType name (case-insensitive). ItemTypes: melee_weapon, armor, clothing, jewelry, creature, food, money, misc, missile_weapon, container, gem, spell_components, key, caster, portal, promissory_note, mana_stone, service. Use 'random' to select a random ItemType background.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "underlay",
            "in": "query",
            "description": "Optional underlay texture ID as decimal or hex, absolute or relative.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "overlay",
            "in": "query",
            "description": "Optional overlay texture ID as decimal or hex, absolute or relative.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ui_effect",
            "in": "query",
            "description": "Optional UI effect texture. Accepts texture ID (as decimal or hex, absolute or relative) or a UiEffects name (case-insensitive). UiEffects: undef (transparent), magical, poisoned, boost_health, boost_mana, boost_stamina, fire, lightning, frost, acid, bludgeoning, slashing, piercing, nether, default (fire+magical), reversed. Use 'random' to select a random UiEffect.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    }
  }
}