{
  "openapi": "3.1.0",
  "info": {
    "title": "Web3icon API",
    "version": "1.0.0",
    "description": "Free read-only API for discovering Web3 and blockchain icons and retrieving direct PNG and SVG asset URLs."
  },
  "servers": [
    { "url": "https://web3icon.xyz" }
  ],
  "paths": {
    "/api/icons/": {
      "get": {
        "operationId": "listWeb3Icons",
        "summary": "List and search Web3 icons",
        "description": "Returns blockchain, NFT, token, wallet, staking, bridge, exchange, and Web3 brand icons.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Case-insensitive title or tag search.",
            "schema": { "type": "string" }
          },
          {
            "name": "category",
            "in": "query",
            "description": "Exact category filter, such as Icon or Brand.",
            "schema": { "type": "string" }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of results from 1 to 100.",
            "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 100 }
          }
        ],
        "responses": {
          "200": {
            "description": "Icon collection",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/IconListResponse" }
              }
            }
          }
        }
      }
    },
    "/api/icons/{slug}/": {
      "get": {
        "operationId": "getWeb3Icon",
        "summary": "Get one Web3 icon",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Icon slug returned by the list endpoint.",
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "Icon metadata and asset URLs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "version": { "type": "string" },
                    "icon": { "$ref": "#/components/schemas/Icon" }
                  },
                  "required": ["version", "icon"]
                }
              }
            }
          },
          "404": { "description": "Icon not found" }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Icon": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "slug": { "type": "string" },
          "title": { "type": "string" },
          "description": { "type": "string" },
          "categories": { "type": "array", "items": { "type": "string" } },
          "tags": { "type": "array", "items": { "type": "string" } },
          "pngUrl": { "type": "string", "format": "uri" },
          "svgUrl": { "type": "string" },
          "backgroundColor": { "type": "string" },
          "sourceUrl": { "type": "string" },
          "sourceLabel": { "type": "string" }
        },
        "required": ["id", "slug", "title", "categories", "pngUrl"]
      },
      "IconListResponse": {
        "type": "object",
        "properties": {
          "version": { "type": "string" },
          "count": { "type": "integer" },
          "icons": { "type": "array", "items": { "$ref": "#/components/schemas/Icon" } }
        },
        "required": ["version", "count", "icons"]
      }
    }
  }
}
