> ## 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.

# 按店铺发现 TikTok Shop 商品

> 使用 Bright Data Scraper API 按店铺 URL 发现该店铺在售的 TikTok Shop 商品。发送 POST /datasets/v3/scrape 请求，dataset_id 为 gd_m45m1u911dsa4274pi。

## 查询参数

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

  <Warning>
    必须设置为 `gd_m45m1u911dsa4274pi` 以收集**按店铺发现**数据。
  </Warning>
</ParamField>

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

<ParamField query="discover_by" type="string" default="shop_url">
  必须设置为 `shop_url`。
</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="shop_url" type="string" required>
      要发现产品的 TikTok 店铺的 URL。
    </ParamField>

    <ParamField body="num_of_products" type="number">
      要收集的产品数量。缺少值表示没有限制。
    </ParamField>
  </Expandable>

  #### 示例

  ```json wrap theme={null}
  {
    "input": [
      {
        "shop_url": "https://www.tiktok.com/@techgadgets/shop",
        "num_of_products": 25
      }
    ]
  }
  ```
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"input":[{"shop_url":"https://www.tiktok.com/@techgadgets/shop","num_of_products":25}],"limit_per_input":null}' \
    "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_m45m1u911dsa4274pi&notify=false&include_errors=true&type=discover_new&discover_by=shop_url"
  ```

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

  response = requests.post(
      "https://api.brightdata.com/datasets/v3/scrape",
      params={
          "dataset_id": "gd_m45m1u911dsa4274pi",
          "notify": "false",
          "include_errors": "true",
          "type": "discover_new",
          "discover_by": "shop_url",
      },
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      json={
          "input": [
              {
                  "shop_url": "https://www.tiktok.com/@techgadgets/shop",
                  "num_of_products": 25,
              },
          ],
          "limit_per_input": None,
      },
  )

  print(response.text)
  ```

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

  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: [
        {
          shop_url: "https://www.tiktok.com/@techgadgets/shop",
          num_of_products: 25,
        },
      ],
      limit_per_input: null,
    }),
  });

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

<ResponseExample>
  ```json 200 theme={null}
  [
    {
      "url": "https://www.tiktok.com/view/product/1732000000000000000",
      "title": "Smart Watch Fitness Tracker",
      "price": 39.99,
      "currency": "USD",
      "rating": 4.6,
      "reviews_count": 3400,
      "seller_name": "TechGadgets Official",
      "seller_url": "https://www.tiktok.com/@techgadgets",
      "description": "Fitness tracker with heart rate monitor, sleep tracking, and 7-day battery life.",
      "images": [
        "https://p16-oec-ttp.tiktokcdn-us.com/example-product-1.jpeg"
      ],
      "category": "Electronics > Wearables > Smartwatches"
    }
  ]
  ```
</ResponseExample>
