{
  "openapi": "3.1.0",
  "info": {
    "title": "IsGoogDeal Public API",
    "version": "1.0.0",
    "description": "Anonymous, read-only deal search and price benchmark API. No API key is required. Respect Cache-Control s-maxage intervals and send If-None-Match for 304 responses.",
    "termsOfService": "https://isgooddeal.com/terms"
  },
  "servers": [
    {
      "url": "https://isgooddeal.com"
    }
  ],
  "externalDocs": {
    "description": "Machine-readable OpenAPI specification",
    "url": "https://isgooddeal.com/openapi-v1.json"
  },
  "paths": {
    "/api/v1/items": {
      "get": {
        "operationId": "items",
        "summary": "List recent verified deals",
        "description": "Returns recent verified deals filtered by category and keyword. Send If-None-Match to receive 304 Not Modified when unchanged.",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "schema": { "type": "string", "examples": ["computers-components", "phones-wearables", "audio-tv", "gaming", "software-cloud", "home-kitchen", "apparel-outdoor", "travel-finance"], "description": "Valid keys: computers-components, phones-wearables, audio-tv, gaming, software-cloud, home-kitchen, apparel-outdoor, travel-finance." }
          },
          {
            "name": "q",
            "in": "query",
            "schema": { "type": "string" }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 25 }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ItemsResponse" }
              }
            }
          },
          "304": { "description": "Not Modified" },
          "400": {
            "description": "Invalid query parameter",
            "content": {
              "application/problem+json": {
                "schema": { "$ref": "#/components/schemas/Problem" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "required": ["type", "title", "status", "detail", "code", "requestId"],
        "properties": {
          "type": { "type": "string" },
          "title": { "type": "string" },
          "status": { "type": "integer" },
          "detail": { "type": "string" },
          "code": { "type": "string" },
          "requestId": { "type": "string" },
          "retryAfter": { "type": "integer" }
        }
      },
      "ItemsResponse": {
        "type": "object",
        "required": ["interfaceVersion", "filters", "items", "nextCursor", "generatedAt"],
        "properties": {
          "interfaceVersion": { "type": "string" },
          "filters": {
            "type": "object",
            "required": ["category", "q", "limit"],
            "properties": {
              "category": { "type": ["string", "null"] },
              "q": { "type": ["string", "null"] },
              "limit": { "type": "integer" }
            }
          },
          "items": { "type": "array", "items": { "type": "object" } },
          "nextCursor": { "type": ["string", "null"] },
          "generatedAt": { "type": "string", "format": "date-time" }
        }
      }
    }
  }
}
