{
  "openapi": "3.1.0",
  "info": {
    "title": "BLEFYI API",
    "description": "Public API for BLEFYI \u2014 a Bluetooth Low Energy encyclopedia with chips, profiles, beacon protocols, Bluetooth versions, and use cases.",
    "version": "1.0.0",
    "contact": {
      "url": "https://blefyi.com/developers/"
    }
  },
  "servers": [
    {
      "url": "https://blefyi.com",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/chip/{slug}/": {
      "get": {
        "operationId": "getChip",
        "summary": "Get BLE chip detail with specs, profiles, and use cases",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "URL slug of the BLE chip",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Chip detail"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/profile/{slug}/": {
      "get": {
        "operationId": "getProfile",
        "summary": "Get BLE profile/service detail with characteristics",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "URL slug of the BLE profile",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Profile detail"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/version/{slug}/": {
      "get": {
        "operationId": "getVersion",
        "summary": "Get Bluetooth version detail with capabilities",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "URL slug of the Bluetooth version",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Version detail"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/beacon/{slug}/": {
      "get": {
        "operationId": "getBeacon",
        "summary": "Get BLE beacon protocol detail",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "URL slug of the beacon protocol",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Beacon protocol detail"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/usecase/{slug}/": {
      "get": {
        "operationId": "getUseCase",
        "summary": "Get BLE use case detail with requirements",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "URL slug of the use case",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Use case detail"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/manufacturer/{slug}/": {
      "get": {
        "operationId": "getManufacturer",
        "summary": "Get BLE chip manufacturer detail",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "URL slug of the manufacturer",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Manufacturer detail"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/term/{slug}/": {
      "get": {
        "operationId": "getGlossaryTerm",
        "summary": "Get glossary term definition",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "URL slug of the glossary term",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Glossary term"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/search/": {
      "get": {
        "operationId": "search",
        "summary": "Search across chips, profiles, versions, beacons, use cases, and glossary",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Search query (minimum 2 characters)",
            "schema": {
              "type": "string",
              "minLength": 2
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "query": {
                      "type": "string"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SearchResult"
                      }
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/compare/": {
      "get": {
        "operationId": "compareChips",
        "summary": "Compare two BLE chips side by side",
        "parameters": [
          {
            "name": "a",
            "in": "query",
            "required": true,
            "description": "Slug of first chip",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "b",
            "in": "query",
            "required": true,
            "description": "Slug of second chip",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Comparison result"
          },
          "400": {
            "description": "Missing parameters"
          },
          "404": {
            "description": "Chip not found"
          }
        }
      }
    },
    "/api/random/": {
      "get": {
        "operationId": "randomChip",
        "summary": "Get a random BLE chip",
        "responses": {
          "200": {
            "description": "Random chip detail"
          }
        }
      }
    },
    "/api/openapi.json": {
      "get": {
        "operationId": "getOpenAPISpec",
        "summary": "OpenAPI 3.1.0 specification",
        "responses": {
          "200": {
            "description": "OpenAPI JSON spec"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SearchResult": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "chip",
              "profile",
              "version",
              "beacon",
              "usecase",
              "glossary"
            ]
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "slug",
          "type",
          "url"
        ]
      }
    }
  }
}