{
  "openapi": "3.0.3",
  "info": {
    "title": "Vaper.club Public REST API",
    "version": "1.0.0",
    "description": "Read-only JSON API for posts, brands, shops, products and reviews. Same data and logic as the MCP server (https://vaper.club/developers/mcp.md). Adults only: the API provides objective data and does not give guidance on circumventing age verification, purchase restrictions or other legal limits. Product (listing) identifiers are never returned; only brandId, shopId and categoryId appear. Cite sourceUrl when using the data. Missing fields mean unknown, not zero.",
    "externalDocs": { "description": "Documentation", "url": "https://vaper.club/developers/api.md" }
  },
  "externalDocs": { "description": "Documentation", "url": "https://vaper.club/openapi.md" },
  "servers": [{ "url": "https://api.vaper.club/public-api/v1" }],
  "security": [],
  "tags": [
    { "name": "Posts" },
    { "name": "Brands" },
    { "name": "Shops" },
    { "name": "Products" },
    { "name": "Site" },
    { "name": "Skills" }
  ],
  "paths": {
    "/posts/latest": {
      "get": {
        "tags": ["Posts"],
        "operationId": "getLatestPosts",
        "summary": "Latest posts",
        "parameters": [
          { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 } },
          { "$ref": "#/components/parameters/language" },
          { "name": "category", "in": "query", "description": "Post category code, for example news or review.", "schema": { "type": "string" } },
          { "name": "since", "in": "query", "description": "Only posts published on or after this ISO 8601 date.", "schema": { "type": "string", "format": "date-time" } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "400": { "$ref": "#/components/responses/Error" }, "429": { "$ref": "#/components/responses/Error" }, "500": { "$ref": "#/components/responses/Error" } }
      }
    },
    "/posts/search": {
      "get": {
        "tags": ["Posts"],
        "operationId": "searchPosts",
        "summary": "Search posts by keyword",
        "description": "Date filters apply to the returned page only.",
        "parameters": [
          { "name": "q", "in": "query", "required": true, "schema": { "type": "string" } },
          { "$ref": "#/components/parameters/language" },
          { "name": "category", "in": "query", "schema": { "type": "string" } },
          { "name": "type", "in": "query", "schema": { "type": "string", "enum": ["article", "video"] } },
          { "name": "sortBy", "in": "query", "schema": { "type": "string", "enum": ["relevance", "latest"], "default": "relevance" } },
          { "name": "startDate", "in": "query", "schema": { "type": "string", "format": "date-time" } },
          { "name": "endDate", "in": "query", "schema": { "type": "string", "format": "date-time" } },
          { "$ref": "#/components/parameters/page" },
          { "$ref": "#/components/parameters/pageSize" }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "400": { "$ref": "#/components/responses/Error" }, "429": { "$ref": "#/components/responses/Error" }, "500": { "$ref": "#/components/responses/Error" } }
      }
    },
    "/brands/search": {
      "get": {
        "tags": ["Brands"],
        "operationId": "searchBrands",
        "summary": "Search brands",
        "description": "At least one of q, categoryName is required.",
        "parameters": [
          { "name": "q", "in": "query", "schema": { "type": "string" } },
          { "name": "categoryName", "in": "query", "schema": { "type": "string" } },
          { "$ref": "#/components/parameters/language" },
          { "$ref": "#/components/parameters/page" },
          { "$ref": "#/components/parameters/pageSize" }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "400": { "$ref": "#/components/responses/Error" }, "429": { "$ref": "#/components/responses/Error" }, "500": { "$ref": "#/components/responses/Error" } }
      }
    },
    "/brands/details": {
      "get": {
        "tags": ["Brands"],
        "operationId": "getBrandDetailsByQuery",
        "summary": "Brand details by id, slug or name",
        "parameters": [
          { "name": "brandId", "in": "query", "schema": { "type": "integer" } },
          { "name": "slug", "in": "query", "schema": { "type": "string" } },
          { "name": "brandName", "in": "query", "schema": { "type": "string" } },
          { "$ref": "#/components/parameters/language" }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "400": { "$ref": "#/components/responses/Error" }, "404": { "$ref": "#/components/responses/Error" }, "429": { "$ref": "#/components/responses/Error" }, "500": { "$ref": "#/components/responses/Error" } }
      }
    },
    "/brands/{brandId}": {
      "get": {
        "tags": ["Brands"],
        "operationId": "getBrandDetails",
        "summary": "Brand profile, aliases, categories and models",
        "parameters": [
          { "name": "brandId", "in": "path", "required": true, "schema": { "type": "integer" } },
          { "$ref": "#/components/parameters/language" }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "404": { "$ref": "#/components/responses/Error" }, "429": { "$ref": "#/components/responses/Error" }, "500": { "$ref": "#/components/responses/Error" } }
      }
    },
    "/shops/search": {
      "get": {
        "tags": ["Shops"],
        "operationId": "searchShops",
        "summary": "Search shops",
        "description": "At least one of q, country is required.",
        "parameters": [
          { "name": "q", "in": "query", "schema": { "type": "string" } },
          { "name": "country", "in": "query", "description": "ISO 3166-1 alpha-2 country code.", "schema": { "type": "string", "minLength": 2, "maxLength": 2 } },
          { "$ref": "#/components/parameters/language" },
          { "$ref": "#/components/parameters/page" },
          { "$ref": "#/components/parameters/pageSize" }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "400": { "$ref": "#/components/responses/Error" }, "429": { "$ref": "#/components/responses/Error" }, "500": { "$ref": "#/components/responses/Error" } }
      }
    },
    "/shops/details": {
      "get": {
        "tags": ["Shops"],
        "operationId": "getShopDetailsByQuery",
        "summary": "Shop details by id, slug or name",
        "parameters": [
          { "name": "shopId", "in": "query", "schema": { "type": "integer" } },
          { "name": "slug", "in": "query", "schema": { "type": "string" } },
          { "name": "shopName", "in": "query", "schema": { "type": "string" } },
          { "$ref": "#/components/parameters/language" }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "400": { "$ref": "#/components/responses/Error" }, "404": { "$ref": "#/components/responses/Error" }, "429": { "$ref": "#/components/responses/Error" }, "500": { "$ref": "#/components/responses/Error" } }
      }
    },
    "/shops/{shopId}": {
      "get": {
        "tags": ["Shops"],
        "operationId": "getShopDetails",
        "summary": "Shop profile, locations, main brands and categories",
        "parameters": [
          { "name": "shopId", "in": "path", "required": true, "schema": { "type": "integer" } },
          { "$ref": "#/components/parameters/language" }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "404": { "$ref": "#/components/responses/Error" }, "429": { "$ref": "#/components/responses/Error" }, "500": { "$ref": "#/components/responses/Error" } }
      }
    },
    "/products/search": {
      "get": {
        "tags": ["Products"],
        "operationId": "searchProducts",
        "summary": "Search shop product offers",
        "description": "Each item is one shop's offer; several shops can offer the same model.",
        "parameters": [
          { "$ref": "#/components/parameters/productQ" },
          { "$ref": "#/components/parameters/brandName" },
          { "$ref": "#/components/parameters/modelName" },
          { "$ref": "#/components/parameters/categoryName" },
          { "$ref": "#/components/parameters/country" },
          { "$ref": "#/components/parameters/shop" },
          { "name": "sortBy", "in": "query", "schema": { "type": "string", "enum": ["relevance", "latest", "rating", "reviews", "price_asc", "price_desc"], "default": "relevance" } },
          { "$ref": "#/components/parameters/language" },
          { "$ref": "#/components/parameters/page" },
          { "$ref": "#/components/parameters/pageSize" }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "400": { "$ref": "#/components/responses/Error" }, "429": { "$ref": "#/components/responses/Error" }, "504": { "$ref": "#/components/responses/Error" }, "500": { "$ref": "#/components/responses/Error" } }
      }
    },
    "/products/compare": {
      "get": {
        "tags": ["Products"],
        "operationId": "compareProducts",
        "summary": "Compare offers of the best-matching model, cheapest first",
        "parameters": [
          { "$ref": "#/components/parameters/productQ" },
          { "$ref": "#/components/parameters/brandName" },
          { "$ref": "#/components/parameters/modelName" },
          { "$ref": "#/components/parameters/categoryName" },
          { "$ref": "#/components/parameters/country" },
          { "$ref": "#/components/parameters/shop" },
          { "$ref": "#/components/parameters/language" },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 10, "default": 10 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "400": { "$ref": "#/components/responses/Error" }, "429": { "$ref": "#/components/responses/Error" }, "504": { "$ref": "#/components/responses/Error" }, "500": { "$ref": "#/components/responses/Error" } }
      }
    },
    "/products/reviews": {
      "get": {
        "tags": ["Products"],
        "operationId": "getProductReviews",
        "summary": "Review summary and newest reviews of the best-matching product",
        "description": "The summary covers all reviews; the returned reviews are only the latest sample.",
        "parameters": [
          { "$ref": "#/components/parameters/productQ" },
          { "$ref": "#/components/parameters/brandName" },
          { "$ref": "#/components/parameters/modelName" },
          { "$ref": "#/components/parameters/categoryName" },
          { "$ref": "#/components/parameters/country" },
          { "$ref": "#/components/parameters/shop" },
          { "$ref": "#/components/parameters/language" },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 20, "default": 10 } },
          { "name": "sortBy", "in": "query", "schema": { "type": "string", "enum": ["latest", "helpful"], "default": "latest" } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "400": { "$ref": "#/components/responses/Error" }, "429": { "$ref": "#/components/responses/Error" }, "504": { "$ref": "#/components/responses/Error" }, "500": { "$ref": "#/components/responses/Error" } }
      }
    },
    "/site/about": {
      "get": { "tags": ["Site"], "operationId": "getSiteAbout", "summary": "What Vaper.club is, disclaimer and data caveats", "parameters": [{ "$ref": "#/components/parameters/language" }], "responses": { "200": { "$ref": "#/components/responses/Ok" }, "429": { "$ref": "#/components/responses/Error" } } }
    },
    "/site/faq": {
      "get": { "tags": ["Site"], "operationId": "getSiteFaq", "summary": "Data sources, freshness, rate limits and compliance FAQ", "parameters": [{ "$ref": "#/components/parameters/language" }], "responses": { "200": { "$ref": "#/components/responses/Ok" }, "429": { "$ref": "#/components/responses/Error" } } }
    },
    "/site/categories": {
      "get": { "tags": ["Site"], "operationId": "getSiteCategories", "summary": "Product categories (id, code, localized name)", "parameters": [{ "$ref": "#/components/parameters/language" }], "responses": { "200": { "$ref": "#/components/responses/Ok" }, "429": { "$ref": "#/components/responses/Error" } } }
    },
    "/site/languages": {
      "get": { "tags": ["Site"], "operationId": "getSiteLanguages", "summary": "Supported languages", "responses": { "200": { "$ref": "#/components/responses/Ok" }, "429": { "$ref": "#/components/responses/Error" } } }
    },
    "/skills": {
      "get": { "tags": ["Skills"], "operationId": "listSkills", "summary": "List Agent Skills", "responses": { "200": { "$ref": "#/components/responses/Ok" }, "429": { "$ref": "#/components/responses/Error" } } }
    },
    "/skills/{name}": {
      "get": {
        "tags": ["Skills"],
        "operationId": "getSkill",
        "summary": "Get a skill's SKILL.md",
        "parameters": [{ "name": "name", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": {
          "200": { "description": "SKILL.md content", "content": { "text/markdown": { "schema": { "type": "string" } } } },
          "404": { "$ref": "#/components/responses/Error" },
          "429": { "$ref": "#/components/responses/Error" }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "language": {
        "name": "language",
        "in": "query",
        "description": "Language code (en, de, fr, ...). Falls back to the x-i18n-language header, Accept-Language, then the site default.",
        "schema": { "type": "string" }
      },
      "page": { "name": "page", "in": "query", "schema": { "type": "integer", "minimum": 1, "default": 1 } },
      "pageSize": { "name": "pageSize", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 20, "default": 10 } },
      "productQ": { "name": "q", "in": "query", "required": true, "description": "Product name, brand, model or search keywords.", "schema": { "type": "string" } },
      "brandName": { "name": "brandName", "in": "query", "schema": { "type": "string" } },
      "modelName": { "name": "modelName", "in": "query", "schema": { "type": "string" } },
      "categoryName": { "name": "categoryName", "in": "query", "description": "Product category name or code.", "schema": { "type": "string" } },
      "country": { "name": "country", "in": "query", "description": "ISO 3166-1 alpha-2 country code of the shop location.", "schema": { "type": "string", "minLength": 2, "maxLength": 2 } },
      "shop": { "name": "shop", "in": "query", "description": "Shop name.", "schema": { "type": "string" } }
    },
    "headers": {
      "RetryAfter": { "description": "Seconds to wait before retrying.", "schema": { "type": "integer" } }
    },
    "responses": {
      "Ok": {
        "description": "Success",
        "headers": { "Cache-Control": { "schema": { "type": "string", "example": "public, max-age=60" } } },
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } }
      },
      "Error": {
        "description": "Error. 400 INVALID_PARAMETER/MISSING_FILTER, 404 NOT_FOUND, 429 RATE_LIMITED, 504 TIMEOUT, 500 SYSTEM_ERROR.",
        "headers": { "Retry-After": { "$ref": "#/components/headers/RetryAfter" } },
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } }
      }
    },
    "schemas": {
      "ApiResponse": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean" },
          "data": { "nullable": true, "description": "Endpoint specific payload." },
          "pagination": { "$ref": "#/components/schemas/Pagination" },
          "meta": { "$ref": "#/components/schemas/Meta" },
          "error": { "$ref": "#/components/schemas/ApiError" }
        },
        "required": ["success"]
      },
      "Pagination": {
        "type": "object",
        "nullable": true,
        "properties": {
          "page": { "type": "integer" },
          "pageSize": { "type": "integer" },
          "total": { "type": "integer" },
          "hasMore": { "type": "boolean" }
        }
      },
      "Meta": {
        "type": "object",
        "properties": {
          "requestId": { "type": "string", "example": "req_..." },
          "timestamp": { "type": "string", "format": "date-time" },
          "language": { "type": "string", "example": "en" },
          "warnings": { "type": "array", "items": { "type": "string" } }
        }
      },
      "ApiError": {
        "type": "object",
        "nullable": true,
        "properties": {
          "code": { "type": "string", "enum": ["INVALID_PARAMETER", "MISSING_FILTER", "NOT_FOUND", "RATE_LIMITED", "TIMEOUT", "SYSTEM_ERROR"] },
          "message": { "type": "string" },
          "retryAfterSeconds": { "type": "integer", "nullable": true }
        }
      }
    }
  }
}
