> ## Documentation Index
> Fetch the complete documentation index at: https://docs.brightdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 从探索页发现 YouTube 视频

> 使用 Bright Data Scraper API 从探索（Explore）页面 URL 发现 YouTube 视频。发送 POST /datasets/v3/scrape 请求，dataset_id 为 gd_lk56epmy2i5g7lzu0k。

## 查询参数

<ParamField query="dataset_id" type="string" default="gd_lk56epmy2i5g7lzu0k" required>
  用于此请求的数据集ID。

  <Warning>
    必须设置为 `gd_lk56epmy2i5g7lzu0k` 以收集**通过探索发现视频**数据。
  </Warning>
</ParamField>

<ParamField query="type" type="string" default="discover_new">
  必须设置为 `discover_new`。
</ParamField>

<ParamField query="discover_by" type="string" default="explore">
  必须设置为 `explore`。
</ParamField>

<ParamField query="notify" type="boolean" default={false}>
  请求完成时是否发送通知。
</ParamField>

<ParamField query="include_errors" type="boolean" default={true}>
  是否在响应中包含错误。
</ParamField>

## 请求体

<ParamField body="input" type="object[]" required>
  输入对象数组。

  <Expandable title="properties">
    <ParamField body="url" type="string" required>
      用于发现视频的YouTube探索页面URL。
    </ParamField>
  </Expandable>

  #### 示例

  ```json wrap theme={null}
  {
    "input": [
      {"url": "https://www.youtube.com/feed/explore"}
    ]
  }
  ```
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"input":[{"url":"https://www.youtube.com/feed/explore"}],"limit_per_input":null}' \
    "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lk56epmy2i5g7lzu0k&notify=false&include_errors=true&type=discover_new&discover_by=explore"
  ```

  ```python Python (requests) theme={null}
  import requests

  response = requests.post(
      "https://api.brightdata.com/datasets/v3/scrape",
      params={
          "dataset_id": "gd_lk56epmy2i5g7lzu0k",
          "notify": "false",
          "include_errors": "true",
          "type": "discover_new",
          "discover_by": "explore",
      },
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      json={
          "input": [{"url": "https://www.youtube.com/feed/explore"}],
          "limit_per_input": None,
      },
  )

  print(response.text)
  ```

  ```javascript Node.js (fetch) theme={null}
  const params = new URLSearchParams({
    dataset_id: "gd_lk56epmy2i5g7lzu0k",
    notify: "false",
    include_errors: "true",
    type: "discover_new",
    discover_by: "explore",
  });

  const response = await fetch(`https://api.brightdata.com/datasets/v3/scrape?${params}`, {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      input: [{ url: "https://www.youtube.com/feed/explore" }],
      limit_per_input: null,
    }),
  });

  console.log(await response.text());
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  [
    {
      "url": "https://www.youtube.com/watch?v=4L_m0m3bEtE",
      "title": "Video Title Here",
      "youtuber": "@channelname",
      "video_url": "https://...",
      "video_length": 96,
      "likes": 18,
      "views": 1648,
      "date_posted": "2025-04-18T05:26:16.000Z",
      "description": "Video description...",
      "num_comments": 0,
      "subscribers": 4810000,
      "video_id": "4L_m0m3bEtE",
      "channel_url": "https://www.youtube.com/@channelname",
      "preview_image": "https://i.ytimg.com/vi/4L_m0m3bEtE/maxresdefault.jpg",
      "shortcode": "4L_m0m3bEtE",
      "verified": true,
      "handle_name": "Channel Name",
      "is_sponsored": false,
      "quality": "hd1080",
      "transcript": "...",
      "tags": ["tag1", "tag2"],
      "is_age_restricted": false
    }
  ]
  ```
</ResponseExample>
