{
  "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": {
    "/dca/collector/jobs": {
      "get": {
        "summary": "List Scraper Studio jobs",
        "description": "Retrieve a paginated list of Bright Data Scraper Studio jobs for your account. `from_date` and `to_date` are required. Filter by scraper ID with `collector`, and paginate with `offset` and `limit`.",
        "parameters": [
          {
            "name": "from_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2026-06-01"
            },
            "description": "Start date for the jobs list, in YYYY-MM-DD format."
          },
          {
            "name": "to_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2026-07-13"
            },
            "description": "End date for the jobs list, in YYYY-MM-DD format."
          },
          {
            "name": "collector",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "c_example1234567890"
            },
            "description": "Scraper ID used to filter jobs for a specific scraper. Get IDs from the List Scrapers endpoint."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0
            },
            "description": "Number of jobs to skip before returning results. Used for pagination."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "minimum": 0,
              "maximum": 500
            },
            "description": "Maximum number of jobs to return. Must be between 0 and 500."
          },
          {
            "name": "sort_asc",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": -1,
              "enum": [
                1,
                -1
              ]
            },
            "description": "Sort direction. Use 1 for ascending order or -1 for descending order."
          }
        ],
        "responses": {
          "200": {
            "description": "A paginated list of Scraper Studio jobs.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer",
                      "description": "Total number of jobs matching the request."
                    },
                    "offset": {
                      "type": "integer",
                      "description": "Zero-based index of the first job returned."
                    },
                    "limit": {
                      "type": "integer",
                      "description": "Maximum number of jobs returned in the response."
                    },
                    "data": {
                      "type": "array",
                      "description": "List of job objects.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Job ID."
                          },
                          "status": {
                            "type": "string",
                            "description": "Current job status, such as running, done, failed or canceled."
                          },
                          "queued": {
                            "type": "string",
                            "description": "Timestamp when the job entered the queue, in ISO 8601 format."
                          },
                          "started": {
                            "type": "string",
                            "description": "Timestamp when the job started, in ISO 8601 format."
                          },
                          "finished": {
                            "type": "string",
                            "description": "Timestamp when the job finished, in ISO 8601 format. Present only for completed jobs."
                          },
                          "inputs": {
                            "type": "integer",
                            "description": "Number of input rows submitted to the job."
                          },
                          "page_loads": {
                            "type": "integer",
                            "description": "Number of page loads used by the job."
                          },
                          "total_pages": {
                            "type": "integer",
                            "description": "Total number of pages discovered or processed by the job."
                          },
                          "failed_pages": {
                            "type": "integer",
                            "description": "Number of pages that failed during the job."
                          },
                          "data_lines": {
                            "type": "integer",
                            "description": "Number of output records produced by the job."
                          },
                          "trigger": {
                            "type": "object",
                            "description": "Information about how the job was triggered.",
                            "properties": {
                              "type": {
                                "type": "string",
                                "description": "Trigger source, such as CP for the control panel."
                              },
                              "user": {
                                "type": "string",
                                "description": "User or system that triggered the job."
                              },
                              "ip": {
                                "type": "string",
                                "description": "IP address associated with the trigger request."
                              }
                            }
                          },
                          "expired": {
                            "type": "string",
                            "description": "Timestamp when the job data expires and is no longer available, in ISO 8601 format."
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "response": {
                    "value": {
                      "total": 3,
                      "offset": 0,
                      "limit": 50,
                      "data": [
                        {
                          "id": "j_example1234567890",
                          "status": "done",
                          "queued": "2026-07-02T12:21:04.121Z",
                          "started": "2026-07-02T12:21:04.387Z",
                          "finished": "2026-07-02T12:21:09.566Z",
                          "inputs": 1,
                          "page_loads": 1,
                          "total_pages": 1,
                          "failed_pages": 0,
                          "data_lines": 50,
                          "trigger": {
                            "type": "CP",
                            "user": "user@example.com",
                            "ip": "192.0.2.10"
                          },
                          "expired": "2026-07-19T00:00:00.000Z"
                        },
                        {
                          "id": "j_example0987654321",
                          "status": "done",
                          "queued": "2026-07-02T12:14:17.941Z",
                          "started": "2026-07-02T12:14:18.098Z",
                          "finished": "2026-07-02T12:14:25.122Z",
                          "inputs": 1,
                          "page_loads": 1,
                          "total_pages": 1,
                          "failed_pages": 0,
                          "data_lines": 50,
                          "trigger": {
                            "type": "CP",
                            "user": "user@example.com",
                            "ip": "192.0.2.10"
                          },
                          "expired": "2026-07-19T00:00:00.000Z"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/dca/collectors_list": {
      "get": {
        "summary": "List Scraper Studio scrapers",
        "description": "Retrieve the Bright Data Scraper Studio scrapers in your account. Each scraper is returned with its ID, name, active status, delivery configuration and output schema. Use the returned `id` as the `collector` parameter when triggering a scraper.",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "amazon"
            },
            "description": "Filters the scraper list by the provided search term."
          }
        ],
        "responses": {
          "200": {
            "description": "A paginated list of Scraper Studio scrapers.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer",
                      "description": "Total number of scrapers matching the request."
                    },
                    "offset": {
                      "type": "integer",
                      "description": "Zero-based index of the first scraper returned."
                    },
                    "limit": {
                      "type": "integer",
                      "description": "Maximum number of scrapers returned in the response."
                    },
                    "data": {
                      "type": "array",
                      "description": "List of scraper objects.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Scraper ID. Use this value as the collector parameter when triggering a scraper."
                          },
                          "name": {
                            "type": "string",
                            "description": "Scraper name shown in Scraper Studio."
                          },
                          "active": {
                            "type": "boolean",
                            "description": "Indicates whether the scraper is active and available for production runs."
                          },
                          "last_run": {
                            "type": "string",
                            "description": "Timestamp of the latest run, in ISO 8601 format. Present when the scraper has run before."
                          },
                          "deliver": {
                            "type": "object",
                            "description": "Delivery configuration for the scraper.",
                            "properties": {
                              "type": {
                                "type": "string",
                                "description": "Delivery type, such as api_pull."
                              }
                            }
                          },
                          "output_schema": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "description": "Output schema configured for the scraper. Can be null if no output schema is available.",
                            "properties": {
                              "type": {
                                "type": "string",
                                "description": "Schema root type, usually object."
                              },
                              "fields": {
                                "type": "object",
                                "description": "Field definitions returned by the scraper, keyed by field name.",
                                "additionalProperties": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "description": "Field type, such as text, number, price, url, array, input, error or warning."
                                    },
                                    "active": {
                                      "type": "boolean",
                                      "description": "Indicates whether the field is active in the scraper output."
                                    },
                                    "items": {
                                      "type": "object",
                                      "description": "Item definition for array fields."
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "response": {
                    "value": {
                      "total": 5,
                      "offset": 0,
                      "limit": 50,
                      "data": [
                        {
                          "id": "c_example1234567890",
                          "name": "example.com",
                          "active": false,
                          "deliver": {
                            "type": "api_pull"
                          },
                          "output_schema": null
                        },
                        {
                          "id": "c_example0987654321",
                          "name": "example.com",
                          "active": true,
                          "last_run": "2026-06-22T11:41:56.660Z",
                          "deliver": {
                            "type": "api_pull"
                          },
                          "output_schema": {
                            "type": "object",
                            "fields": {
                              "product_title": {
                                "type": "text",
                                "active": true
                              },
                              "brand": {
                                "type": "text",
                                "active": true
                              },
                              "rating": {
                                "type": "number",
                                "active": true
                              },
                              "image_urls": {
                                "type": "array",
                                "active": true,
                                "items": {
                                  "type": "url"
                                }
                              },
                              "input": {
                                "type": "input",
                                "active": true
                              },
                              "warning": {
                                "type": "warning",
                                "active": true
                              },
                              "error": {
                                "type": "error",
                                "active": true
                              }
                            }
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/dca/dataset": {
      "get": {
        "description": "Retrieve the results of an asynchronous Scraper Studio batch collection.\n\nWhile the collection is still running, the endpoint returns `202 Accepted` with a status object. When the collection is ready, it returns `200 OK` with a JSON array of records. Use the `collection_id` returned by [POST /dca/trigger](/api-reference/scraper-studio-api/Trigger_a_scraper_for_batch_collection_method) as the `id` query parameter.",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "j_abc123def456"
            },
            "description": "Collection ID returned by `POST /dca/trigger`. Use this value as the `id` query parameter."
          }
        ],
        "responses": {
          "200": {
            "description": "Dataset (Ready)",
            "content": {
              "application/json": {
                "examples": {
                  "response": {
                    "value": [
                      {
                        "Image": "https://targetwebsite.com/product_id.png",
                        "Title": "product_name",
                        "Price": "product_price",
                        "input": {
                          "url": "https://targetwebsite.com/product_id/"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "202": {
            "description": "Waiting for Dataset",
            "content": {
              "application/json": {
                "examples": {
                  "response": {
                    "value": {
                      "status": "building",
                      "message": "Dataset is not ready yet, try again in XXs"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/dca/get_result": {
      "get": {
        "description": "Receive data from real-time work scraper",
        "parameters": [
          {
            "name": "response_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "A unique identification of response"
          },
          {
            "name": "timeout",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "50s"
            },
            "description": "Enables long-polling. The request waits up to this duration for the result to become available instead of returning `202` immediately. Format is `Xs` where X is an integer between 25 and 50 (for example, `25s`, `30s`, `50s`). If no result is available within the timeout, the response returns `202` as usual. Use this to reduce polling calls and avoid hitting rate limits."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "examples": {
                  "Sample (old scrapers)": {
                    "value": {
                      "input": {
                        "url": "https://targetwebsite.com/product_id/"
                      },
                      "line_1": "Lorem ipsum dolor sit amet",
                      "line_2": "consectetur adipisicing elit"
                    }
                  },
                  "Sample (new scrapers)": {
                    "value": [
                      {
                        "line_1": "Lorem ipsum dolor sit amet",
                        "line_2": "consectetur adipisicing elit"
                      }
                    ]
                  }
                }
              }
            }
          },
          "202": {
            "description": "Result not ready yet. Returned when no result is available, including when a `timeout` is set and the result does not become available within the timeout window. Poll again with the same `response_id`."
          }
        }
      }
    },
    "/dca/log/{job_id}": {
      "get": {
        "description": "Get job data by job ID",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the job to retrieve."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "examples": {
                  "response": {
                    "value": {
                      "id": "j_ma13y9ay1piehrso8r",
                      "status": "done",
                      "collector": "c_m9im5n7v82p2y35la",
                      "template": "t_m9jty150kxgwtzcgi.3",
                      "inputs": 1,
                      "dup_inputs": 0,
                      "lines": 60,
                      "fails": 0,
                      "pages": 1,
                      "pages_left": 0,
                      "success": 1,
                      "navigations": 2,
                      "created": "2025-04-28T13:22:16.857Z",
                      "started": "2025-04-28T13:22:17.502Z",
                      "finished": "2025-04-28T13:23:28.961Z",
                      "trigger": "user@example.com",
                      "success_rate": 1,
                      "job_time": 71459,
                      "queue_time": 645
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/dca/trigger_immediate": {
      "post": {
        "description": "Trigger an asynchronous real-time run of a Scraper Studio collector.\n\nThe endpoint returns immediately with a `response_id`. Use this `response_id` with the [Realtime Data endpoint](/api-reference/scraper-studio-api/Receive_data_from_real_time_work_scraper) to retrieve the result when the scrape is complete.\n\nUse this endpoint when you want to start a real-time scrape without keeping the original HTTP request open while the scraper runs. For a request that waits and returns the result directly, use the [synchronous real-time endpoint](/api-reference/scraper-studio-api/initiate-a-realtime-job/sync-realtime-job).",
        "parameters": [
          {
            "name": "collector",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "COLLECTOR_ID"
            },
            "description": "A unique identification of the collector to run"
          },
          {
            "name": "version",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Set to `dev` to trigger the development version of the scraper"
          }
        ],
        "requestBody": {
          "required": true,
          "description": "A single input object. The fields must match the input schema defined for the collector. Some collectors take `url`, others take fields such as `keyword`, `location` or `state`.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Single input object whose fields match the collector input schema.",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Example field for collectors that take a target URL. Replace with the fields your collector expects."
                  }
                }
              },
              "examples": {
                "request": {
                  "value": {
                    "url": "https://targetwebsite.com/product_id/"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns immediately with a `response_id`. Use this ID with the [Realtime Data endpoint](/api-reference/scraper-studio-api/Receive_data_from_real_time_work_scraper) to retrieve the result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "response_id": {
                      "type": "string",
                      "description": "ID of the asynchronous real-time job. Use this value to retrieve the result from the Realtime Data endpoint."
                    }
                  }
                },
                "examples": {
                  "response": {
                    "value": {
                      "response_id": "d2t1786372370082rjv3f11k9v18"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/dca/trigger": {
      "post": {
        "description": "Start an asynchronous batch collection for a published Scraper Studio collector.\n\nThe request body is a JSON array of input objects, and each object must match the input schema defined for the collector. The endpoint returns a `collection_id` immediately. Use this ID with [GET /dca/dataset](/api-reference/scraper-studio-api/Receive_batch_data) to retrieve the results when the collection is complete.\n\nUse batch collection to process multiple inputs in one run. For a single input returned immediately, use the [real-time endpoints](/api-reference/scraper-studio-api/initiate-a-realtime-job/sync-realtime-job).",
        "parameters": [
          {
            "name": "collector",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "c_abc123"
            },
            "description": "Collector ID of the Scraper Studio scraper to run. The ID starts with `c_`."
          },
          {
            "name": "version",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Set to `dev` to trigger the development version of the scraper"
          },
          {
            "name": "name",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Human-readable name for the batch collection."
          },
          {
            "name": "queue_next",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 1
            },
            "description": "If another collection is already running, queue this collection to run after it."
          },
          {
            "name": "queue",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Queue name used to group related collection runs. Runs that share a queue start one after another."
          },
          {
            "name": "confirm_cancel",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 1
            },
            "description": "Cancels a running collection for this collector and runs this one instead."
          },
          {
            "name": "no_downloads",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 1
            },
            "description": "Disables media file downloads for this collection."
          },
          {
            "name": "deadline",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "1h"
            },
            "description": "Sets the maximum time the collection can run. When the deadline is reached, Bright Data terminates the collection. Use `h` for hours, `m` for minutes or `s` for seconds, for example `1h`, `30m` or `45s`."
          },
          {
            "name": "notify",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "{\"type\":\"webhook\",\"endpoint\":\"https://example.com/webhook\"}"
            },
            "description": "Notification configuration for this request as a URL-encoded JSON object. Used alone, the notification is sent when the collection job completes. Used together with `deliver`, the notification is sent after delivery completes."
          },
          {
            "name": "deliver",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "{\"type\":\"s3\",\"bucket\":\"YOUR_BUCKET\",\"credentials\":{\"aws-access-key\":\"YOUR_AWS_ACCESS_KEY\",\"aws-secret-key\":\"YOUR_AWS_SECRET_KEY\"},\"region\":\"YOUR_REGION\",\"directory\":\"brightdata/YOUR_DIRECTORY\",\"filename\":{\"template\":\"results_{[datetime]}\",\"extension\":\"json\"},\"delivery_type\":\"deliver_results\"}"
            },
            "description": "Request-level delivery configuration as a URL-encoded JSON object. Overrides the scraper's default Delivery preferences for this collection only."
          }
        ],
        "requestBody": {
          "required": true,
          "description": "A JSON array of input objects. Each object must match the input schema defined for the collector. A URL-based collector may require a `url` field, while other collectors may require fields such as `keyword`, `location` or `country`. For a single input, send an array with one object.",
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Single input object whose fields match the collector input schema.",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Example field for collectors that take a target URL. Replace with the fields your collector expects."
                    }
                  }
                }
              },
              "examples": {
                "request": {
                  "value": [
                    {
                      "url": "https://example.com/product/1"
                    },
                    {
                      "url": "https://example.com/product/2"
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns a `collection_id` for the new collection run.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "collection_id": {
                      "type": "string",
                      "description": "ID of the collection run. Use this value as the `id` when calling GET /dca/dataset to retrieve results."
                    },
                    "start_eta": {
                      "type": "string",
                      "description": "Estimated start time for the collection, in ISO 8601 format."
                    }
                  }
                },
                "examples": {
                  "response": {
                    "value": {
                      "collection_id": "j_abc123def456",
                      "start_eta": "2026-05-22T13:26:22.702Z"
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "py",
            "label": "Python SDK",
            "source": "# Install: pip install brightdata-sdk\nimport asyncio\nfrom brightdata import BrightDataClient\n\n\nasync def main():\n    async with BrightDataClient(token=\"YOUR_API_KEY\", auto_create_zones=False) as client:\n        # Trigger an async job, then wait for results\n        job = await client.scraper_studio.trigger(\n            \"c_abc123\", {\"url\": \"https://example.com/product/1\"}\n        )\n        data = await job.wait_and_fetch(timeout=120)\n        print(data)\n\n\nasyncio.run(main())"
          },
          {
            "lang": "js",
            "label": "JavaScript SDK",
            "source": "// Install: npm install @brightdata/sdk\nimport { bdclient } from '@brightdata/sdk';\n\nconst client = new bdclient({ apiKey: 'YOUR_API_KEY' });\n\n// Trigger an async job, then wait for results\nconst job = await client.scraperStudio.trigger('c_your_collector_id', {\n  url: 'https://example.com/product/1',\n});\nconst data = await job.waitAndFetch();\n\nconsole.log(data);\n\nawait client.close();"
          }
        ]
      }
    },
    "/dca/crawl": {
      "post": {
        "description": "Trigger a synchronous real-time run of a Scraper Studio collector.\n\nThe request stays open until the scraper finishes or the `timeout` is reached, then returns the collected data directly as JSON. This is the difference from the [async real-time endpoint](/api-reference/scraper-studio-api/initiate-a-realtime-job/async-realtime-job), which returns a `response_id` immediately.\n\nIf the scraper is still running when the `timeout` is reached, the response returns `202 Accepted` with a `response_id`. Use that `response_id` with the [Realtime Data endpoint](/api-reference/scraper-studio-api/Receive_data_from_real_time_work_scraper) to retrieve the result asynchronously.",
        "parameters": [
          {
            "name": "collector",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "c_abc123"
            },
            "description": "A unique identification of the collector to run"
          },
          {
            "name": "timeout",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "50s"
            },
            "description": "How long the request stays open while waiting for the result. Must be between 25s and 50s. If the scraper finishes within the timeout, the response returns `200 OK` with the collected data. If the scraper is still running when the timeout is reached, the response returns `202 Accepted` with a `response_id`."
          },
          {
            "name": "version",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Set to `dev` to trigger the development version of the scraper"
          }
        ],
        "requestBody": {
          "required": true,
          "description": "A single input object. The fields must match the input schema defined for the collector. A URL-based scraper may require `url`, while a search scraper may require fields such as `keyword` and `location`.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Single input object whose fields match the collector input schema.",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Example field for collectors that take a target URL. Replace with the fields your collector expects."
                  }
                }
              },
              "examples": {
                "request": {
                  "value": {
                    "url": "https://www.ebay.com/itm/326972541236"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "examples": {
                  "response": {
                    "value": [
                      {
                        "product_title": "Apple iPad 11th Gen, 128 GB, Wi-Fi + 5G, 11 in - Silver - BRAND NEW SEALED",
                        "price": {
                          "value": 324.99,
                          "currency": "USD",
                          "symbol": "$"
                        },
                        "condition": "New: A brand-new, unused, unopened, undamaged item in its original packaging (where packaging is ...",
                        "seller_feedback_percentage": "100% positive feedback",
                        "seller_items_sold": "173 items sold",
                        "seller_since": "Joined Nov 2012",
                        "item_specifics": {
                          "brand": "Apple",
                          "model": "Apple iPad (11th generation)",
                          "processor_model": "Apple A16 Bionic",
                          "operating_system": "iPadOS"
                        },
                        "storage_options": [],
                        "seller_ratings": {
                          "accurate_description": "--",
                          "shipping_cost": "--",
                          "shipping_speed": "--",
                          "communication": "4.9"
                        },
                        "product_images": [
                          "https://i.ebayimg.com/images/g/4a8AAeSw7x5pboS0/s-l1600.webp",
                          "https://i.ebayimg.com/images/g/4a8AAeSw7x5pboS0/s-l1600.webp"
                        ],
                        "feedback_count": 36,
                        "financing_options": {
                          "monthly_payment": {
                            "value": 13.99,
                            "currency": "USD",
                            "symbol": "$"
                          },
                          "payment_plan_duration": "(12 monthly payment plan)",
                          "apr": "13.99%"
                        },
                        "input": {
                          "url": "https://www.ebay.com/itm/326972541236"
                        },
                        "seller_namestest": "jwc8109"
                      }
                    ]
                  }
                }
              }
            }
          },
          "202": {
            "description": "Timeout waiting for crawl results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Error code indicating the type of timeout"
                    },
                    "message": {
                      "type": "string",
                      "description": "Detailed message about the timeout and instructions for polling results"
                    },
                    "response_id": {
                      "type": "string",
                      "description": "Unique identifier for the response to be used for polling results"
                    }
                  },
                  "required": [
                    "error",
                    "message",
                    "response_id"
                  ]
                },
                "example": {
                  "error": "crawl_results_timeout",
                  "message": "Timed out waiting for crawl results (timeout=NaNs). The page crawl is continuing in the background, you can poll a GET request to https://api.brightdata.com/dca/get_result?response_id=ID until the result is ready",
                  "response_id": "RESPONSE_ID"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "py",
            "label": "Python SDK",
            "source": "# Install: pip install brightdata-sdk\nimport asyncio\nfrom brightdata import BrightDataClient\n\n\nasync def main():\n    async with BrightDataClient(token=\"YOUR_API_KEY\", auto_create_zones=False) as client:\n        # Run and get results in one call (sync)\n        data = await client.scraper_studio.run(\n            collector=\"c_abc123\",\n            input={\"url\": \"https://www.ebay.com/itm/326972541236\"},\n        )\n        print(data)\n\n\nasyncio.run(main())"
          },
          {
            "lang": "js",
            "label": "JavaScript SDK",
            "source": "// Install: npm install @brightdata/sdk\nimport { bdclient } from '@brightdata/sdk';\n\nconst client = new bdclient({ apiKey: 'YOUR_API_KEY' });\n\n// Run and get results in one call (sync)\nconst results = await client.scraperStudio.run('c_your_collector_id', {\n  input: { url: 'https://www.ebay.com/itm/326972541236' },\n});\n\nconsole.log(results);\n\nawait client.close();"
          }
        ]
      }
    },
    "/dca/trigger_hp": {
      "post": {
        "summary": "Trigger a scraper for batch collection method",
        "description": "Triggers an HP batch scraper job and returns a job ID that can be used to track execution status and retrieve errors.",
        "parameters": [
          {
            "name": "collector",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "A unique identification of scraper"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              },
              "examples": {
                "request": {
                  "value": [
                    {
                      "url": "https://targetwebsite.com/product_id/"
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Job successfully triggered",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Indicates whether the job was successfully triggered",
                      "examples": [
                        "true"
                      ]
                    },
                    "inputs": {
                      "type": "integer",
                      "description": "Number of inputs submitted to the job",
                      "examples": [
                        2260
                      ]
                    },
                    "job_id": {
                      "type": "string",
                      "description": "Unique identifier for the triggered job",
                      "examples": [
                        "hp_mjv6r7xv1kk223s67q"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "inputs",
                    "job_id"
                  ]
                },
                "examples": {
                  "successfulTrigger": {
                    "summary": "Successful HP batch trigger",
                    "value": {
                      "success": true,
                      "inputs": 2260,
                      "job_id": "hp_mjv6r7xv1kk223s67q"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid collector parameter",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "example": "Missing or invalid collector parameter"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized request",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "example": "Unauthorized request"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "example": "Internal server error"
                }
              }
            }
          }
        }
      }
    },
    "/dca/jobs/{job_id}/hp_errors": {
      "get": {
        "summary": "Get errors for an job",
        "description": "Retrieves a list of errors generated during execution of an batch scraper job. The job ID must be obtained from the `/trigger_hp` endpoint. If the `skip_normalize` query parameter is provided, full (non-normalized) error details are returned.",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "description": "Job ID returned from the `/trigger_hp` endpoint",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "skip_normalize",
            "in": "query",
            "required": false,
            "description": "Return full (non-normalized) error details",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of errors for the specified job",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "url": {
                            "type": "string",
                            "description": "URL that failed during processing"
                          },
                          "error": {
                            "type": "string",
                            "description": "Error type or reason"
                          },
                          "consumer": {
                            "type": "string",
                            "description": "Internal consumer identifier"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "errors": [
                    {
                      "url": "www.youtube.com/watch?v=GBaFv4O5H7g",
                      "error": "aborted",
                      "consumer": "dca-hp-so-szakh"
                    },
                    {
                      "url": "www.youtube.com/watch?v=dVSRDWxlWBg",
                      "error": "aborted",
                      "consumer": "dca-hp-so-sz5zu"
                    },
                    {
                      "url": "www.youtube.com/watch?v=1YrOL8ZqR4Q",
                      "error": "aborted",
                      "consumer": "dca-hp-so-sz6ga"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid job ID supplied",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "example": "Invalid job ID supplied"
                }
              }
            }
          },
          "404": {
            "description": "Job not found",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "example": "Job not found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "example": "Internal server error"
                }
              }
            }
          }
        }
      }
    },
    "/dca/jobs/{job_id}/pause": {
      "post": {
        "summary": "Pause a Scraper Studio job",
        "operationId": "pauseScraperStudioJob",
        "description": "Pauses an existing Bright Data Scraper Studio job. The job moves to `paused`. Completed jobs cannot be paused, resumed or canceled. Find the `job_id` with the `GET /dca/collector/jobs` endpoint.",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "description": "ID of the job to pause",
            "schema": {
              "type": "string"
            },
            "example": "j_ma13y9ay1piehrso8r"
          }
        ],
        "responses": {
          "200": {
            "description": "Job paused successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "OK"
              }
            }
          },
          "401": {
            "description": "API key missing, malformed or revoked"
          },
          "404": {
            "description": "Job ID does not exist, has expired or belongs to another account"
          }
        }
      }
    },
    "/dca/jobs/{job_id}/resume": {
      "post": {
        "summary": "Resume a Scraper Studio job",
        "operationId": "resumeScraperStudioJob",
        "description": "Resumes an existing Bright Data Scraper Studio job. The job moves to `running`. Completed jobs cannot be paused, resumed or canceled. Find the `job_id` with the `GET /dca/collector/jobs` endpoint.",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "description": "ID of the job to resume",
            "schema": {
              "type": "string"
            },
            "example": "j_ma13y9ay1piehrso8r"
          }
        ],
        "responses": {
          "200": {
            "description": "Job resumed successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "OK"
              }
            }
          },
          "401": {
            "description": "API key missing, malformed or revoked"
          },
          "404": {
            "description": "Job ID does not exist, has expired or belongs to another account"
          }
        }
      }
    },
    "/dca/jobs/{job_id}/cancel": {
      "post": {
        "summary": "Cancel a Scraper Studio job",
        "operationId": "cancelScraperStudioJob",
        "description": "Cancels an existing Bright Data Scraper Studio job. The job moves to `canceled`. Canceling is permanent and a canceled job cannot be resumed. Completed jobs cannot be paused, resumed or canceled. Find the `job_id` with the `GET /dca/collector/jobs` endpoint.",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "description": "ID of the job to cancel",
            "schema": {
              "type": "string"
            },
            "example": "j_ma13y9ay1piehrso8r"
          }
        ],
        "responses": {
          "200": {
            "description": "Job canceled successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "OK"
              }
            }
          },
          "401": {
            "description": "API key missing, malformed or revoked"
          },
          "404": {
            "description": "Job ID does not exist, has expired or belongs to another account"
          }
        }
      }
    },
    "/dca/jobs/{job_id}/rerun": {
      "post": {
        "summary": "Rerun a Scraper Studio job",
        "operationId": "rerunScraperStudioJob",
        "description": "Starts a new run from an existing Bright Data Scraper Studio job. Send no request body to rerun the full job from the beginning, or send `failed_only: 1` to rerun only the failed steps. Only jobs whose data has not expired can be rerun: check the job's `expired` timestamp in the jobs list or job metadata first. If the data has expired, trigger a new job with the original inputs instead. Find the `job_id` with the `GET /dca/collector/jobs` endpoint.",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "description": "ID of the job to rerun",
            "schema": {
              "type": "string"
            },
            "example": "j_ma13y9ay1piehrso8r"
          }
        ],
        "requestBody": {
          "required": false,
          "description": "Omit the body to rerun the full job. Send `failed_only: 1` to rerun only the failed steps.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "failed_only": {
                    "type": "number",
                    "description": "Set to 1 to rerun only the failed steps. Omit to rerun the full job.",
                    "example": 1
                  }
                }
              },
              "example": {
                "failed_only": 1
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rerun job started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "collection_id": {
                      "type": "string",
                      "description": "ID of the new rerun job"
                    },
                    "start_eta": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Estimated start time of the rerun job"
                    }
                  }
                },
                "example": {
                  "collection_id": "j_mdb7x2kq93nfytra1",
                  "start_eta": "2026-07-20T12:10:12.301Z"
                }
              }
            }
          },
          "401": {
            "description": "API key missing, malformed or revoked"
          },
          "404": {
            "description": "Job ID does not exist, has expired or belongs to another account"
          }
        }
      }
    },
    "/dca/collector": {
      "post": {
        "summary": "Create Scraper Template",
        "description": "Creates a Scraper Studio scraper with a sample template.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateScraperRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Scraper created successfully",
            "content": {
              "application/json": {
                "example": {
                  "name": "test collector",
                  "deliver": {
                    "type": "webhook",
                    "endpoint": "https://webhook.site11111",
                    "flatten_csv": false,
                    "delivery_type": "deliver_results"
                  },
                  "active": false,
                  "created": "2026-04-12T06:25:47.708Z",
                  "user": "test@example.com",
                  "customer": "customer",
                  "customer_id": "ID",
                  "output_format_ver": 1,
                  "require_all_success": false,
                  "default_queue_behavior": "parallel",
                  "strict_input_normalize": true,
                  "request_cmd_behavior": "send_ajax_request",
                  "strict_url_validate": true,
                  "no_strange_input_normalize": true,
                  "allow_wait_ms": false,
                  "id": "c_mnvdqy7w1fyaku0uep",
                  "zone": "v__dca_test_collector_15",
                  "notifications": {
                    "success_rate": {
                      "addresses": "test@example.com",
                      "frequency": 1
                    }
                  },
                  "history": [
                    {
                      "date": "2026-04-12T06:25:47.715Z",
                      "user": "user",
                      "comment": "Collector was created"
                    }
                  ],
                  "output_fields": [],
                  "fields": {},
                  "template": {
                    "stub": true
                  },
                  "has_output_fields_mapping": false,
                  "account_id": "ID",
                  "is_under_dataset_migration": false,
                  "under_sla": false,
                  "output_schema_incompatible": false,
                  "beta_output_schema_incompatible": false,
                  "is_scheduled": false
                }
              }
            }
          }
        }
      }
    },
    "/dca/collector/{scraper_id}": {
      "delete": {
        "summary": "Delete a Scraper Studio scraper",
        "operationId": "deleteScraperStudioScraper",
        "description": "Deletes a Scraper Studio scraper from your account. Deleting a scraper removes it from My Scrapers and prevents new manual, scheduled or API-triggered runs. This action cannot be undone. Find the `scraper_id` with the `GET /dca/collectors_list` endpoint.",
        "parameters": [
          {
            "name": "scraper_id",
            "in": "path",
            "required": true,
            "description": "ID of the Scraper Studio scraper to delete. In API parameters, this ID may also be referred to as `collector_id`.",
            "schema": {
              "type": "string"
            },
            "example": "c_mnvdqy7w1fyaku0uep"
          },
          {
            "name": "reason",
            "in": "query",
            "required": false,
            "description": "Reason for deleting the scraper. Used for tracking or audit purposes.",
            "schema": {
              "type": "string"
            },
            "example": "no_longer_needed"
          }
        ],
        "responses": {
          "200": {
            "description": "Scraper deleted successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "OK"
              }
            }
          },
          "401": {
            "description": "API key missing, malformed or revoked"
          }
        }
      }
    },
    "/dca/collectors/{collector_id}/automate_template": {
      "post": {
        "summary": "Trigger AI Flow",
        "description": "Triggers AI flow to generate working scraper code.",
        "parameters": [
          {
            "name": "collector_id",
            "in": "path",
            "description": "Collector ID returned by the [Create Scraper Template](/api-reference/scraper-studio-api/ai-flow/create-scraper-template) API endpoint.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomateTemplateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "AI flow triggered",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Unique identifier for the AI job"
                    },
                    "queued": {
                      "type": "boolean",
                      "description": "Indicates whether the job is queued or currently running"
                    }
                  }
                },
                "example": {
                  "id": "ia_mnvfxano29hv58t24o",
                  "queued": false
                }
              }
            }
          }
        }
      }
    },
    "/dca/collectors/{collector_id}/automate_template/progress": {
      "get": {
        "summary": "Get AI Job Progress",
        "parameters": [
          {
            "name": "collector_id",
            "in": "path",
            "description": "Collector ID returned by the [Create Scraper Template](/api-reference/scraper-studio-api/ai-flow/create-scraper-template) API endpoint.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "AI job progress status",
            "content": {
              "application/json": {
                "example": {
                  "step": "collector_maintainer",
                  "completed_steps": [
                    "prepare_intent_analyzer",
                    "planner",
                    "collector_maintainer",
                    "output_schema_generator",
                    "code_generator",
                    "input_schema_generator",
                    "preview_runner",
                    "preview_picker"
                  ],
                  "status": "done"
                }
              }
            }
          }
        }
      }
    },
    "/dca/collectors/{collector_id}/refactor_template": {
      "post": {
        "summary": "Trigger Self-Healing",
        "description": "Triggers the self-healing tool to refactor the scraper template.",
        "parameters": [
          {
            "name": "collector_id",
            "in": "path",
            "description": "Collector ID returned by the [Create Scraper Template](/api-reference/scraper-studio-api/ai-flow/create-scraper-template) API endpoint.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefactorTemplateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Self-healing triggered"
          }
        }
      }
    },
    "/dca/collectors/{collector_id}/refactor_template/progress": {
      "get": {
        "summary": "Get Self-Healing Job Progress",
        "parameters": [
          {
            "name": "collector_id",
            "in": "path",
            "description": "Collector ID returned by the [Create Scraper Template](/api-reference/scraper-studio-api/ai-flow/create-scraper-template) API endpoint.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Self-healing job progress status"
          }
        }
      }
    },
    "/dca/collectors/{collector_id}/resume_automation_job": {
      "post": {
        "summary": "Resume Self-Healing Job",
        "description": "Approve or reject a Self-Healing job that is paused awaiting user input. Call this when [Get Self-Healing Job Progress](/api-reference/scraper-studio-api/ai-flow/self-healing-job-progress) returns `status: \"pending_answer\"` with `step: \"user_approval\"`. Send `{\"message\": true}` to approve the proposed diff and let the job resume, or `{\"message\": false}` to reject it. Add `\"auto_save\": true` to save the approved template automatically once the job completes successfully.",
        "parameters": [
          {
            "name": "collector_id",
            "in": "path",
            "description": "Collector ID returned by the [Create Scraper Template](/api-reference/scraper-studio-api/ai-flow/create-scraper-template) API endpoint.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResumeAutomationJobRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Self-Healing job resumed"
          }
        }
      }
    },
    "/dca/auto_self_healing/create": {
      "post": {
        "summary": "Enable Auto Self-Healing",
        "description": "Turn on [Auto Self-Healing](/products/scraper-studio/auto-self-healing) for a Scraper Studio scraper and set the trigger rules that decide when a healing job starts. Auto Self-Healing starts only for the `crawl_error`, `parse_error`, `bad_cmd_arg`, `dead_page`, `bad_input` and `bad_navigate` error codes. Auto Self-Healing jobs do not cost credits.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutoSelfHealingCreateRequest"
              },
              "examples": {
                "required_only": {
                  "summary": "Required fields only",
                  "value": {
                    "collector": "c_abc123",
                    "enabled": true,
                    "sr_threshold": 50,
                    "trigger_frequency": "per_day"
                  }
                },
                "per_day": {
                  "summary": "Check once per day",
                  "value": {
                    "collector": "c_abc123",
                    "enabled": true,
                    "sr_threshold": 50,
                    "trigger_frequency": "per_day",
                    "auto_save": false,
                    "cooldown_period": 5,
                    "max_jobs_per_day": 3,
                    "notification_emails": [
                      "data-team@example.com"
                    ]
                  }
                },
                "per_job": {
                  "summary": "Check on every job",
                  "value": {
                    "collector": "c_abc123",
                    "enabled": true,
                    "sr_threshold": 50,
                    "trigger_frequency": "per_job",
                    "min_inputs_threshold": 100,
                    "auto_save": true,
                    "cooldown_period": 5,
                    "max_jobs_per_day": 3
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Auto Self-Healing settings saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "ID of the saved Auto Self-Healing settings.",
                      "example": "ash_lz3k9qw1"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A required field is missing, a value is invalid, or the collector is not active",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "validation_errors": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "example": {
                    "validation_errors": [
                      "Collector must be active"
                    ]
                  }
                }
              }
            }
          },
          "403": {
            "description": "The collector is a managed collector that does not support Auto Self-Healing"
          },
          "404": {
            "description": "No collector with that ID exists on this account",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string",
                  "example": "collector_not_found"
                }
              }
            }
          },
          "409": {
            "description": "Auto Self-Healing settings already exist for this collector"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CreateScraperRequest": {
        "type": "object",
        "required": [
          "name",
          "deliver"
        ],
        "properties": {
          "name": {
            "type": "string",
            "example": "Test"
          },
          "deliver": {
            "$ref": "#/components/schemas/DeliverConfig"
          }
        }
      },
      "AutomateTemplateRequest": {
        "type": "object",
        "required": [
          "description",
          "urls"
        ],
        "properties": {
          "description": {
            "type": "string",
            "maxLength": 500,
            "example": "Extract product data from this page"
          },
          "urls": {
            "type": "array",
            "maxItems": 1,
            "items": {
              "type": "string",
              "format": "uri",
              "example": "https://example.com"
            }
          }
        }
      },
      "RefactorTemplateRequest": {
        "type": "object",
        "required": [
          "prompt"
        ],
        "properties": {
          "prompt": {
            "type": "string",
            "description": "> Maximum string length: 1000",
            "example": "Fix selector issues"
          },
          "custom_input": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "ResumeAutomationJobRequest": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "type": "boolean",
            "description": "`true` approves the proposed diff and lets the Self-Healing job resume. `false` rejects the diff and ends the job.",
            "example": true
          },
          "auto_save": {
            "type": "boolean",
            "description": "Optional. When `true`, the approved template is saved automatically once the Self-Healing job completes successfully. The template is saved only if `message` is `true` (you approved the diff) and the job succeeds. Currently applies to successful jobs only. Defaults to `false`.",
            "example": true
          }
        }
      },
      "AutoSelfHealingCreateRequest": {
        "type": "object",
        "required": [
          "collector",
          "enabled",
          "sr_threshold",
          "trigger_frequency"
        ],
        "properties": {
          "collector": {
            "type": "string",
            "description": "ID of the Scraper Studio scraper to configure, in the `c_` format. Required.",
            "example": "c_abc123"
          },
          "enabled": {
            "type": "boolean",
            "description": "`true` turns Auto Self-Healing on for the scraper, `false` saves the settings with Auto Self-Healing off. Required. Send `false` here to keep it off, because this endpoint cannot be called a second time to disable it later.",
            "example": true
          },
          "sr_threshold": {
            "type": "integer",
            "minimum": 1,
            "maximum": 70,
            "description": "Success rate percentage below which Auto Self-Healing triggers, from `1` to `70`. At `50`, a healing job can start once the scraper's success rate falls below 50 percent. Required, with no default. Decimals are rejected.",
            "example": 50
          },
          "trigger_frequency": {
            "type": "string",
            "enum": [
              "per_day",
              "per_job"
            ],
            "description": "How often Scraper Studio checks the trigger rules. `per_day` checks once per day. `per_job` checks on every job run. Required. Any other value returns HTTP 400.",
            "example": "per_day"
          },
          "min_inputs_threshold": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 10,
            "default": 10,
            "description": "Minimum number of job inputs required before Auto Self-Healing triggers, `10` or higher. A job with fewer inputs does not start a healing job. Required with `trigger_frequency: per_job`. Optional with `per_day`, which does not use it: the server stores `10` when the field is omitted, and `null` is accepted.",
            "example": 100
          },
          "auto_save": {
            "type": "boolean",
            "default": false,
            "description": "When `true`, any successful healing job saves the newly extracted code to production and updates the scraper's template version, with no human review. When `false`, the healing job runs but the generated code is not saved. Defaults to `false`.",
            "example": true
          },
          "cooldown_period": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "default": 3,
            "description": "Minimum hours to wait between consecutive Auto Self-Healing triggers for the scraper, `1` or higher. Send `null` for no cooldown. Defaults to `3`.",
            "example": 5
          },
          "max_jobs_per_day": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 24,
            "default": 8,
            "description": "Maximum number of Auto Self-Healing jobs allowed for the scraper in one day, from `1` to `24`. Send `null` for no daily limit. Defaults to `8`. A failed healing job still counts toward this limit and still starts the cooldown period.",
            "example": 3
          },
          "notification_emails": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "default": [],
            "description": "Email addresses that receive the Auto Self-Healing notifications for this scraper. Each address must belong to a user on the collector's account. Defaults to an empty array, which leaves nobody to review a fix when `auto_save` is `false`.",
            "example": [
              "data-team@example.com"
            ]
          }
        }
      },
      "DatasetDeliveryType": {
        "type": "string",
        "description": "Type of the delivery target",
        "enum": [
          "azure",
          "build",
          "email",
          "gcs",
          "gcs_pubsub",
          "s3",
          "sftp",
          "snowflake",
          "webhook",
          "ali_oss"
        ]
      },
      "DeliveredFileExt": {
        "type": "string",
        "description": "File extension for the delivered files. `parquet` is not available for API download, Email, Webhook or OCI PAR delivery. See [Initiate collection and delivery](/products/scraper-studio/initiate-collection-and-delivery-options#how-do-i-configure-delivery) for the formats each destination supports.",
        "enum": [
          "json",
          "ndjson",
          "csv",
          "xlsx",
          "parquet"
        ]
      },
      "DeliverConfigBase": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "type": {
            "$ref": "#/components/schemas/DatasetDeliveryType"
          },
          "filename": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "template": {
                "type": "string",
                "description": "Template for the filename, including placeholders."
              },
              "extension": {
                "$ref": "#/components/schemas/DeliveredFileExt"
              }
            },
            "required": [
              "template",
              "extension"
            ]
          }
        },
        "required": [
          "type",
          "filename"
        ]
      },
      "DeliverConfigAzure": {
        "allOf": [
          {
            "$ref": "#/components/schemas/DeliverConfigBase"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "enum": [
                  "azure"
                ]
              },
              "container": {
                "type": "string",
                "minLength": 3,
                "pattern": "^[a-z0-9](-?[a-z0-9])*$"
              },
              "credentials": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "account": {
                    "type": "string",
                    "pattern": "^[a-zA-Z0-9]+$"
                  },
                  "key": {
                    "type": "string",
                    "format": "byte"
                  },
                  "sas_token": {
                    "type": "string"
                  }
                },
                "required": [
                  "account"
                ],
                "oneOf": [
                  {
                    "required": [
                      "key"
                    ],
                    "title": "Acess key"
                  },
                  {
                    "required": [
                      "sas_token"
                    ],
                    "title": "Shared access token"
                  }
                ]
              },
              "directory": {
                "type": "string"
              }
            },
            "required": [
              "container",
              "credentials"
            ]
          }
        ]
      },
      "DeliverConfigEmail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/DeliverConfigBase"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "enum": [
                  "email"
                ]
              },
              "address": {
                "type": "string",
                "format": "email",
                "description": "The recipient email address."
              }
            }
          }
        ]
      },
      "DeliverConfigGCS": {
        "allOf": [
          {
            "$ref": "#/components/schemas/DeliverConfigBase"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "enum": [
                  "gcs"
                ]
              },
              "bucket": {
                "type": "string",
                "description": "Name of the bucket."
              },
              "credentials": {
                "type": "object",
                "additionalProperties": false,
                "description": "Credentials for authentication",
                "properties": {
                  "client_email": {
                    "type": "string"
                  },
                  "private_key": {
                    "type": "string"
                  }
                },
                "required": [
                  "client_email",
                  "private_key"
                ]
              },
              "directory": {
                "type": "string",
                "description": "Target path"
              }
            },
            "required": [
              "bucket",
              "credentials"
            ]
          }
        ]
      },
      "DeliverConfigGCSPubSub": {
        "allOf": [
          {
            "$ref": "#/components/schemas/DeliverConfigBase"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "enum": [
                  "gcs_pubsub"
                ]
              },
              "topic_id": {
                "type": "string"
              },
              "attributes": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "credentials": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "client_email": {
                    "type": "string"
                  },
                  "private_key": {
                    "type": "string"
                  }
                },
                "required": [
                  "client_email",
                  "private_key"
                ]
              }
            },
            "required": [
              "topic_id",
              "credentials"
            ]
          }
        ]
      },
      "DeliverConfigS3": {
        "allOf": [
          {
            "$ref": "#/components/schemas/DeliverConfigBase"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "enum": [
                  "s3"
                ]
              },
              "bucket": {
                "type": "string"
              },
              "endpoint_url": {
                "type": "string",
                "description": "S3 like host url, available only with Access Key auth"
              },
              "credentials": {
                "type": "object",
                "additionalProperties": false,
                "minProperties": 2,
                "properties": {
                  "aws-access-key": {
                    "type": "string"
                  },
                  "aws-secret-key": {
                    "type": "string"
                  },
                  "role_arn": {
                    "type": "string"
                  },
                  "external_id": {
                    "type": "string"
                  }
                },
                "oneOf": [
                  {
                    "title": "Role ARN",
                    "required": [
                      "role_arn",
                      "external_id"
                    ]
                  },
                  {
                    "title": "Access Key",
                    "required": [
                      "aws-access-key",
                      "aws-secret-key"
                    ]
                  }
                ]
              },
              "region": {
                "type": "string"
              },
              "directory": {
                "type": "string"
              }
            },
            "required": [
              "bucket",
              "credentials"
            ]
          }
        ]
      },
      "DeliverConfigSFTP": {
        "allOf": [
          {
            "$ref": "#/components/schemas/DeliverConfigBase"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "enum": [
                  "sftp"
                ]
              },
              "path": {
                "type": "string",
                "format": "hostname"
              },
              "port": {
                "type": "integer",
                "minimum": 0,
                "maximum": 65535
              },
              "credentials": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "username": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  },
                  "ssh_key": {
                    "type": "string"
                  },
                  "passphrase": {
                    "type": "string"
                  }
                },
                "required": [
                  "username"
                ]
              },
              "directory": {
                "type": "string"
              }
            },
            "required": [
              "path",
              "credentials"
            ]
          }
        ]
      },
      "DeliverConfigWebhook": {
        "allOf": [
          {
            "$ref": "#/components/schemas/DeliverConfigBase"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "enum": [
                  "webhook"
                ]
              },
              "endpoint": {
                "type": "string",
                "format": "uri",
                "description": "The endpoint URL for the webhook."
              }
            }
          }
        ]
      },
      "DeliverConfigAliOSS": {
        "allOf": [
          {
            "$ref": "#/components/schemas/DeliverConfigBase"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "enum": [
                  "ali_oss"
                ]
              },
              "bucket": {
                "type": "string"
              },
              "credentials": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "access-key": {
                    "type": "string"
                  },
                  "secret-key": {
                    "type": "string"
                  }
                },
                "required": [
                  "access-key",
                  "secret-key"
                ]
              },
              "region": {
                "type": "string"
              },
              "directory": {
                "type": "string"
              }
            },
            "required": [
              "bucket",
              "credentials",
              "region"
            ]
          }
        ]
      },
      "DeliverConfig": {
        "description": "Deliver configuration",
        "oneOf": [
          {
            "title": "Microsoft Azure",
            "$ref": "#/components/schemas/DeliverConfigAzure",
            "description": "Microsoft Azure"
          },
          {
            "title": "Email",
            "$ref": "#/components/schemas/DeliverConfigEmail",
            "description": "Email delivery"
          },
          {
            "title": "Google Cloud",
            "$ref": "#/components/schemas/DeliverConfigGCS",
            "description": "Google Cloud"
          },
          {
            "title": "Google Cloud PubSub",
            "$ref": "#/components/schemas/DeliverConfigGCSPubSub",
            "description": "Google Cloud PubSub"
          },
          {
            "title": "Amazon S3",
            "$ref": "#/components/schemas/DeliverConfigS3",
            "description": "Amazon S3"
          },
          {
            "title": "SFTP",
            "$ref": "#/components/schemas/DeliverConfigSFTP",
            "description": "SFTP"
          },
          {
            "title": "Webhook",
            "$ref": "#/components/schemas/DeliverConfigWebhook",
            "description": "Webhook"
          },
          {
            "title": "Aliyun Object Storage Service",
            "$ref": "#/components/schemas/DeliverConfigAliOSS",
            "description": "Aliyun Object Storage Service"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "azure": "#/components/schemas/DeliverConfigAzure",
            "email": "#/components/schemas/DeliverConfigEmail",
            "gcs": "#/components/schemas/DeliverConfigGCS",
            "gcs_pubsub": "#/components/schemas/DeliverConfigGCSPubSub",
            "s3": "#/components/schemas/DeliverConfigS3",
            "sftp": "#/components/schemas/DeliverConfigSFTP",
            "webhook": "#/components/schemas/DeliverConfigWebhook",
            "ali_oss": "#/components/schemas/DeliverConfigAliOSS"
          }
        }
      }
    },
    "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"
      }
    }
  }
}