{
  "openapi": "3.1.0",
  "info": {
    "title": "Brightdata API",
    "description": "API for interaction with datasets marketplace",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.brightdata.com"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/domains/{metric}": {
      "get": {
        "summary": "Domain usage metrics",
        "description": "Returns domain usage metrics from Bright Data. Supported metrics: bw (Bandwidth consumption), req (Request count).",
        "operationId": "getDomainMetrics",
        "parameters": [
          {
            "name": "metric",
            "in": "path",
            "required": true,
            "description": "Metric type to query:\n#### Available Metrics \n- `/bw` - Bandwidth consumption \n- `/req` - Request count",
            "schema": {
              "type": "string",
              "enum": ["bw", "req"]
            },
            "example": "bw"
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "Start date (YYYY-MM-DD)",
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2025-12-01"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "description": "End date (YYYY-MM-DD)",
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2025-12-10"
            }
          },
          {
            "name": "zones",
            "in": "query",
            "required": false,
            "description": "Zone name filter. Omit to include all zones.",
            "schema": {
              "type": "string",
              "example": "zone_name"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters"
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {},
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Use your Bright Data API Key as a Bearer token in the Authorization header.\n\n**How to authenticate:**\n1. Obtain your API Key from the Bright Data account settings at https://brightdata.com/cp/setting/users\n2. Include the API Key in the Authorization header of your requests\n3. Format: `Authorization: Bearer YOUR_API_KEY`\n\n**Example:**\n```\nAuthorization: Bearer b5648e1096c6442f60a6c4bbbe73f8d2234d3d8324554bd6a7ec8f3f251f07df\n```\n\nLearn how to get your Bright Data API key: https://docs.brightdata.com/api-reference/authentication",
        "bearerFormat": "API Key"
      }
    }
  }
}
