# Facebook Posts Scraper (`socialdataapi/facebook-posts-scraper`) Actor

Facebook Posts Scraper — Extract Facebook post data including text, captions, reactions, comments, shares, timestamps, media URLs, page or profile details, and post links. Useful for content research, competitor analysis, audience insights, and social media monitoring.

- **URL**: https://apify.com/socialdataapi/facebook-posts-scraper.md
- **Developed by:** [Social Data API](https://apify.com/socialdataapi) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Posts Scraper — Text, Reactions, Comments, Shares and Media

Facebook Posts Scraper collects posts from public Facebook Pages and profiles and returns each one with its text, publish time, reaction, comment and share counts, photos and videos, links in the text, and author details. Every response is structured JSON — ready to pass directly to an LLM, index into a vector store, or feed a social listening pipeline. **No Facebook account or cookies needed.** Start with one Page you follow closely, then add every competitor and publisher you want to track.

![Facebook Posts Scraper output: post text, reactions, comments and shares as JSON](https://api.apify.com/v2/key-value-stores/WYkyEfqs10huyXYxr/records/g-fb-posts-hero.webp)

***

### What data can I extract with Facebook Posts Scraper?

Using this Facebook Posts API, you will be able to extract the following Facebook post data:

| 📝 Post text | 📅 Publish time (ISO and Unix) | ❤️ Reactions (all types) | 💬 Comment count |
|---|---|---|---|
| 🔁 Share count | 😀 Number of reaction types | 🖼️ Photos, videos and link previews (with image size and alt text) | 🔖 Links, mentions and hashtags in the text |
| 👤 Author name, ID, profile link and picture | 🆔 Post ID | 🌐 Post link | 📌 Permalink |
| 📛 Page name | 🔗 Page URL | 📚 Ad Library Page ID (if available) | 🧾 Feedback ID |
| 🪪 Author ID | 📥 Input URL | | |

***

### How to use Facebook Posts Scraper

Built for marketers, analysts and researchers who want to scrape Facebook posts with their engagement numbers in one run.

**Copy to your AI assistant:**

```text
Facebook Posts Scraper (Apify Actor ID: socialdataapi/facebook-posts-scraper, https://apify.com/socialdataapi/facebook-posts-scraper) is an Apify Actor that returns posts from public Facebook Pages and profiles as structured JSON: post text, publish time, total reactions, number of reaction types, comment count, share count, photos and videos, links in the text, author name and ID, and the Page's Ad Library ID. Use it whenever someone needs Facebook Page posts without cookies, a login, or a browser - competitor content tracking, engagement benchmarking, or building a news and brand monitoring feed. Inputs: startUrls (string[], Page or profile URLs or bare usernames, required), resultsLimit (int, maximum posts in total across all targets, default 50), captionText (bool, include the post text, default true), onlyPostsNewerThan (string, YYYY-MM-DD or relative like "30 days", optional), onlyPostsOlderThan (string, YYYY-MM-DD or relative, optional), proxyConfiguration (object, kept for compatibility; every request uses Apify Residential proxy, only a chosen proxy country is applied). Each row is one post, billed as one result; Pages that do not exist produce no rows.
```

#### Facebook Posts Scraper MCP Server: use these Actors from ChatGPT, Claude or Cursor

Connect your AI assistant to the Apify MCP server with this Actor already loaded as a tool, ready to call. No glue code, no scraping logic in your prompts.

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=socialdataapi/facebook-posts-scraper"
```

#### Step by step

1. [Create a free Apify account](https://console.apify.com/sign-up).
2. Open [this Actor in the Apify Store](https://apify.com/socialdataapi/facebook-posts-scraper).
3. Enter the Facebook Page URL or username (for example `https://www.facebook.com/nytimes` or `nytimes`).
4. Click **Start** (or send your API request).
5. Download or stream your results in JSON, CSV or Excel.

#### How to scale Facebook Posts Scraper to bulk

Put as many Pages or profiles as you like into the URL list. The actor removes duplicates, reads up to 3 Pages at the same time, and stops as soon as the total post limit is reached, so set that limit to the number of posts you want across the whole list. For regular tracking, save the input as a task and schedule it daily or weekly with a relative date range such as "7 days", so every run brings only fresh posts. This makes it a simple bulk Facebook posts scraper for whole competitor or publisher lists.

***

### ✨ Features

This actor fetches clean, structured posts from Facebook ⚡. It's ideal for competitor content tracking, engagement benchmarking, newsroom monitoring and social listening datasets, and it works as a Facebook page posts scraper and a Facebook post engagement scraper for any public Page.

It extracts, per post:

- **Post text** – the full text, with links, mentions and hashtags listed separately
- **Publish time** – UTC time as an ISO string and as a Unix timestamp
- **Reactions** – the total of all reaction types, plus how many different types were used
- **Comments and shares** – the counts Facebook shows under the post
- **Media** – photos, videos and link previews with image URL, size and alt text
- **Author** – name, ID, profile link and profile picture
- **Post links** – the post link and a permanent link built from the author and post IDs

⚡ Reads public data with plain HTTP requests, no browser, over Apify Residential proxy, and retries a failed request up to 3 times on a new IP.

***

### Use cases 💡

- **Social media manager** — benchmark competitors' reactions, comments and shares per post.
- **Journalist** — extract Facebook Page posts from news outlets within a set date range.
- **Brand analyst** — run Facebook page post monitoring for mentions and hashtags in post text.
- **Researcher** — export Facebook posts to CSV for content and engagement studies.
- **AI engineer** — turn Facebook posts to JSON context for a RAG agent.

Building an AI agent? [Connect Facebook Posts Scraper over MCP](#mcp-integration-for-ai-agents) and let it call the actor on its own.

***

### Why choose this actor?

- **Several Pages in one run.** A recorded run read 3 targets (one of them a Page that does not exist) and returned 8 posts in 7 seconds, stopping the moment the 8-post total was reached.
- **The numbers behind each post.** A recorded New York Times post came back with 2,696 reactions of 7 different types, 854 comments and 890 shares, plus its photo and link.
- **19 fields and 6 inputs.** Text, timing, engagement, media and author fields, with an absolute or relative date range and a switch to leave the text out.

***

### ⬇️ Input

![Facebook Posts Scraper input: Pages or profiles, post limit, date filter and proxy](https://api.apify.com/v2/key-value-stores/WYkyEfqs10huyXYxr/records/g-fb-posts-input.webp)

The actor accepts a list of public Facebook Page or profile URLs or bare usernames. Only the URL list is required.

| Parameter | Required | Type | Description | Example value |
|---|---|---|---|---|
| `startUrls` | Yes | array | Public Facebook Pages or profiles, one per line: a full URL, a `profile.php?id=` link or a bare username. Duplicates are removed. Groups are not supported. | `["https://www.facebook.com/natgeo", "nytimes"]` |
| `resultsLimit` | No | integer | Maximum posts in total across all targets (1–100,000, default 50). Up to 3 targets are read at once; the one that finishes first fills the total first. | `6` |
| `captionText` | No | boolean | Include the post text (default `true`). When off, the text comes back empty. | `true` |
| `onlyPostsNewerThan` | No | string | Keep posts published at or after this time (UTC): `YYYY-MM-DD`, `YYYY-MM-DD HH:MM`, or relative like `30 days`. Empty = no lower bound. | `"2026-09-01"` |
| `onlyPostsOlderThan` | No | string | Keep posts published at or before this time (UTC), same formats. A date alone means 00:00 UTC that day. Empty = no upper bound. | `"2026-10-04"` |
| `proxyConfiguration` | No | object | Kept for compatibility. Every request uses Apify Residential proxy whatever is selected; only a proxy country chosen here is applied. | `{"useApifyProxy": true}` |

Accepted target formats:

- `https://www.facebook.com/nytimes`
- `https://www.facebook.com/profile.php?id=<number>`
- `nytimes`

#### Free plan limits

Users on the Apify free plan can fetch up to 20 posts per run (all targets together) and 200 posts per month. When the limit is reached, the run finishes successfully with a status message explaining the limit. Upgrade to any paid Apify plan to remove these limits.

#### Example input

```json
{
  "startUrls": ["https://www.facebook.com/natgeo", "nytimes"],
  "resultsLimit": 6,
  "captionText": true,
  "onlyPostsNewerThan": "2026-09-01",
  "onlyPostsOlderThan": "2026-10-04",
  "proxyConfiguration": { "useApifyProxy": true }
}
```

***

### ⬆️ Output

![Facebook Posts Scraper output: one row per post with 19 fields](https://api.apify.com/v2/key-value-stores/WYkyEfqs10huyXYxr/records/g-fb-posts-output.webp)

Every post is one typed, normalized JSON item with the same 19 fields on every run. Export it as JSON (default), CSV or Excel.

#### Example output

```json
{
  "facebookUrl": "https://www.facebook.com/nytimes",
  "postId": "1504824961499962",
  "pageName": "nytimes",
  "url": "https://www.facebook.com/nytimes/posts/pfbid02ub6uVyTENqDPkCgE2jnSyUiSSt5enSsnwBpeLofTiaMHR44yzoLSDicaM2EMg9aGl",
  "time": "2026-10-03T23:20:06.000Z",
  "timestamp": 1791069606,
  "user": {
    "id": "100059174186752",
    "name": "The New York Times",
    "profileUrl": "https://www.facebook.com/100059174186752",
    "profilePic": "https://scontent.fdac8-1.fna.fbcdn.net/v/t39.30808-1/350535703_659199556062511_6399672460381730787_n.jpg?stp=cp0_dst-jpg_tt6&cstp=mx720x720&ctp=s80x80&_nc_cat=1&ccb=1-7&_nc_sid=2d3e12&_nc_ohc=tI7X0OdiDAwQ7kNvwEazMW7&_nc_oc=AdpHDIn8ST86b_ijQHjLtO4lbDLBjp95be13fXbZWNlRZRxyuZsW4upBY4vamvpL9ic&_nc_zt=24&_nc_ht=scontent.fdac8-1.fna&_nc_gid=oqp1KR4Ai-QFP7whkBfxlw&_nc_ss=7b289&oh=00_AQNq7HwZazWULVE95R1P6xuei04wAVUiEc7eDwGIyyfkGg&oe=6AC9472D"
  },
  "text": "Spurred by influencers and America’s protein obsession, cottage cheese sales have increased nearly 40% over the past few years. We tasted almost 30 varieties to find five that are creamy, tangy, and utterly craveable. https://nyti.ms/3VFUiJ5",
  "textReferences": [
    {
      "__typename": "ExternalUrl",
      "id": "NjQyMTgzOTU5MjA4MTA3Omh0dHBzXGEvL255dGkubXMvM1ZGVWlKNTo6RGVmYXVsdDo6OjE1MDQ4MjQ5NjE0OTk5NjI6",
      "url": "https://l.facebook.com/l.php?u=https%3A%2F%2Fnyti.ms%2F3VFUiJ5&h=AUCeh_fl1R-iffnXfxI3pFHzsfpzQeZHSuRELh3MYmRiwkRDRWWfomEmVqBZ5i1kY_0c9cgNtxVGPKsK8vMU8BwWH1XF2g8x0y6wULl5T73pC3kTV8wkiH_vBdjqcGFm2Qn0VJKk917yPXyNThhBQZCgkGzE4gT83eJGHQ&s=1",
      "external_url": "https://nyti.ms/3VFUiJ5",
      "mobileUrl": "https://lm.facebook.com/l.php?u=https%3A%2F%2Fnyti.ms%2F3VFUiJ5&h=AUCaelwjNl0bk8ado4zMXMJ5fpKmHs-zTL75k6rcaTc2uPmv1hhEIUahsGkmK33cldmPOsyo28oIuquHk2ByBifvVv1hCO71U3t-yNio2IRb6kNqjM5qx8TgBUkBAJi39b7nkDv8F5y9VkcUUqtlE8zpVnI7yZuoVWhPKQ&s=1"
    }
  ],
  "likes": 105,
  "comments": 46,
  "shares": 13,
  "topReactionsCount": 4,
  "media": [
    {
      "thumbnail": "https://scontent.fdac8-1.fna.fbcdn.net/v/t39.99422-6/833059793_1385882200298226_6655540449117746881_n.png?stp=dst-jpg_tt6&cstp=mx1080x1350&ctp=s1080x1350&_nc_cat=110&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=127cfc&_nc_ohc=PF9s0feWR-UQ7kNvwHUgMSe&_nc_oc=Adpq6_TicH0MioGev-e4dxQ52wz3lAueEeA5WRjxXRHuHxk7j785RHZYVA9P9fKpLG8&_nc_zt=14&_nc_ht=scontent.fdac8-1.fna&_nc_gid=oqp1KR4Ai-QFP7whkBfxlw&_nc_ss=7b289&oh=00_AQOAfB0TA32SlvAFqUx0wDG4dqaVN26-XhIjl4dzJWZ0Yw&oe=6AC94BCB",
      "__typename": "Photo",
      "is_playable": false,
      "image": {
        "uri": "https://scontent.fdac8-1.fna.fbcdn.net/v/t39.99422-6/833059793_1385882200298226_6655540449117746881_n.png?stp=dst-jpg_tt6&cstp=mx1080x1350&ctp=s1080x1350&_nc_cat=110&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=127cfc&_nc_ohc=PF9s0feWR-UQ7kNvwHUgMSe&_nc_oc=Adpq6_TicH0MioGev-e4dxQ52wz3lAueEeA5WRjxXRHuHxk7j785RHZYVA9P9fKpLG8&_nc_zt=14&_nc_ht=scontent.fdac8-1.fna&_nc_gid=oqp1KR4Ai-QFP7whkBfxlw&_nc_ss=7b289&oh=00_AQOAfB0TA32SlvAFqUx0wDG4dqaVN26-XhIjl4dzJWZ0Yw&oe=6AC94BCB",
        "height": 1350,
        "width": 1080
      },
      "id": "1504824948166630",
      "__isMedia": "Photo",
      "photo_cix_screen": null,
      "copyright_banner_info": null,
      "owner": { "__typename": "User", "id": "100059174186752" },
      "ocrText": "May be an image of fruit and text"
    }
  ],
  "feedbackId": "ZmVlZGJhY2s6MTUwNDgyNDk2MTQ5OTk2Mg==",
  "topLevelUrl": "https://www.facebook.com/100059174186752/posts/1504824961499962",
  "facebookId": "100059174186752",
  "pageAdLibrary": { "is_business_page_active": false, "id": "5281959998" },
  "inputUrl": "https://www.facebook.com/nytimes"
}
```

The reaction count is the total of every reaction type, and the reaction-type number says how many different types were used (4 here). The Page URL and the input URL both hold the target you entered, written as a full URL. The Ad Library ID is the Page ID Facebook uses in its Ad Library when Facebook shows one; otherwise it is the author ID.

***

### How does it work?

The actor reads the same public Pages any visitor can open without logging in, so you never need a Facebook account. It sends plain HTTP requests, no browser, and reads up to 3 Pages at the same time. Every request goes through Apify Residential proxy from the start. A request that fails or is blocked is retried up to 3 times, each time on a new residential IP after a short pause; if it still fails, that part of the Page is skipped, and Pages that do not exist are skipped without producing rows. Only publicly visible data is returned: what anyone sees on the Page. Every post comes back in the same normalized format with the same field names, so your code keeps working when Facebook changes its pages.

***

### How do you integrate Facebook Posts Scraper into your stack?

It works with what you already use: the REST API from any language, MCP for AI agents, and no-code tools.

#### MCP integration for AI agents

Add the Apify MCP server to your agent with one command, signing in with your Apify account when asked:

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=socialdataapi/facebook-posts-scraper"
```

This registers Facebook Posts Scraper as a tool your agent can call directly: the agent runs it with your Page list and reads the posts back as JSON. It works in Claude Code, Cursor and Windsurf.

#### No-code tools (n8n, Make, LangChain)

- **n8n:** add the Apify node and pick "Run an Actor", or use the HTTP Request node pointed at the Actor's run-sync endpoint with your Apify token. The posts come back as items you can send to Sheets, Slack or a database.
- **Make:** use the Apify app's "Run an Actor" module, then "Get Dataset Items" to pull the posts into the next step of your scenario.
- **LangChain:** install `langchain-apify` and wrap this Actor with `ApifyActorsTool`, so your chain can fetch fresh Page posts on demand.

***

### Is it legal to scrape Facebook data?

Scraping publicly available Facebook data is generally lawful when you collect only what any visitor can see and use it responsibly. Facebook Posts Scraper returns only publicly available data — what any user sees without logging in. Under GDPR, scraping public data is generally permissible, but storing and using it must comply with local data-protection law, especially when posts or author details relate to identifiable people. Consult legal counsel if your use case involves bulk storage of personal data.

***

### Frequently asked questions

#### What fields does Facebook Posts Scraper return?

It returns the post text, publish time, total reactions, comment count and share count, plus media, author details and links. See [the data fields section](#what-data-can-i-extract-with-facebook-posts-scraper) for all 19 fields.

#### Does Facebook Posts Scraper require a Facebook account or login?

No. Only public post data is extracted, and no credentials or cookies are needed.

#### How fast does Facebook Posts Scraper run?

A recorded run returned 8 posts from 3 targets in 7 seconds. Data is read live from Facebook on every run, not from a cache.

#### What happens if a post is private or doesn't exist?

A Page that does not exist or is not available produces no rows and is not charged; the run log marks it as skipped. A Page that stays blocked after all retries is skipped the same way, so in code simply check which of your inputs appear in the input URL field of the results.

#### Can I scrape multiple Facebook posts at once?

Yes. Add many Pages or profiles to the URL list; the actor reads up to 3 at a time and stops when the total post limit is reached.

#### Does Facebook Posts Scraper work with Claude, ChatGPT, and other AI agent tools?

Yes — Facebook Posts Scraper is available as an MCP tool. Run `claude mcp add --transport http apify "https://mcp.apify.com?tools=socialdataapi/facebook-posts-scraper"` to register the Apify MCP server with this Actor as a tool in Claude Code, Cursor or Windsurf. Any agent that can call an HTTP endpoint can use the REST API directly.

#### Does Facebook Posts Scraper return data in a format LLMs can use directly?

Yes. Every post is typed, normalized JSON with consistent field names. No HTML parsing, no selectors. Pass it straight to an LLM, index it into a vector store, or feed it to an agent tool — no transformation step.

#### What happens when Facebook changes its layout or updates its anti-bot system?

The actor is maintained. When Facebook changes, the actor is updated — your calls keep returning the same JSON schema with no changes on your end.

#### Can I use Facebook Posts Scraper without managing proxies or browser infrastructure?

Yes. The residential proxy and retries run on the actor's side, and it needs no browser. You send one request and get structured JSON back. No proxy accounts, no headless browser setup, no maintenance.

#### Which Facebook post fields work best for AI training data and RAG indexing?

For RAG, use the post text, the links and hashtags in it, the author name and the media alt text. For training data, use the reaction total, number of reaction types, comment count, share count and publish timestamp. All fields are typed values — strings, integers, booleans — no normalization needed.

***

### Your feedback

Found a bug or missing a field? Let us know through the Issues tab of this Actor. Every report is read, and fixes ship in new versions.

# Changelog

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

# Actor input Schema

## `startUrls` (type: `array`):

One or more public Facebook Pages or profiles, one per line. Accepts a full URL (https://www.facebook.com/nytimes, or a profile.php?id=... link) or a bare username (nytimes). Duplicates are removed. Groups are not supported.

## `resultsLimit` (type: `integer`):

Stop once this many posts have been saved in total, across all targets combined. Up to 3 targets are read at the same time and each one adds its newest posts when it finishes, so the target that finishes first fills the total first. Free plan: up to 20 posts per run (all targets together) and 200 per month; paid plans have no limit.

## `captionText` (type: `boolean`):

On by default. When on, each post's text is returned (for a share without its own text, the shared post's text). When off, the text is returned empty, which is useful when you only need engagement counts and media.

## `onlyPostsNewerThan` (type: `string`):

Only include posts published at or after this point in time (UTC). Absolute: YYYY-MM-DD (means 00:00 UTC that day), optionally with a time (YYYY-MM-DD HH:MM). Relative: e.g. '30 days', '2 weeks', '1 year' before the run starts. Leave empty for no lower bound.

## `onlyPostsOlderThan` (type: `string`):

Only include posts published at or before this point in time (UTC). A date alone means 00:00 UTC that day, so '2026-10-04' keeps posts up to the end of 3 October. Same formats as 'Posts newer than'. Leave empty for no upper bound.

## `proxyConfiguration` (type: `object`):

This actor always uses Apify Residential proxies for every request, whatever is selected here, including when the proxy is turned off or your own proxy URLs are entered. A request that fails is retried up to 3 times, each time on a new residential IP. Only a proxy country chosen here is used. The field is kept for compatibility with saved inputs.

## Actor input object example

```json
{
  "startUrls": [
    "nytimes",
    "https://www.facebook.com/Cristiano/"
  ],
  "resultsLimit": 50,
  "captionText": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

All scraped posts, one row per post, in the Actor's default dataset.

# 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 = {
    "startUrls": [
        "https://www.facebook.com/nytimes"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("socialdataapi/facebook-posts-scraper").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 = {
    "startUrls": ["https://www.facebook.com/nytimes"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("socialdataapi/facebook-posts-scraper").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 '{
  "startUrls": [
    "https://www.facebook.com/nytimes"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call socialdataapi/facebook-posts-scraper --silent --output-dataset

```

## MCP server setup

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

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/0B9s9qk9wFfAMUVII/builds/g68MJUOqikZ0yhZrl/openapi.json
