# Facebook 个人主页帖子与完整照片集抓取 (`spbotdel/facebook-profile-posts-cn`) Actor

抓取 Facebook 公开个人主页的最新与历史帖子，输出机器可读的 JSON 数据：正文、发布时间、作者、互动数据、稳定帖子链接，以及全部可获取的照片链接（含隐藏的 +N 照片集）。支持 Apify API、MCP、日常监控与历史回填。

- **URL**: https://apify.com/spbotdel/facebook-profile-posts-cn.md
- **Developed by:** [Sergei Belostotskii](https://apify.com/spbotdel) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.49 / 1,000 facebook 个人主页帖子

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Facebook 个人主页帖子与完整照片集抓取

[![Run on Apify](https://img.shields.io/badge/Run%20on-Apify-2f7df6)](https://apify.com/spbotdel/facebook-profile-posts-cn)
[![AI agents](https://img.shields.io/badge/AI%20agents-MCP%20ready-6f42c1)](https://docs.apify.com/integrations/mcp)
[![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)

抓取 **Facebook 公开个人主页的最新与历史帖子**，输出干净的机器可读 JSON：正文、Facebook 发布时间、作者、互动数据、稳定帖子链接，以及**全部可恢复的照片链接**（包括藏在 `+N` 缩略图后面的照片）。

> \*\*一个计费结果 = 一个个人主页帖子。\*\*展开的照片链接包含在同一条数据、同一个按帖计费的价格里，不按照片收费。不需要你提供 Facebook 账号或 Cookie。

| 适合 | 不适合 |
| --- | --- |
| 公开个人主页、最新帖监控、历史回填、图片多的帖子、AI agent、MCP、API 与定时任务 | 私密/需登录的主页、小组、公共主页、Marketplace 搜索、评论展开、视频下载 |

### 为什么需要它：丢照片问题

Facebook 经常只显示几张预览图加一个 `+N` 角标，剩下的照片藏在单独的照片集里。只看预览的采集器会返回一条看起来正常的帖子，却悄悄丢掉大部分照片。

本 Actor 把照片完整度当作帖子的一部分：识别照片集 token、可疑 `+N` 布局，展开可恢复的照片集，并输出照片质量字段。

### 快速开始

1. 填入公开个人主页链接（支持数字 ID 与个性化地址），`maxPostsPerProfile` 填想要的条数。
2. 保持 **Expand all photos（展开全部照片）** 开启；置顶旧帖可用 Omit pinned posts 排除。
3. 日常监控：传入 `knownPostIds` 或 `sinceDate`，遇到已知帖子即停止，不重复花钱。
4. 历史回填：拿上一次 `SUMMARY.pointer.nextCursor`，用 `startCursor` 继续向更早翻页。

### 定价

**每 1000 个帖子 $4.99**（Free/Bronze 计划），另加每次运行 `$0.00005` 的启动事件。
付费 Apify 计划享受 Store 折扣：Silver `$4.74`，Gold/Platinum/Diamond `$4.49`/1000 帖。

| 数量 | 费用 |
| ---: | ---: |
| 20 帖 | `$0.0998` |
| 100 帖 | `$0.4990` |
| 1000 帖 | `$4.9900` |

- 一个 dataset 条目 = 一个公开个人主页帖子；
- 所有找回的照片链接都含在同一条结果里；
- 不按照片数量收费；
- 以 [Actor 页面](https://apify.com/spbotdel/facebook-profile-posts-cn)的价格卡为准。

### 常见问题

#### 需要 Facebook 账号或 Cookie 吗？

不需要。只采集公开主页可见的内容。若 Facebook 临时弹出登录墙，Actor 会在 `SUMMARY` 中如实报告。

#### 中文主页支持吗？

支持。正文、作者名中的中文（简体/繁体）会原样输出，照片集展开不受语言影响。

#### 能采评论或私密主页吗？

评论展开与私密主页不在本 Actor 范围内。只需要公开帖子与照片——选它。

### 限制

公开主页可见什么，就采什么：被删除、被设限、过期的媒体拿不到；视频仅返回可恢复的链接，不保证下载。

### 反馈

英文原版：[facebook-profile-posts-all-photos-scraper](https://apify.com/spbotdel/facebook-profile-posts-all-photos-scraper)。遇到问题请附 run ID 与 `SUMMARY`，不要贴 Cookie 或 token。

# Changelog

This Actor's version history is a separate document: https://apify.com/spbotdel/facebook-profile-posts-cn/changelog.md

# Actor input Schema

## `profileUrls` (type: `array`):

必填。公开 Facebook 个人主页的链接、个性化主页地址、数字 ID、profile.php?id=... 链接或 /people/.../<id> 链接。请勿填写公共主页、小组、Marketplace 链接或私密/需登录的个人主页。一次运行最多处理 maxProfilesPerRun 个个人主页。

## `maxProfilesPerRun` (type: `integer`):

一次运行中独立处理的个人主页目标最大数量。结果和计费按个人主页倍增。多余的 profileUrls 会被跳过，并在 SUMMARY 中报告。

## `maxPostsPerProfile` (type: `integer`):

每个个人主页返回的最大公开帖子结果数。每个帖子为一个计费结果：10 个个人主页 x 1,000 个帖子约为 10,000 个计费结果。首次测试或日常监控请使用较小数值。如需更深历史，请求至多 1,000 个帖子，然后使用 SUMMARY.profiles\[].pointer.nextCursor 继续。

## `expandAllPhotos` (type: `boolean`):

尽力还原藏在 Facebook +N 相册后面的公开照片链接。建议保持开启以获得完整数据；仅在快速预览时关闭。

## `omitPinnedPosts` (type: `boolean`):

排除个人主页顶部固定的旧置顶帖，让最新帖采集与定时监控更可预测。

## `sinceDate` (type: `string`):

可选监控边界。从个人主页头部开始，遇到早于此日期的帖子后停止。请使用 ISO 日期或时间戳。对于精确的已知帖子停止点，优先使用 knownPostIds。 状态路由：每日最新监控 -> knownPostIds（日期截断时用 sinceDate）；较旧帖子回填 -> 从 SUMMARY.pointer.nextCursor 获取 startCursor。切勿将回填游标传入最新运行。

## `knownPostIds` (type: `array`):

你的系统里已存的帖子 ID。Actor 从最新可见帖子开始，遇到第一个匹配 ID 即停止，最适合无重复花费的定时监控。 状态路由：每日最新监控 -> knownPostIds（日期截断时用 sinceDate）；较旧帖子回填 -> 从 SUMMARY.pointer.nextCursor 获取 startCursor。切勿将回填游标传入最新运行。

## `startCursor` (type: `string`):

SUMMARY.pointer.nextCursor 中的游标，用于单个个人主页的更早历史回填。不要拿昨天的游标找新帖子，也不要把一个主页的游标用于另一个。 状态路由：每日最新监控 -> knownPostIds（日期截断时用 sinceDate）；较旧帖子回填 -> 从 SUMMARY.pointer.nextCursor 获取 startCursor。切勿将回填游标传入最新运行。

## `includeRawPayload` (type: `boolean`):

高级。保持默认值，除非 SUMMARY 诊断明确指出此开关。 在每条结果中附带解析后的 Facebook 原始数据。仅在调试或研究结构时开启，输出会大很多。

## `includeUnavailablePosts` (type: `boolean`):

高级。保持默认值，除非 SUMMARY 诊断明确指出此开关。 返回那些分享或关联内容已被删除或受限的动态卡片。默认关闭，以免空卡片占用帖子名额。

## `bootstrapRetries` (type: `integer`):

高级。保持默认值，除非 SUMMARY 诊断明确指出此开关。 个人主页解析与初始化失败时，全新代理/会话的重试次数。

## `graphqlPageRetries` (type: `integer`):

高级。保持默认值，除非 SUMMARY 诊断明确指出此开关。 遇到临时性空白、被限流或失败的时间线页面时的重试次数。

## `proxyCountry` (type: `string`):

高级。保持默认值，除非 SUMMARY 诊断明确指出此开关。 Apify 住宅代理的国家代码（两位字母）。

## `fallbackProxyCountries` (type: `array`):

高级。保持默认值，除非 SUMMARY 诊断明确指出此开关。 仅当 Facebook 在主要国家临时限流或拒绝某个个人主页时，才依次尝试的最多三个住宅代理备用国家。

## `mediaExpansionConcurrency` (type: `integer`):

高级。保持默认值，除非 SUMMARY 诊断明确指出此开关。 可同时展开公开照片集的帖子数。

## `mediaSetRetries` (type: `integer`):

高级。保持默认值，除非 SUMMARY 诊断明确指出此开关。 每个 Facebook media/set 或永久链接展开请求的重试次数。

## `debug` (type: `boolean`):

高级。保持默认值，除非 SUMMARY 诊断明确指出此开关。 在 SUMMARY 中附带发现过程与响应诊断信息。

## Actor input object example

```json
{
  "profileUrls": [
    "https://www.facebook.com/zuck"
  ],
  "maxProfilesPerRun": 10,
  "maxPostsPerProfile": 20,
  "expandAllPhotos": true,
  "omitPinnedPosts": true,
  "includeRawPayload": false,
  "includeUnavailablePosts": false,
  "bootstrapRetries": 4,
  "graphqlPageRetries": 4,
  "proxyCountry": "US",
  "fallbackProxyCountries": [
    "DE",
    "GB",
    "NL"
  ],
  "mediaExpansionConcurrency": 3,
  "mediaSetRetries": 1,
  "debug": false
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "profileUrls": [
        "https://www.facebook.com/zuck"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("spbotdel/facebook-profile-posts-cn").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "profileUrls": ["https://www.facebook.com/zuck"] }

# Run the Actor and wait for it to finish
run = client.actor("spbotdel/facebook-profile-posts-cn").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "profileUrls": [
    "https://www.facebook.com/zuck"
  ]
}' |
apify call spbotdel/facebook-profile-posts-cn --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,spbotdel/facebook-profile-posts-cn"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/fewlvv7xzrqfzZcjP/builds/seuxJMshxngGt3TiD/openapi.json
