# Facebook Posts Search Scraper (`crawl_craft/facebook-posts-search-scraper`) Actor

Searching Facebook by hand for brand mentions takes hours. Search public posts by keyword or hashtag in bulk: text, author, reactions breakdown, comments, shares, media and top comments, with date and engagement filters. Track new posts. No login.

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

## Pricing

from $1.00 / 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.
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

### What is Facebook Posts Search Scraper?

Facebook Posts Search Scraper is an Apify Actor that finds public Facebook posts by keyword, hashtag or search link, then saves the text, author, reactions, comments, shares and media of each one. It needs no login, accepts several searches in one run, and writes every post to your dataset the moment it is found.

- **Three ways to search:** paste Facebook search links, type keywords or add hashtags, and mix them freely in one run.
- **Precise filters:** narrow results by date, language, post type, author type, reactions, comments and shares.
- **Rich post details:** get the reaction breakdown, attachments, hashtags, mentions, shared links and top comments.
- **Monitoring friendly:** turn on `onlyNewPosts` to skip posts that earlier runs already returned for the same search.
- **Spreadsheet ready:** choose flat rows or also save a CSV file with `writeCsv`.

This Actor is made to be a Facebook post search scraper: it takes keywords, hashtags and search links and returns public posts. It also accepts a bare tag, so it covers a Facebook hashtag scraper job when a hashtag is all you have.

Click **Try for free**, paste a Facebook search link, and press **Start**.

### What data can you extract from Facebook?

This Actor returns one row per post with the fields below, and you can download the dataset as JSON, CSV, Excel, XML or HTML. The columns hold the text, counts, author and media that a Facebook post extractor is expected to return. Together they form a Facebook posts dataset that you can filter, chart or load into a database.

| Field | Description | Example |
|---|---|---|
| `url` | Public link to the post. | `https://www.facebook.com/page/posts/123` |
| `timestamp` | Publication time in Unix milliseconds. | `1789149362000` |
| `postText` | Caption or text of the post. | `Cheers to the weekend` |
| `reactionsCount` | Total reactions on the post. | `12` |
| `reactions` | Reactions by kind (like, love, support, haha, wow, sorry, anger); only kinds that are present. | `{"love": 2, "like": 10}` |
| `commentsCount` | Total comments on the post. | `3` |
| `sharesCount` | Total shares of the post; null when not shown. | `1` |
| `postId` | Identifier of the post. | `10166095960273092` |
| `taggedLocationId` | Identifier of the tagged place, when there is one. | `null` |
| `isReshare` | True when the post reshares another post. | `false` |
| `sharedPost` | The original post when this is a reshare (postId, url, postText, author, timestamp, attachments); null otherwise. | `null` |
| `author` | Who published the post: id, name, profilePicture, profileUrl and type (user or page). | `{"name": "Example Page", "id": "716318091", "type": "page"}` |
| `attachments` | Photos and videos in the post: type, url, id, accessibilityCaption, imageUrl, videoUrl and durationSec when available. | `[]` |
| `date` | Publication time as an ISO 8601 UTC string. | `2026-09-11T17:56:02.000Z` |
| `postType` | text, photo, album, video, reel, link or share. | `video` |
| `viewsCount` | Video or reel views; null for other posts. | `234` |
| `taggedLocation` | Tagged place with id and name; null when there is none. | `null` |
| `group` | The group the post was published in (id, name, url); null for non-group posts. | `null` |
| `collaborators` | Co-authors of the post. | `[]` |
| `hashtags` | Hashtags in the post text, lower-case, without #. | `["champagne"]` |
| `mentions` | People, pages and groups tagged in the post text. | `[]` |
| `links` | Web links found in the post text. | `[]` |
| `externalLink` | Shared web link card (url, title, description, source); null when there is none. | `null` |
| `language` | Two-letter language code detected from the text; null when unsure. | `en` |
| `engagement` | Reactions + comments + shares. | `21` |
| `topComments` | Comments shown with the post (id, text, date, author, reactionsCount, repliesCount). Also saved in the Top comments table. | `[]` |
| `search` | Details of the search that found the post. | An object, see the Output tab |
| `scrapedAt` | When the post was collected (ISO 8601 UTC). | `2026-10-10T19:51:00.000Z` |
| `isNew` | True when no earlier run returned this post for the same search. | `true` |
| `videoTitle` | Title of the video or reel, when it has one. | `null` |

The Output tab also offers ready-made views of the posts table: Overview, Engagement, Authors, Media and links, and Search info. Comments shown with each post are saved in a second table called Top comments, with these fields: `postId`, `postUrl`, `postAuthor`, `commentId`, `text`, `date`, `timestamp`, `commentUrl`, `authorId`, `authorName`, `authorProfileUrl`, `authorPicture`, `reactionsCount` and `repliesCount`. A third table, Search summary, has one row per search with `query`, `kept`, `finishedAt`, `error` and `failed`.

The `postText` field holds the full text of each post, which is what a Facebook post text extractor needs. Captions live in the same field, so a Facebook post caption extractor task needs nothing more.

### Use cases for Facebook data

#### Monitoring and research

- **Brand and competitor tracking:** search a brand or product name, then compare `reactionsCount`, `commentsCount` and `sharesCount` across the posts you find.
- **Hashtag research:** review hashtag Facebook posts with the result order set to latest to see how a tag is used right now.
- **Reporting:** analysts can export Facebook posts to Excel and sort them by `engagement`.

#### Audience and engagement

- **Audience feedback:** the comments shown with each post land in a separate table, which gives you a Facebook post comment extractor for top comments.
- **Engagement analysis:** `reactionsCount` and the `reactions` breakdown by kind turn the dataset into a Facebook post like extractor.
- **Media collection:** image links appear in `attachments` when they are available, so a Facebook post image extractor job is covered.

#### Search and data teams

- **Mention research:** put the words a post contains into the keyword inputs and use the Actor as a Facebook post finder.
- **No-code collection:** the form in the Apify Console is a Facebook posts extractor you can use without writing code.
- **Data pipelines:** growth teams that prefer a ready-made Facebook posts scraper over custom code can feed the dataset into their own tools.

### How to scrape Facebook posts

1. Create a free Apify account.
2. Open Facebook Posts Search Scraper in the Apify Store and click **Try for free**.
3. Add Facebook search links, hashtag links, post links or plain keywords to **Facebook links (bulk)**, one per line. Use **Search keywords** and **Extra hashtags** for more searches.
4. Pick the result order for the Facebook search posts you collect, with top for the most relevant first and latest for the newest, and add filters such as dates, languages, post types or minimum reactions.
5. Click **Start** and watch the posts arrive in the dataset.
6. Download the results as JSON, CSV, Excel, XML or HTML, or open the key-value store for `posts.csv` when you turned on **Also save a CSV file**.

#### How to search Facebook posts by date

Set **Posted after** (`startDate`) and **Posted before** (`endDate`) to a date in YYYY-MM-DD form or to a relative value such as 7 days. To search old Facebook posts by date, set an earlier window; the end date counts the whole day, and results depend on what is still public.

#### How to search Facebook posts by keyword

Put one keyword per line in **Search keywords** (`queries`). Wrap a phrase in quotes, use `-word` to exclude a term, or write `a OR b` for alternatives, and set **Keyword match mode** (`matchMode`) to all terms, any term, the exact phrase, or off.

#### How to collect posts from a hashtag

Add the tag without the # sign to **Extra hashtags** (`hashtags`). Each hashtag is a separate search, so a Facebook hashtag posts scraper run covers each tag you list. Anyone used to a Facebook hashtag search scraper can paste the tags there, one per line.

### How much does it cost to scrape Facebook?

This Facebook public posts scraper uses tiered pay-per-event pricing: $1.5 per 1,000 results on the Free plan and a lower price on paid plans. Each run also pays a tiny Actor start event of $0.00005 per run start. For example, on the Free plan 1,000 saved posts cost $1.5 plus $0.00005 for the start.

| Apify plan | Price per 1,000 results |
|---|---|
| Free | $1.5 |
| Bronze | $1.35 |
| Silver | $1.2 |
| Gold / Platinum / Diamond | $1 |

Only post rows are billed through the `main_result` event, which the Console shows as Results. The Top comments and Search summary tables are saved alongside your posts and are not billed as results. Free plan users get up to 10 posts per run in total, while paid plans have no run limit. If you set a maximum cost per run, the run stops cleanly when that limit is reached. See the Pricing tab for current rates.

### Input

Only **Facebook links (bulk)** (`urls`) is required, and it accepts Facebook search links, hashtag links, direct post links or plain keywords. Because search links are accepted, you can reuse a search from your browser, which suits anyone looking for a Facebook search scraper for those links. Pasting a direct post link also works, which helps those who want a Facebook post scraper for individual posts.

![Facebook Posts Search Scraper input form with search links and filters](IMAGE_URL_PLACEHOLDER "facebook-posts-search-scraper-input-form.png")

Input fields, grouped as in the Console form:

- **What to search:** `urls`, `queries`, `hashtags`, `searchType` (top or latest), `location`.
- **Result limits:** `maxResultsPerQuery` (0 means no cap) and `maxResultsTotal` (0 means no cap).
- **Filters:** `matchMode`, `startDate`, `endDate`, `languages`, `postTypes` (text, photo, album, video, reel, link, share), `authorTypes` (user, page), `minReactions`, `minComments`, `minShares` and `excludeReshares`.
- **Search depth:** the Search depth field and `maxScanned`, the most posts reviewed per search.
- **Output:** `includeTopComments`, `outputFormat` (full or flat), `writeCsv` and `onlyNewPosts`.
- **Speed settings:** parallel runs and minimum and maximum delay, where the defaults suit most runs.

Filters narrow the saved posts, so stricter settings give fewer but more relevant rows. Each Facebook posts search filter is optional. If you want a Facebook keyword search tool, type keywords, quoted phrases, exclusions and OR groups into `queries`.

Example input (values taken from the input form's pre-filled link and default options, not a captured run):

```json
{
  "urls": [
    "https://www.facebook.com/search/posts?q=dom%20perignon"
  ],
  "searchType": "top",
  "matchMode": "all",
  "includeTopComments": true,
  "outputFormat": "full"
}
```

💡 Keep **Max posts in total** low for a first test run. See the Input tab for every option.

### Output

The scraped results are shown as a dataset in the **Storage** tab. The table view is for convenience and doesn't show **all the fields**.

![Facebook posts dataset table with post text, author and reactions](IMAGE_URL_PLACEHOLDER "facebook-posts-dataset-output-table.png")

You can export the dataset as JSON, CSV, Excel, XML or HTML. With `writeCsv` turned on, the run also saves `posts.csv` in the key-value store, and a `SUMMARY` record holds the totals for the run.

Example output for one post (values taken from the Actor's schema examples, not a captured run):

```json
{
  "url": "https://www.facebook.com/page/posts/123",
  "timestamp": 1789149362000,
  "postText": "Cheers to the weekend",
  "reactionsCount": 12,
  "reactions": {
    "love": 2,
    "like": 10
  },
  "commentsCount": 3,
  "sharesCount": 1,
  "postId": "10166095960273092",
  "taggedLocationId": null,
  "isReshare": false,
  "sharedPost": null,
  "author": {
    "name": "Example Page",
    "id": "716318091",
    "type": "page"
  },
  "attachments": [],
  "date": "2026-09-11T17:56:02.000Z",
  "postType": "video",
  "viewsCount": 234,
  "taggedLocation": null,
  "group": null,
  "collaborators": [],
  "hashtags": [
    "champagne"
  ],
  "mentions": [],
  "links": [],
  "externalLink": null,
  "language": "en",
  "engagement": 21,
  "topComments": [],
  "scrapedAt": "2026-10-10T19:51:00.000Z",
  "isNew": true,
  "videoTitle": null
}
```

Read `date` for an ISO 8601 time or `timestamp` for Unix milliseconds, which suits a Facebook post date extractor task. A Facebook post id extractor job can rely on `postId` and `url`.

### Limitations and error handling

- The Actor returns posts that are publicly visible on Facebook.
- Results are limited to public posts that match your searches and filters, so run a small test to see what your terms return.
- Free plan users get up to 10 posts per run in total; paid plans have no run limit.
- `sharesCount` is null when the share count is not shown, `viewsCount` is filled only for videos and reels, and `language` is null when the language cannot be detected.
- Top comments are the comments shown with each post, not the full comment thread.
- With a date filter set, posts without a publication date are skipped, and a Facebook posts search by date range keeps only posts inside the window.
- With very strict filters a search stops after it has reviewed `maxScanned` posts, which is 400 by default.
- If a link is not a Facebook search, hashtag or post link, it is skipped with a warning in the run log.
- The run fails at the start with an "Input problem" message when no link or keyword is given, when a date cannot be read, or when the start date is not before the end date.
- If a whole search cannot be completed, its Search summary row shows `failed` as true and a short `error` text, and the other searches continue.

There is no separate table of error codes, because the Actor reports problems in the run log, the status message and the Search summary table.

### Integrating Facebook Posts Search Scraper with other apps

You can start runs and read results through the Apify API, schedule runs and trigger webhooks when a run finishes. The Apify API gives you a Facebook posts API for your own app: start a run with the JSON input shown above and read the dataset items as JSON. Developers who want a Facebook posts search API can use the same input, and the API tab shows ready-made JavaScript, Python and CLI snippets.

- [Apify integrations](https://docs.apify.com/platform/integrations) connect the dataset to other tools.
- [Schedules](https://docs.apify.com/platform/schedules) rerun your searches automatically, and with `onlyNewPosts` on, each run skips posts that earlier runs already returned.
- [Webhooks](https://docs.apify.com/platform/integrations/webhooks) tell your own service when a run is done.
- The [Apify API reference](https://docs.apify.com/api/v2) lists every endpoint.

Scheduled runs turn the Actor into a Facebook posts crawler that revisits your searches and surfaces new posts. Keep the same searches and rerun them for ongoing monitoring; a Facebook post details finder job then needs only the dataset.

### More Apify Actors by crawl_craft

These Actors come from the same account and cover other public data, with no relation to Facebook post search. They are listed in case you work with more than one source.

| Actor | What it extracts | When to use it |
|---|---|---|
| [Telegram Scraper](https://apify.com/crawl_craft/telegram-scraper) | Messages, views, reactions, media, links, polls, comments and subscriber counts from public Telegram channels | Use it when your source is Telegram rather than Facebook. |
| [TikTok Video Scraper](https://apify.com/crawl_craft/tiktok-video-scraper) | Captions, hashtags, views, likes, comments, shares, author and music data for TikTok videos | Use it when you have TikTok video URLs. |
| [Apple App Store Review Scraper](https://apify.com/crawl_craft/apple-app-store-review-scraper) | App Store reviews with stars, text, app version, helpful votes and developer replies | Use it when you need app reviews by country. |

### Is it legal to scrape Facebook?

Facebook Posts Search Scraper only collects posts that are publicly visible on Facebook, and it does not collect private profile data such as email addresses. Results can still contain personal data, such as names and comments, so only collect it with a legitimate reason.

This Facebook public post scraper does not decide for you what is allowed. Consider data protection rules such as the GDPR (Regulation (EU) 2016/679) and Facebook's terms, and consult a lawyer if you are unsure. Apify explains the topic in [is web scraping legal](https://blog.apify.com/is-web-scraping-legal/) and [ethical web scraping](https://blog.apify.com/what-is-ethical-web-scraping-and-how-do-you-do-it/).

### ❓ FAQ

#### Can I scrape Facebook posts free?

Yes, within limits. Free plan users get up to 10 posts per run in total, and paid plans have no run limit. Results cost $1.5 per 1,000 on the Free plan and less on paid plans, plus $0.00005 per run start; the pricing section lists every tier.

#### Do I need a Facebook account or API key?

No. The Actor finds public posts without a login, and the input has no field for a Facebook account or key.

#### How many posts can I get?

It depends on your input and plan. **Max posts per search** and **Max posts in total** set the caps, where 0 means no cap, and free plan users are held to 10 posts per run.

#### Can I find Facebook posts by date range?

Yes. Use `startDate` and `endDate` with a YYYY-MM-DD date or a relative value such as 7 days, and only posts inside that window are kept.

#### How to monitor Facebook posts for new mentions?

Turn on `onlyNewPosts`, keep the same searches, and schedule the run. Posts that an earlier run already returned for the same search are skipped, and each saved row carries an `isNew` flag.

#### Can I get posts from private profiles or groups?

No. This Facebook post searcher returns public content only, and group posts appear only when they are public, with the group named in the `group` field.

#### Is there a Facebook public posts API?

You can call this Actor through the Apify API and receive public post data as JSON. No Facebook API key is needed, so a Facebook keyword search API call is simply an Apify API call with your `queries`, and you can use the Apify client for Python or JavaScript.

#### Do I need proxies?

No. The input has no proxy setting, and connection handling is managed for you.

#### Can I export the results to Excel?

Yes. Open the dataset and download it as Excel, CSV, JSON, XML or HTML, or turn on `writeCsv` to also get `posts.csv`. After each run you can export Facebook posts to Excel and sort the rows by `engagement`.

### Your feedback

Found a bug or want a new field? Open an issue in the Issues tab of this Actor. For custom solutions, such as extra fields or a tailored workflow, write to hello.crawlcraft@gmail.com.

# Actor input Schema

## `urls` (type: `array`):

One link per line. Accepted: a Facebook search link (https://www.facebook.com/search/posts?q=coffee), a hashtag link (https://www.facebook.com/hashtag/coffee) or a direct post link. Plain keywords also work. Add or remove lines freely.

## `queries` (type: `array`):

Keywords to search, one per line. Use "exact phrase", -exclude and a OR b. Each keyword is a separate search.

## `hashtags` (type: `array`):

Hashtags to collect posts from, without the # sign. Each hashtag is a separate search.

## `searchType` (type: `string`):

Top shows the most relevant public posts first. Latest shows the newest posts first.

## `location` (type: `string`):

Optional place name, for example Aspen. Only posts that mention it in their text or tagged location are kept.

## `maxResultsPerQuery` (type: `integer`):

Posts kept for each link, keyword or hashtag after filtering. 0 means no cap. Free plan users get up to 10 posts per run in total; paid plans have no run limit.

## `maxResultsTotal` (type: `integer`):

Stop the whole run after this many posts across all searches. 0 means no cap. Free plan users are limited to 10 posts per run.

## `matchMode` (type: `string`):

How strictly a post must match your keywords. All terms, any term, the exact phrase, or off to keep everything found.

## `startDate` (type: `string`):

Only posts on or after this date. Use YYYY-MM-DD or a relative value such as 7 days or 2 months.

## `endDate` (type: `string`):

Only posts on or before this date (the whole day counts). Use YYYY-MM-DD or a relative value such as 1 day.

## `languages` (type: `array`):

Keep only posts written in these languages. The language is detected from the post text. Empty means any language.

## `postTypes` (type: `array`):

Keep only these kinds of post. Empty means all kinds.

## `authorTypes` (type: `array`):

Keep only posts written by people, by pages, or both. Empty means all authors. Group posts are listed under the group field of each row.

## `minReactions` (type: `integer`):

Skip posts with fewer reactions than this.

## `minComments` (type: `integer`):

Skip posts with fewer comments than this.

## `minShares` (type: `integer`):

Skip posts with fewer shares than this.

## `excludeReshares` (type: `boolean`):

Leave out posts that only reshare another post.

## `enginePagesPerQuery` (type: `integer`):

How deeply each search looks. Higher values can find more posts and take longer.

## `maxScanned` (type: `integer`):

Most posts reviewed per search before it ends, useful when your filters are very strict.

## `includeTopComments` (type: `boolean`):

Add the comments shown with each post. They also appear in their own table.

## `outputFormat` (type: `string`):

Full keeps nested details. Flat gives one simple value per column for spreadsheets.

## `writeCsv` (type: `boolean`):

Save posts.csv in the run's key-value store when the run finishes.

## `onlyNewPosts` (type: `boolean`):

Skip posts that earlier runs already returned for the same search. Useful for scheduled monitoring.

## `maxConcurrency` (type: `integer`):

How many posts are processed at the same time.

## `minDelay` (type: `number`):

Shortest wait between steps.

## `maxDelay` (type: `number`):

Longest wait between steps.

## Actor input object example

```json
{
  "urls": [
    "https://www.facebook.com/search/posts?q=dom%20perignon"
  ],
  "queries": [],
  "hashtags": [],
  "searchType": "top",
  "location": "",
  "maxResultsPerQuery": 10,
  "maxResultsTotal": 0,
  "matchMode": "all",
  "languages": [],
  "postTypes": [],
  "authorTypes": [],
  "minReactions": 0,
  "minComments": 0,
  "minShares": 0,
  "excludeReshares": false,
  "enginePagesPerQuery": 3,
  "maxScanned": 400,
  "includeTopComments": true,
  "outputFormat": "full",
  "writeCsv": false,
  "onlyNewPosts": false,
  "maxConcurrency": 10,
  "minDelay": 1,
  "maxDelay": 2.5
}
```

# Actor output Schema

## `posts` (type: `string`):

One row per post with text, author, reactions, comments, shares and attachments.

## `topComments` (type: `string`):

Comments shown with each saved post.

## `searchSummary` (type: `string`):

One row per search: posts kept, posts examined and why it stopped.

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

Totals for the whole run.

## `csv` (type: `string`):

Posts as CSV, when 'Also save a CSV file' is on.

# 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 = {
    "urls": [
        "https://www.facebook.com/search/posts?q=dom%20perignon"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawl_craft/facebook-posts-search-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 = { "urls": ["https://www.facebook.com/search/posts?q=dom%20perignon"] }

# Run the Actor and wait for it to finish
run = client.actor("crawl_craft/facebook-posts-search-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 '{
  "urls": [
    "https://www.facebook.com/search/posts?q=dom%20perignon"
  ]
}' |
apify call crawl_craft/facebook-posts-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,crawl_craft/facebook-posts-search-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/mGjjRqfYxBN6fAKXO/builds/eimQp5dYKJEv9MwXY/openapi.json
