> ## 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端点发送你的第一个请求

> 使用复制粘贴代码示例向所有五个Bright Data TikTok Scraper API端点发出同步请求。

本指南介绍如何向每个 Bright Data TikTok Scraper API 端点发送同步请求。完成后，您将获得用于个人资料、帖子、TikTok Shop、评论和按个人资料发布的帖子的工作示例。

## 前置条件

* 具有有效 API 密钥的 [Bright Data 账户](https://www.bright.cn/cp/start)
* 已完成 [快速开始](/cn/products/scrapers/tiktok/quickstart)

## 请求结构

每个同步请求都遵循相同的模式：

```http theme={null}
POST https://api.brightdata.com/datasets/v3/scrape?dataset_id={DATASET_ID}&format=json
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

[{"url": "https://www.tiktok.com/..."}]
```

端点之间唯一改变的是 `dataset_id` 和输入 URL 格式。

<Note>
  同步请求支持最多 20 个 URL，超时时间为 1 分钟。如果请求耗时更长，API 会自动返回 `snapshot_id`。请参阅 [异步请求](/cn/products/scrapers/scrapers-library/async-requests)。
</Note>

## 个人资料

**数据集 ID：** `gd_l1villgoiiidt09ci`

```bash theme={null}
curl -X POST \
  "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_l1villgoiiidt09ci&format=json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{"url": "https://www.tiktok.com/@tiktok"}]'
```

您应该看到 `200` 响应。这需要 10-30 秒。

<Accordion title="示例响应">
  ```json theme={null}
  [
    {
      "nickname": "TikTok",
      "account_id": "tiktok",
      "biography": "Make your day.",
      "followers": 85600000,
      "following": 580,
      "likes": 520000000,
      "videos_count": 1250,
      "is_verified": true,
      "url": "https://www.tiktok.com/@tiktok",
      "profile_pic_url": "https://..."
    }
  ]
  ```
</Accordion>

[完整个人资料响应架构](/cn/api-reference/scrapers/social-media-apis/tiktok-profiles-collect-by-url)

## 帖子

**数据集 ID：** `gd_lu702nij2f790tmv9h`

```bash theme={null}
curl -X POST \
  "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lu702nij2f790tmv9h&format=json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{"url": "https://www.tiktok.com/@tiktok/video/7345678901234567890"}]'
```

<Accordion title="示例响应">
  ```json theme={null}
  [
    {
      "url": "https://www.tiktok.com/@tiktok/video/7345678901234567890",
      "author": "tiktok",
      "description": "Making every moment count #fyp #trending",
      "likes": 245000,
      "comments": 3200,
      "shares": 18500,
      "views": 5200000,
      "date_posted": "2024-04-10T15:30:00.000Z",
      "hashtags": ["fyp", "trending"],
      "video_url": "https://..."
    }
  ]
  ```
</Accordion>

[完整帖子响应架构](/cn/api-reference/scrapers/social-media-apis/tiktok-posts-collect-by-url)

## TikTok Shop

**数据集 ID：** `gd_m45m1u911dsa4274pi`

```bash theme={null}
curl -X POST \
  "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_m45m1u911dsa4274pi&format=json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{"url": "https://www.tiktok.com/@shop/product/1234567890"}]'
```

<Accordion title="示例响应">
  ```json theme={null}
  [
    {
      "url": "https://www.tiktok.com/@shop/product/1234567890",
      "product_name": "Wireless Bluetooth Earbuds",
      "price": 29.99,
      "currency": "USD",
      "rating": 4.7,
      "reviews_count": 1850,
      "seller_name": "TechStore Official",
      "category": "Electronics"
    }
  ]
  ```
</Accordion>

[完整 TikTok Shop 响应架构](/cn/api-reference/scrapers/social-media-apis/tiktok-shop-collect-by-url)

## 评论

**数据集 ID：** `gd_lkf2st302ap89utw5k`

```bash theme={null}
curl -X POST \
  "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lkf2st302ap89utw5k&format=json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{"url": "https://www.tiktok.com/@tiktok/video/7345678901234567890"}]'
```

<Accordion title="示例响应">
  ```json theme={null}
  [
    {
      "url": "https://www.tiktok.com/@tiktok/video/7345678901234567890",
      "comment_user": "creator_fan",
      "comment_user_url": "https://www.tiktok.com/@creator_fan",
      "comment_date": "2024-04-11T08:15:00.000Z",
      "comment": "This is amazing content!",
      "likes": 42,
      "replies": 3
    }
  ]
  ```
</Accordion>

[完整评论响应架构](/cn/api-reference/scrapers/social-media-apis/tiktok-comments-collect-by-url)

## 按个人资料发布的帖子快速 API

**数据集 ID：** `gd_m7n5v2gq296pex2f5m`

```bash theme={null}
curl -X POST \
  "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_m7n5v2gq296pex2f5m&format=json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{"url": "https://www.tiktok.com/@tiktok"}]'
```

<Accordion title="示例响应">
  ```json theme={null}
  [
    {
      "url": "https://www.tiktok.com/@tiktok/video/7345678901234567890",
      "author": "tiktok",
      "description": "Making every moment count #fyp",
      "likes": 245000,
      "comments": 3200,
      "shares": 18500,
      "views": 5200000,
      "date_posted": "2024-04-10T15:30:00.000Z"
    },
    {
      "url": "https://www.tiktok.com/@tiktok/video/7345678901234567891",
      "author": "tiktok",
      "description": "New feature alert! #tiktok #newfeature",
      "likes": 180000,
      "comments": 2100,
      "shares": 9500,
      "views": 3800000,
      "date_posted": "2024-04-08T12:00:00.000Z"
    }
  ]
  ```
</Accordion>

[完整按个人资料发布的帖子快速 API 响应架构](/cn/api-reference/scrapers/social-media-apis/tiktok-posts-by-profile-fast-api-collect-by-url)

## 快速参考：数据集 ID

| 端点               | 数据集 ID                  | URL 模式                              |
| :--------------- | :---------------------- | :---------------------------------- |
| 个人资料             | `gd_l1villgoiiidt09ci`  | `tiktok.com/@{username}`            |
| 帖子               | `gd_lu702nij2f790tmv9h` | `tiktok.com/@{username}/video/{id}` |
| TikTok Shop      | `gd_m45m1u911dsa4274pi` | `tiktok.com/@shop/product/{id}`     |
| 评论               | `gd_lkf2st302ap89utw5k` | `tiktok.com/@{username}/video/{id}` |
| 按个人资料发布的帖子快速 API | `gd_m7n5v2gq296pex2f5m` | `tiktok.com/@{username}`            |

## 输出格式

使用 `format` 查询参数控制响应格式：

| 值        | 描述                |
| :------- | :---------------- |
| `json`   | JSON 数组（默认）       |
| `ndjson` | 换行分隔的 JSON，每行一条记录 |
| `csv`    | 逗号分隔值             |

## 相关内容

<CardGroup cols={2}>
  <Card title="异步批量请求" icon="layer-group" href="/products/scrapers/scrapers-library/async-requests">
    在单个批量作业中抓取数百个 URL。
  </Card>

  <Card title="API 参考" icon="code" href="/api-reference/scrapers/social-media-apis/tiktok-profiles-collect-by-url">
    完整的参数和响应字段参考。
  </Card>
</CardGroup>
