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

# Facebook Scraper API 端点

> 使用可复制粘贴的代码示例向Bright Data Facebook网页抓取器API端点发起同步请求，用于获取资料、页面帖子、帖子、市场和评论。

本指南介绍如何向每个 Bright Data Facebook Scraper API 端点发送同步请求。完成后，你将拥有用于个人资料、页面帖子、帖子、市场列表和评论的工作示例。

## 前提条件

* 一个 [Bright Data 账户](https://www.bright.cn/products/web-scraper/facebook?hs_signup=1\&utm_source=docs) 配有有效的 API key
* 已完成 [快速入门](/cn/products/scrapers/facebook/quickstart)

## 请求结构

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

```
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.facebook.com/..."}]
```

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

<Note>
  `/scrape` 端点专为实时的单 URL 请求设计。Bright Data 建议每个请求不超过 20 个 URL（这是最佳实践，而非硬性限制），端点最多等待 1 分钟。如果采集耗时更长，响应为 HTTP `202`，返回 `snapshot_id` 而不是数据，采集将继续以异步方式进行。请通过[异步请求](/cn/products/scrapers/scrapers-library/async-requests)获取结果，或使用 [Webhook 投递](/cn/products/scrapers/scrapers-library/data-delivery)接收结果。
</Note>

## 个人资料

**数据集 ID：** `gd_mf0urb782734ik94dz`

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

你应该会看到 `200` 响应。处理时间取决于目标网站状况和爬虫负载。

<Accordion title="示例响应">
  ```json theme={null}
  [
    {
      "name": "Mark Zuckerberg",
      "url": "https://www.facebook.com/zuck",
      "id": "4",
      "profile_photo": "https://scontent-phl2-1.xx.fbcdn.net/v/t39.30808-1/632598281_10117314650513371_3238643608998008744_n.jpg?stp=dst-jpg_tt6&cstp=mx711x711&ctp=s200x200&_nc_cat=...",
      "cover_photo": "https://scontent-phl2-1.xx.fbcdn.net/v/t39.30808-6/632550896_10117314656231911_7975049830116595629_n.png?stp=dst-png&cstp=mx820x360&ctp=s820x360&_nc_cat=110&...",
      "location": "Palo Alto, California",
      "city": "Palo Alto"
    }
  ]
  ```
</Accordion>

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

### Facebook 个人资料抓取器返回哪些输出字段？

Facebook 个人资料抓取器（`gd_mf0urb782734ik94dz`，`collect_by_url`）返回 11 个输出字段。字段说明保留 API 返回的英文原文。

| 字段 | 类型 | 说明 |
| - | - | - |
| `url` | url | URL |
| `name` | text | The name of the person |
| `id` | text | The Facebook profile ID |
| `profile_photo` | image | The profile photo |
| `cover_photo` | image | The profile's cover photo |
| `work` | array | The working places of the profile |
| `college` | array | College data of the profile |
| `high_school` | array | High school data of the profile |
| `photos` | array | The profile's photos |
| `location` | text | The location where the profile is from |
| `city` | text | The city where the profile is from |

包含输入 schema 的机器可读版本：[`/scrapers/gd_mf0urb782734ik94dz.json`](/scrapers/gd_mf0urb782734ik94dz.json)

## 页面帖子

**数据集 ID：** `gd_lkaxegm826bjpoo9m5`

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

<Accordion title="示例响应">
  ```json theme={null}
  [
    {
      "url": "https://www.facebook.com/reel/28631238109803230/",
      "num_comments": 82,
      "date_posted": "2026-09-04T15:07:02.000Z",
      "post_id": "1620874212741282",
      "user_url": "https://www.facebook.com/NASA",
      "user_username_raw": "NAS***n",
      "content": "AvGeeks, assemble!\n\nMAX POWER, America’s newest and most exciting aerospace technology expo and air show, is touching down in Florida on Nov. 7–8.\n\nJUST CONF...",
      "num_shares": 62,
      "page_name": "NASA - National Aeronautics and Space Administration",
      "profile_id": "100044561550831"
    }
  ]
  ```
</Accordion>

[完整页面帖子响应模式](/cn/api-reference/scrapers/social-media-apis/facebook-pages-posts-collect-by-url)

### Facebook 页面帖子抓取器返回哪些输出字段？

Facebook 页面帖子抓取器（`gd_lkaxegm826bjpoo9m5`，`collect_by_url`）返回 52 个输出字段。字段说明保留 API 返回的英文原文。

<Accordion title="输出字段（52）">
  | 字段 | 类型 | 说明 |
  | - | - | - |
  | `url` | url | Facebook post URL |
  | `post_id` | text | Unique identifier for each Facebook post |
  | `user_url` | url | Unique identifier for each Facebook post |
  | `user_username_raw` | text | Username of the user who posted the content |
  | `content` | text | Text or media content of the post |
  | `date_posted` | date | Date and time when the post was published |
  | `hashtags` | array | Hashtags used in the post |
  | `num_comments` | number | Number of comments on the post |
  | `num_shares` | number | Number of shares of the post |
  | `num_likes_type` | object | Type of likes received: The data point "count\_reactions\_type" contains all reactions received. |
  | `page_name` | text | Name of the Facebook page where the post was published |
  | `profile_id` | text | Unique identifier for the user's profile |
  | `page_intro` | text | Introduction or description of the Facebook page |
  | `page_category` | text | Category of the Facebook page |
  | `page_logo` | image | Logo of the Facebook page |
  | `page_external_website` | text | External website associated with the Facebook page |
  | `page_likes` | number | Number of likes on the Facebook page |
  | `page_followers` | number | Number of followers of the Facebook page |
  | `page_is_verified` | boolean | Verification status of the Facebook page |
  | `original_post` | object | Indicates if the post is original or a repost |
  | `attachments` | array | Media attachments included in the post |
  | `other_posts_url` | array | Web address of other posts by the same user |
  | `post_external_link` | url | External link included in the post |
  | `post_external_title` | text | Title of the external link |
  | `post_external_image` | url | Post external link image |
  | `page_url` | url | Web address of the Facebook page |
  | `header_image` | image | Header image of the Facebook page |
  | `avatar_image_url` | text | The URL of the avatar image of the Facebook page |
  | `profile_handle` | text | The handle or username of the Facebook page |
  | `has_handshake` | text | Indicates if the post has a handshake |
  | `is_sponsored` | boolean | Indicates whether the post is sponsored or not |
  | `sponsor_name` | text | The name of the sponsor if the post is sponsored |
  | `shortcode` | text | The shortcode of the post URL |
  | `video_view_count` | number | The number of views if the post contains a video |
  | `likes` | number | The number of likes on the post |
  | `post_image` | image | post image url if exists |
  | `post_type` | text | The type of the post |
  | `following` | number | Number of profiles following |
  | `link_description_text` | text | The text that is visible under the link title |
  | `count_reactions_type` | array | Type of reactions received |
  | `is_page` | boolean | Is the post from a page or a profile |
  | `page_phone` | text | Public phone number listed on the page |
  | `page_email` | text | Public email address listed on the page |
  | `page_creation_time` | date | Date the page was created |
  | `page_reviews_score` | text | Average page review score |
  | `page_reviewers_amount` | number | Total number of page reviewers |
  | `page_price_range` | text | Price range label shown on the page |
  | `about` | array | Key-value pairs extracted from the page’s About section |
  | `active_ads_urls` | array | Links to the page’s active ads in Facebook Ad Library |
  | `delegate_page_id` | text | ID of the page shown as responsible for this page |
  | `privacy_and_legal_info` | text | The privacy and legal info of the profile |
  | `play_count` | number | Represents the number of times the video started playing (or was clicked to play) |
</Accordion>

包含输入 schema 的机器可读版本：[`/scrapers/gd_lkaxegm826bjpoo9m5.json`](/scrapers/gd_lkaxegm826bjpoo9m5.json)

## 按帖子 URL 获取帖子

**数据集 ID：** `gd_lyclm1571iy3mv57zw`

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

<Accordion title="示例响应">
  ```json theme={null}
  [
    {
      "url": "https://www.facebook.com/NASA/posts/pfbid0QexwhJRkRC4FUvxx3hcNUkMVZNwTh4mgVi8tbJMAk4nWEaWd3KTiZxAhRc4br2yYl",
      "num_comments": 83,
      "date_posted": "2026-09-02T20:52:09.000Z",
      "post_id": "1619357056226331",
      "user_url": "https://www.facebook.com/NASA",
      "user_username_raw": "NAS***n",
      "content": "Red Moon over Louisiana\n\nOn the night of Aug. 27-28, the full moon slipped through Earth's shadow, creating a near-total lunar eclipse for skywatchers in the...",
      "num_shares": 164,
      "profile_id": "100044561550831",
      "page_logo": "https://scontent-nrt6-1.xx.fbcdn.net/v/t39.30808-1/243095782_416661036495945_3843362260429099279_n.png?stp=dst-png&cstp=mx800x800&ctp=s200x200&_nc_cat=1&ccb=..."
    }
  ]
  ```
</Accordion>

[完整帖子响应模式](/cn/api-reference/scrapers/social-media-apis/facebook-posts-collect-by-url)

### Facebook 按帖子 URL 获取帖子抓取器返回哪些输出字段？

Facebook 按帖子 URL 获取帖子抓取器（`gd_lyclm1571iy3mv57zw`，`collect_by_url`）返回 38 个输出字段。字段说明保留 API 返回的英文原文。

<Accordion title="输出字段（38）">
  | 字段 | 类型 | 说明 |
  | - | - | - |
  | `url` | url | URL |
  | `post_id` | text | Unique identifier for each Facebook post |
  | `user_url` | url | Unique identifier for each Facebook post |
  | `user_username_raw` | text | Username of the user who posted the content |
  | `content` | text | Text or media content of the post |
  | `date_posted` | date | Date and time when the post was published |
  | `hashtags` | array | Hashtags used in the post |
  | `num_comments` | number | Number of comments on the post |
  | `num_shares` | number | Number of shares of the post |
  | `num_likes_type` | array | Type of likes received (e.g., reactions, thumbs-up) |
  | `profile_id` | text | Unique identifier for the user's profile |
  | `page_logo` | url | Logo of the Facebook page |
  | `page_likes` | number | Number of likes on the Facebook page |
  | `page_followers` | number | Number of followers of the Facebook page |
  | `page_is_verified` | boolean | Verification status of the Facebook page |
  | `original_post` | object | Indicates if the post is original or a repost |
  | `attachments` | array | Attachments |
  | `post_external_link` | url | External link included in the post |
  | `post_external_title` | text | Title of the external link |
  | `page_url` | url | Web address of the Facebook page |
  | `header_image` | url | Header image of the Facebook page |
  | `avatar_image_url` | text | The URL of the avatar image of the Facebook page |
  | `profile_handle` | text | The handle or username of the Facebook page |
  | `has_handshake` | text | Indicates if the post has a handshake |
  | `is_sponsored` | boolean | Indicates whether the post is sponsored or not |
  | `sponsor_name` | text | The name of the sponsor if the post is sponsored |
  | `shortcode` | text | The shortcode of the post URL |
  | `video_view_count` | number | The number of views if the post contains a video |
  | `likes` | number | The number of likes on the post |
  | `post_image` | url | post image url if exists |
  | `post_type` | text | The type of the post |
  | `user_handle` | text | User handle |
  | `play_count` | number | Play count |
  | `video_title` | text | Video title |
  | `marketplace_price` | price | Price of the item from market place. This value is relevant for marketplace items that were shared in groups. |
  | `delegate_page_id` | text | ID of the page delegated as “responsible for this Page” |
  | `marketplace_is_sold` | text | Indicates whether the product has been sold, applicable only to marketplace posts |
  | `comments` | array | Comments of the post |
</Accordion>

包含输入 schema 的机器可读版本：[`/scrapers/gd_lyclm1571iy3mv57zw.json`](/scrapers/gd_lyclm1571iy3mv57zw.json)

## 市场

**数据集 ID：** `gd_lvt9iwuh6fbcwmx1a`

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

<Accordion title="示例响应（示意，非实际抓取）">
  ```json theme={null}
  [
    {
      "url": "https://www.facebook.com/marketplace/item/123456789",
      "title": "Vintage Coffee Table",
      "price": "$150",
      "location": "San Francisco, CA",
      "seller_name": "John Doe",
      "description": "Beautiful mid-century modern coffee table..."
    }
  ]
  ```
</Accordion>

[完整市场响应模式](/cn/api-reference/scrapers/social-media-apis/facebook-marketplace-collect-by-url)

### Facebook Marketplace 抓取器返回哪些输出字段？

Facebook Marketplace 抓取器（`gd_lvt9iwuh6fbcwmx1a`，`collect_by_url`）返回 22 个输出字段。字段说明保留 API 返回的英文原文。

<Accordion title="输出字段（22）">
  | 字段 | 类型 | 说明 |
  | - | - | - |
  | `url` | url | The direct URL of the Facebook Marketplace listing page |
  | `title` | text | The title of the listing as posted by the seller |
  | `initial_price` | number | The original listed price of the item before any discounts |
  | `final_price` | number | The current or discounted price of the item |
  | `currency` | text | The currency in which the price is listed |
  | `product_id` | text | The unique identifier assigned to the listing by Facebook Marketplace. |
  | `breadcrumbs` | array | A list of navigation breadcrumb items representing the category hierarchy of the listing |
  | `condition` | text | The condition of the listed item as reported by the seller |
  | `description` | text | The full textual description of the listing, as written by the seller |
  | `location` | text | The general location |
  | `country_code` | text | The two-letter ISO 3166-1 alpha-2 country code |
  | `root_category` | text | The root category the listing belongs to on Facebook Marketplace |
  | `images` | array | A list of URLs pointing to the listing's product images uploaded by the seller |
  | `seller_description` | text | A short bio or description from the seller's Facebook Marketplace profile |
  | `color` | text | The color of the listed item, if applicable and provided by the seller |
  | `brand` | text | The brand or manufacturer of the listed item, if applicable |
  | `videos` | array | A list of URLs pointing to any video content uploaded by the seller as part of the listing |
  | `profile_id` | text | The unique Facebook profile ID of the seller who posted the listing |
  | `listing_date` | date | The date and time when the listing was originally posted on Facebook Marketplace |
  | `car_miles` | number | The mileage of the vehicle as reported by the seller. Only relevant for car/vehicle listings |
  | `is_sold` | boolean | Indicates whether the product is sold |
  | `transmission` | text | Transmission type shown in vehicle details. Only relevant for car/vehicle listings |
</Accordion>

包含输入 schema 的机器可读版本：[`/scrapers/gd_lvt9iwuh6fbcwmx1a.json`](/scrapers/gd_lvt9iwuh6fbcwmx1a.json)

## 评论

**数据集 ID：** `gd_lkay758p1eanlolqw8`

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

<Accordion title="示例响应">
  ```json theme={null}
  [
    {
      "url": "https://www.facebook.com/NASA/posts/pfbid0QexwhJRkRC4FUvxx3hcNUkMVZNwTh4mgVi8tbJMAk4nWEaWd3KTiZxAhRc4br2yYl?locale=en_US",
      "comment_text": "Rayleigh scattering filtering out blue light explains that red moon color same physics as sunsets nice that they captured it from michoud where sls rockets a...",
      "post_id": "pfbid0QexwhJRkRC4FUvxx3hcNUkMVZNwTh4mgVi8tbJMAk4nWEaWd3KTiZxAhRc4br2yYl",
      "post_url": "https://www.facebook.com/NASA/posts/pfbid0QexwhJRkRC4FUvxx3hcNUkMVZNwTh4mgVi8tbJMAk4nWEaWd3KTiZxAhRc4br2yYl?locale=en_US",
      "comment_id": "Y29tbWVudDoxNjE5MzU3MDU2MjI2MzMxXzEwNjQ1NzgzOTMyMjAzNTQ=",
      "user_name": "Tus***a",
      "user_id": "615***",
      "date_created": "2026-09-03T00:51:39.000Z",
      "num_likes": 2,
      "num_replies": 0
    }
  ]
  ```
</Accordion>

[完整评论响应模式](/cn/api-reference/scrapers/social-media-apis/facebook-comments-collect-by-url)

### Facebook 评论抓取器返回哪些输出字段？

Facebook 评论抓取器（`gd_lkay758p1eanlolqw8`，`collect_by_url`）返回 22 个输出字段。字段说明保留 API 返回的英文原文。

<Accordion title="输出字段（22）">
  | 字段 | 类型 | 说明 |
  | - | - | - |
  | `url` | url | The URL of the page or post containing the comments |
  | `post_id` | text | Unique identifier for each post |
  | `post_url` | url | URL of the specific post |
  | `comment_id` | text | Unique identifier for each comment |
  | `user_name` | text | Name of the user who made the comment |
  | `user_id` | text | Unique identifier for each user |
  | `user_url` | url | URL of the user's profile |
  | `date_created` | date | Date and time when the comment was created |
  | `comment_text` | text | The actual text content of the comment |
  | `num_likes` | number | Number of likes or reactions received by the comment |
  | `num_replies` | number | Number of direct replies to the comment |
  | `attached_files` | array | Any files or attachments associated with the comment |
  | `video_length` | number | Length of video content, if applicable |
  | `source_type` | text | Type of source (e.g., Facebook, external link) |
  | `subtype` | text | Subcategory or specific type of the post or comment |
  | `type` | text | General category of the post or comment |
  | `commentator_profile` | url | Commentator profile |
  | `comment_link` | url | Comment URL |
  | `reply` | boolean | Reply |
  | `parent_comment_id` | text | Parent comment id |
  | `commentator_profile_url` | url | The URL of the profile picture of the commentator |
  | `attached_images` | array | Any images associated with the comment |
</Accordion>

包含输入 schema 的机器可读版本：[`/scrapers/gd_lkay758p1eanlolqw8.json`](/scrapers/gd_lkay758p1eanlolqw8.json)

## 快速参考：数据集 ID

| 端点 | 数据集 ID | URL 格式 |
| :- | :- | :- |
| 按个人资料 URL 获取页面帖子 | `gd_lkaxegm826bjpoo9m5` | `facebook.com/{page_name}` |
| 评论 | `gd_lkay758p1eanlolqw8` | `facebook.com/{user}/posts/{post_id}` |
| 按群组 URL 获取帖子 | `gd_lz11l67o2cb3r0lkj3` | `facebook.com/groups/{group_id}` |
| 按帖子 URL 获取帖子 | `gd_lyclm1571iy3mv57zw` | `facebook.com/{user}/posts/{post_id}` |
| 市场 | `gd_lvt9iwuh6fbcwmx1a` | `facebook.com/marketplace/item/{item_id}` |
| 个人资料 | `gd_mf0urb782734ik94dz` | `facebook.com/{username}` |
| 页面和个人资料 | `gd_mf124a0511bauquyow` | `facebook.com/{page_or_profile}` |
| 活动 | `gd_m14sd0to1jz48ppm51` | `facebook.com/events/{event_id}` |
| 按个人资料 URL 获取短视频 | `gd_lyclm3ey2q6rww027t` | `facebook.com/{username}` |
| 公司评论 | `gd_m0dtqpiu1mbcyc2g86` | `facebook.com/{company_page}` |

## 输出格式

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

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

以上是 `/scrape` 的 `format` 值。完整列表（NDJSON（默认）、JSON、JSON lines、CSV 和 Parquet）及各格式适用范围见[输出格式](/cn/products/scrapers/scrapers-library/data-delivery#支持哪些输出格式)。

## 相关内容

<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/facebook-profiles-collect-by-url">
    完整的参数和响应字段参考。
  </Card>
</CardGroup>
