{
  "openapi": "3.0.3",
  "info": {
    "title": "Citebility API",
    "description": "Public HTTP API for the Citebility AI-visibility scan. Run a scan, fetch a report, download a PDF, or look up brand metadata.",
    "version": "1.0.0",
    "contact": {
      "name": "Citebility support",
      "email": "info@citebility.nl",
      "url": "https://citebility.nl"
    },
    "license": {
      "name": "Proprietary"
    }
  },
  "servers": [
    {
      "url": "https://citebility.nl/api",
      "description": "Production"
    }
  ],
  "paths": {
    "/scan": {
      "post": {
        "summary": "Start an AI-visibility scan",
        "description": "Triggers a live scan across ChatGPT, Gemini, Claude, Perplexity and Google AI Overviews for the given URL. Returns a scan ID used to poll the result and download the PDF.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Target URL to scan"
                  },
                  "brand": {
                    "type": "string",
                    "description": "Brand name (optional, improves citation queries)"
                  },
                  "locale": {
                    "type": "string",
                    "enum": [
                      "nl",
                      "en"
                    ],
                    "default": "nl"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Scan started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "scan_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/competitors": {
      "post": {
        "summary": "Detect likely competitors for a domain",
        "description": "Returns a list of likely competitor domains for the given URL or brand.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "brand": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Competitor list"
          }
        }
      }
    },
    "/brand": {
      "get": {
        "summary": "Lookup brand metadata for a URL",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Brand metadata"
          }
        }
      }
    },
    "/report/{scanId}/pdf": {
      "get": {
        "summary": "Download the PDF report for a completed scan",
        "parameters": [
          {
            "name": "scanId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "nl",
                "en"
              ],
              "default": "nl"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PDF report binary",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        }
      }
    }
  }
}