{
  "openapi": "3.1.0",
  "info": {
    "title": "DataBee SiteAtlas API",
    "description": "DataBee SiteAtlas API turns any web domain into clean traffic intelligence, engagement metrics, SEO rankings, competitor insights, and AI referral analytics.",
    "version": "1.0.0",
    "termsOfService": "https://databee.dev/terms-of-service/",
    "contact": {
      "name": "DataBee Developer Support",
      "url": "https://databee.dev",
      "email": "hello@databee.dev"
    }
  },
  "servers": [
    {
      "url": "https://api.databee.dev",
      "description": "Production Direct Gateway (Developer DataBee https://console.databee.dev)"
    },
    {
      "url": "https://siteatlas.p.rapidapi.com",
      "description": "RapidAPI Hub — SiteAtlas (Recommended Trademark-Free Listing)"
    },
    {
      "url": "https://similarweb-api-pro.p.rapidapi.com",
      "description": "RapidAPI Hub — Similarweb API Pro (Legacy Listing)"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    },
    {
      "ApiKeyAuth": []
    },
    {
      "RapidApiKeyAuth": [],
      "RapidApiHostAuth": []
    }
  ],
  "paths": {
    "/siteatlas/site-overview": {
      "get": {
        "summary": "Retrieve Comprehensive Site Intelligence",
        "description": "Returns traffic volume history, engagement metrics, ranking positions, traffic acquisition breakdown, top SEO keywords, and AI referral sources.",
        "operationId": "getSiteOverview",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "Target fully qualified domain name (e.g., github.com)",
            "schema": {
              "type": "string",
              "example": "github.com"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful site overview query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOverviewResponse"
                }
              }
            }
          },
          "400": {
            "description": "Missing parameter or invalid domain format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Insufficient credit balance"
          }
        }
      }
    },
    "/siteatlas/site-similar": {
      "get": {
        "summary": "Find Similar & Competitor Websites",
        "description": "Retrieves ranked list of similar domains, competitor sites, category metadata, and similarity confidence scores.",
        "operationId": "getSiteSimilar",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "Target fully qualified domain name (e.g., github.com)",
            "schema": {
              "type": "string",
              "example": "github.com"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful similar sites query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteSimilarResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid domain or missing parameter"
          }
        }
      }
    },
    "/siteatlas/country-metadata": {
      "get": {
        "summary": "List ISO Country Code Mappings",
        "description": "Returns ISO 3166-1 standard country reference mappings used in SiteAtlas traffic geography breakdowns.",
        "operationId": "getCountryMetadata",
        "responses": {
          "200": {
            "description": "Successful country metadata query"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Pass your DataBee API key in standard HTTP Bearer header (`Authorization: Bearer <key>`). Generate free key at https://console.databee.dev"
      },
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Pass your DataBee API key in `X-API-Key` header"
      },
      "RapidApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-rapidapi-key",
        "description": "Pass your RapidAPI key in `x-rapidapi-key` header"
      },
      "RapidApiHostAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-rapidapi-host",
        "description": "Pass RapidAPI target host header (`siteatlas.p.rapidapi.com` or `similarweb-api-pro.p.rapidapi.com`)"
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "error"
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "example": "INVALID_DOMAIN"
              },
              "message": {
                "type": "string"
              },
              "target": {
                "type": "string"
              }
            }
          }
        }
      },
      "SiteOverviewResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "success"
          },
          "website": {
            "type": "object"
          },
          "rankings": {
            "type": "object"
          },
          "traffic": {
            "type": "object"
          },
          "seo": {
            "type": "object"
          },
          "ai_referrals": {
            "type": "object"
          }
        }
      },
      "SiteSimilarResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "success"
          },
          "source_site": {
            "type": "object"
          },
          "similar_sites": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      }
    }
  }
}