{
  "openapi": "3.0.3",
  "info": {
    "title": "ICOP Products API",
    "version": "1.0.1",
    "description": "Official read-only JSON API for ICOP product, category, and organization data.",
    "contact": {
      "name": "ICOP Technology Inc.",
      "url": "https://www.icop.com.tw"
    }
  },
  "servers": [
    {
      "url": "https://www.icop.com.tw/api/v1",
      "description": "ICOP Products API v1"
    }
  ],
  "tags": [
    {
      "name": "Index",
      "description": "API discovery and endpoint information."
    },
    {
      "name": "Products",
      "description": "ICOP product data."
    },
    {
      "name": "Categories",
      "description": "ICOP product category data."
    },
    {
      "name": "Organization",
      "description": "ICOP organization information."
    }
  ],
  "paths": {
    "/index.json": {
      "get": {
        "tags": [
          "Index"
        ],
        "summary": "Get API index",
        "operationId": "getApiIndex",
        "responses": {
          "200": {
            "description": "API index returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiIndex"
                }
              }
            }
          }
        }
      }
    },
    "/products.json": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Get ICOP products",
        "description": "Returns the complete published machine-readable ICOP product catalog containing 135 valid public product detail pages as of 2026-07-02.",
        "operationId": "getProducts",
        "responses": {
          "200": {
            "description": "Product dataset returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductFeed"
                }
              }
            }
          }
        }
      }
    },
    "/categories.json": {
      "get": {
        "tags": [
          "Categories"
        ],
        "summary": "Get product categories",
        "operationId": "getCategories",
        "responses": {
          "200": {
            "description": "Product category dataset returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CategoryCollection"
                }
              }
            }
          }
        }
      }
    },
    "/about.json": {
      "get": {
        "tags": [
          "Organization"
        ],
        "summary": "Get ICOP organization information",
        "operationId": "getOrganization",
        "responses": {
          "200": {
            "description": "Organization information returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organization"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiIndex": {
        "type": "object",
        "required": [
          "name",
          "version",
          "status",
          "base_url",
          "endpoints"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "publisher": {
            "type": "object"
          },
          "version": {
            "type": "string",
            "example": "v1"
          },
          "status": {
            "type": "string",
            "example": "active"
          },
          "base_url": {
            "type": "string",
            "format": "uri"
          },
          "last_updated": {
            "type": "string",
            "format": "date"
          },
          "endpoints": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Endpoint"
            }
          },
          "usage_guidelines": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Endpoint": {
        "type": "object",
        "properties": {
          "method": {
            "type": "string",
            "example": "GET"
          },
          "format": {
            "type": "string",
            "example": "json"
          },
          "status": {
            "type": "string",
            "example": "active"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "ProductFeed": {
        "type": "object",
        "required": [
          "@context",
          "@type",
          "name",
          "numberOfItems",
          "itemListElement"
        ],
        "properties": {
          "@context": {
            "type": "string",
            "format": "uri"
          },
          "@type": {
            "type": "string",
            "example": "ItemList"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "numberOfItems": {
            "type": "integer",
            "minimum": 0
          },
          "itemListElement": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Product"
            }
          }
        }
      },
      "Product": {
        "type": "object",
        "required": [
          "@type",
          "sku",
          "name",
          "url"
        ],
        "properties": {
          "@type": {
            "type": "string",
            "example": "Product"
          },
          "@id": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "mpn": {
            "type": "string"
          },
          "brand": {
            "$ref": "#/components/schemas/Brand"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "image": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "category": {
            "type": "string"
          },
          "additionalProperty": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PropertyValue"
            }
          }
        }
      },
      "Brand": {
        "type": "object",
        "properties": {
          "@type": {
            "type": "string",
            "example": "Brand"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "PropertyValue": {
        "type": "object",
        "properties": {
          "@type": {
            "type": "string",
            "example": "PropertyValue"
          },
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "CategoryCollection": {
        "type": "object",
        "required": [
          "schema_version",
          "last_updated",
          "name",
          "items"
        ],
        "properties": {
          "schema_version": {
            "type": "string"
          },
          "last_updated": {
            "type": "string",
            "format": "date"
          },
          "name": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Category"
            }
          }
        }
      },
      "Category": {
        "type": "object",
        "required": [
          "@id",
          "name",
          "category_type",
          "url"
        ],
        "properties": {
          "@id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "category_type": {
            "type": "string",
            "enum": [
              "main",
              "series"
            ]
          },
          "parent_id": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "Organization": {
        "type": "object",
        "required": [
          "@context",
          "@type",
          "@id",
          "name",
          "url"
        ],
        "properties": {
          "@context": {
            "type": "string",
            "format": "uri"
          },
          "@type": {
            "type": "string",
            "example": "Organization"
          },
          "@id": {
            "type": "string",
            "format": "uri-reference"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "brand": {
            "$ref": "#/components/schemas/Brand"
          },
          "mainEntityOfPage": {
            "type": "object"
          },
          "subjectOf": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      }
    }
  }
}
