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

Search public Facebook posts by keyword, phrase, hashtag or search URL. Get text, authors, dates, engagement, media and available Page details. Use filters, add public comments, and track posts across repeat runs.

- **URL**: https://apify.com/maximedupre/facebook-posts-search-scraper.md
- **Developed by:** [Maxime Dupré](https://apify.com/maximedupre) (community)
- **Categories:** Social media, Marketing, Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.15 / 1,000 posts

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

### 🔎 Find public Facebook posts for research and monitoring

Social media teams, marketers, and researchers can use Facebook Posts Search Scraper to find public [Facebook](https://www.facebook.com/) posts by keyword, phrase, hashtag, or search URL. Get post text, dates, authors, engagement, media, and available Page details in structured rows for review and reports.

- Track brand mentions across repeat runs without saving the same posts again.
- Compare reactions and shares on posts about a product or topic.
- Find public group discussions for community research.
- Collect posts linked to a city or region for local market research.
- Read public comments on matching posts to study audience feedback.

#### 📦 Post text, engagement, media, and publisher details

Each dataset row is one unique public post. It can include photos, album images, videos, reels, shared links, original posts, groups, and tagged places. Available Page details include public contacts, creation and name-change dates, active-ad status, categories, map coordinates, opening status, and administrator counts by country.

Missing optional values are omitted. An unknown count is not changed to zero. A reported zero or false value is kept. Comments are optional and may cover only part of a thread. Missing optional media or comments do not exclude a post.

Posts are deduplicated by post ID within the run and against the monitor's saved history. A row keeps the search input from the saved match; later matches are not combined with it. Newly found posts can have older publication dates. Facebook search is not a full archive of every matching post.

#### ▶️ Run a keyword or search URL collection

1. Choose **Keywords** or **Search URL** in **Find posts by**.
2. Add one or more keywords, phrases, or hashtags, or paste a Facebook post-search URL.
3. Set a post limit and any filters you need.
4. Turn on **Include comments** if you need comment text. Each saved comment has a separate charge.
5. Start the run, then open the dataset to review or export the posts.

You do not need to supply a Facebook login or cookies. Use the same monitor name for repeat runs of one search. To collect that search again with fresh history, use a new monitor name.

#### ⚙️ Input

Only the selected search method's input is used. Filters apply to all searches in the run. A form prefill is a suggested value in the input form; it is not a default for an omitted API field.

**Input fields**

| Field | Type | What it does |
|---|---|---|
| `searchMethod` | string | Required. Use `keywords` or `searchUrl`. The form prefills `keywords`. |
| `keywords` | array of strings | Required for `keywords`. Add at least one nonempty keyword, phrase, or hashtag per entry. Keep phrases together. Exact duplicate entries are searched once. The form prefills `["gardening"]`. |
| `searchUrl` | string | Required for `searchUrl`. Full HTTPS Facebook `/search/posts/` URL with a nonempty `q` query. Accepts `facebook.com`, `www.facebook.com`, and `m.facebook.com`. No URL fragment. Any encoded filters must be valid. URL filters stay in use. |
| `maxPosts` | integer | Total saved-post limit across the run. Use zero or a positive whole number. Omit or use `0` for all available matches. The form prefills `10`; there is no schema upper limit. |
| `sortOrder` | string | `top` or `recent`. If omitted, keep the URL choice or use top results for keywords. Recent selection does not ensure time order. A recent-post URL with `top` stops the run; leave this field empty or use `recent`. |
| `contentType` | string | `all`, `video`, `photo`, `link`, or `text`. Video includes reels; photo includes albums. Omission uses `all`. Checks returned posts for either search method and keeps URL filters in use. |
| `publicationContext` | string | `all`, `groups`, `pagesAndProfiles`, or `businessPages`. Omission uses `all`. Checks where returned posts appear and Facebook's publisher details. Business Pages must have Facebook map data. URL filters stay in use. |
| `location` | string | Numeric Facebook place ID or city or region name. Uses Facebook place links, not a radius. An ambiguous name stops the run; no place match returns no posts. Omission keeps the URL place filter, if present. Results include the matched place. |
| `minReactions` | integer | Minimum reaction count, as a whole number of zero or more. Omission or `0` adds no minimum. Unknown counts fail a positive minimum. |
| `matchQuery` | boolean | Default `false`. When `true`, post text must contain the whole query, ignoring letter case. Uses the matching keyword entry or the query in the URL. |
| `textTerms` | array of strings | Each nonempty entry must occur in post text, author name, or a shared link title, ignoring letter case. Keep phrases together. Omit or use an empty list for no extra text filter. |
| `startDate` | string | Inclusive lower UTC date bound. Use `YYYY-MM-DD` or a positive whole number with `hour`, `day`, `week`, or `month`, singular or plural. Relative times count back from run start. A date starts at 00:00 UTC. Omission keeps the URL lower bound or adds none. |
| `endDate` | string | Inclusive upper UTC date bound. Uses the same formats as `startDate`. A calendar date includes the whole UTC day. Omission keeps the URL upper bound or adds none. Must not be before the lower bound. |
| `includeComments` | boolean | Default `false`. When on, adds the public comments Facebook shows, with available author, date, reaction, and reply counts. When off, no comments are collected, regardless of the limit. |
| `maxCommentsPerPost` | integer | Default `10`. Whole number of zero or more. When comments are on, collect up to this many per saved post, where available. `0` means all available comments. Does not change `maxPosts`. The run charge limit can reduce collection. |
| `monitorName` | string | Nonempty name for saved post history. Repeat runs with the same name skip posts saved before. If omitted, the Actor creates a name from the search and its filters. Use a different name for a different search. |

For example, relative dates can be `24 hours`, `7 days`, `2 weeks`, or `1 month`. When a URL already has a date or place filter, that filter stays in use. Supplied date bounds also check returned posts, and a supplied place must match the returned post. Conflicting filters can leave no matches.

**Example input**

This is the public input from the successful beta default-input run.

```json
{
  "maxPosts": 10,
  "searchMethod": "keywords",
  "keywords": [
    "gardening"
  ],
  "matchQuery": false,
  "includeComments": false,
  "maxCommentsPerPost": 10
}
```

#### 🧾 Output

**Output fields**

| Field | Type | What it does |
|---|---|---|
| `postId` | string | Facebook post ID. |
| `postUrl` | string | Facebook link to the post. |
| `searchInput` | string | Keyword, phrase, hashtag, or search URL that led to this saved match. Later matches are not added. |
| `text` | string | Post text, when available. |
| `publishedAt` | string | Publication date and time in UTC ISO 8601 format. |
| `author` | object | Account that published the post. |
| `author.id` | string | Facebook account ID. |
| `author.name` | string | Displayed name. |
| `author.url` | string | Profile or Page link. |
| `author.pictureUrl` | string | Profile picture link. |
| `author.type` | string | Account type stated by Facebook. |
| `author.pageDetails` | object | Available publisher Page details. |
| `author.pageDetails.createdAt` | string | Page creation date and time in UTC ISO 8601 format. |
| `author.pageDetails.nameHistory` | array of objects | Page name changes shown by Facebook. |
| `author.pageDetails.nameHistory[].name` | string | Page name for the change. |
| `author.pageDetails.nameHistory[].changedAt` | string | Name-change date and time in UTC ISO 8601 format. |
| `author.pageDetails.hasActiveAds` | boolean | Facebook's stated active-ad status. Omitted when unknown. |
| `author.pageDetails.administratorCountries` | array of objects | Administrator counts by country, not individual identities. |
| `author.pageDetails.administratorCountries[].country` | string | Country name. |
| `author.pageDetails.administratorCountries[].count` | integer | Number of administrators reported for the country. |
| `author.pageDetails.categories` | array of strings | Page categories. |
| `author.pageDetails.phoneNumbers` | array of strings | Public Page phone numbers. |
| `author.pageDetails.emails` | array of strings | Public Page email addresses. |
| `author.pageDetails.addresses` | array of strings | Public Page addresses. |
| `author.pageDetails.coordinates` | object | Facebook map coordinates. |
| `author.pageDetails.coordinates.latitude` | number | Latitude in decimal degrees. |
| `author.pageDetails.coordinates.longitude` | number | Longitude in decimal degrees. |
| `author.pageDetails.openingStatus` | string | Opening-status label, not a weekly schedule. |
| `reactionCount` | integer | Reported total reactions. Unknown values are omitted. |
| `commentCount` | integer | Reported total comments. Unknown values are omitted. |
| `shareCount` | integer | Reported total shares. Unknown values are omitted. |
| `reactions` | array of objects | Available counts by reaction type. |
| `reactions[].type` | string | Facebook reaction name. |
| `reactions[].count` | integer | Reported count for this reaction. |
| `photos` | array of objects | Available photos and album images. |
| `photos[].id` | string | Facebook photo ID. |
| `photos[].url` | string | Facebook photo page link. |
| `photos[].downloadUrl` | string | Direct photo file link. |
| `photos[].width` | integer | Image width in pixels. |
| `photos[].height` | integer | Image height in pixels. |
| `photos[].caption` | string | Facebook accessibility caption. |
| `videos` | array of objects | Available videos and reels. |
| `videos[].id` | string | Facebook video ID. |
| `videos[].url` | string | Facebook video or reel link. |
| `videos[].thumbnailUrl` | string | Thumbnail image link. |
| `videos[].durationSeconds` | number | Duration in seconds. |
| `videos[].viewCount` | integer | Reported video views. |
| `videos[].files` | array of objects | Available downloadable video versions. |
| `videos[].files[].quality` | string | `SD` or `HD`. |
| `videos[].files[].downloadUrl` | string | Direct video file link. |
| `videos[].originalWidth` | integer | Original video width in pixels, distinct from download dimensions. |
| `videos[].originalHeight` | integer | Original video height in pixels, distinct from download dimensions. |
| `links` | array of objects | External links shared in the post. |
| `links[].url` | string | Shared outbound URL. |
| `links[].title` | string | Link preview title. |
| `links[].description` | string | Link preview description. |
| `links[].imageUrl` | string | Preview image link. |
| `links[].sourceDomain` | string | Domain shown in the preview. |
| `originalPost` | object | Available original post details for a reshare. |
| `originalPost.postId` | string | Original post ID. |
| `originalPost.postUrl` | string | Original post link. |
| `originalPost.text` | string | Original post text. |
| `originalPost.author` | object | Original publisher account. |
| `originalPost.author.id` | string | Original publisher ID. |
| `originalPost.author.name` | string | Original publisher name. |
| `originalPost.author.url` | string | Original publisher profile or Page link. |
| `originalPost.author.pictureUrl` | string | Original publisher picture link. |
| `originalPost.author.type` | string | Original publisher type stated by Facebook. |
| `group` | object | Public group containing the post. |
| `group.id` | string | Group ID. |
| `group.name` | string | Group name. |
| `group.url` | string | Group link. |
| `places` | array of objects | Places tagged in or attached to the post. |
| `places[].id` | string | Place ID. |
| `places[].name` | string | Place name. |
| `places[].url` | string | Place link. |
| `searchPlace` | object | Resolved search place matched to the post. |
| `searchPlace.id` | string | Matched place ID. |
| `searchPlace.name` | string | Matched place name. |
| `searchPlace.url` | string | Matched place link. |
| `visibility` | string | Audience label shown by Facebook. |
| `contentType` | string | Post or attachment type stated by Facebook. This differs from the input filter choice. |
| `comments` | array of objects | Public comments collected when enabled. May be only part of the thread. |
| `comments[].id` | string | Comment ID. |
| `comments[].text` | string | Comment text. |
| `comments[].publishedAt` | string | Comment publication time in UTC ISO 8601 format. |
| `comments[].reactionCount` | integer | Reported reactions to the comment. |
| `comments[].replyCount` | integer | Reported replies to the comment. |
| `comments[].author` | object | Account that wrote the comment. |
| `comments[].author.id` | string | Comment author ID. |
| `comments[].author.name` | string | Comment author name. |
| `comments[].author.url` | string | Comment author profile or Page link. |
| `comments[].author.pictureUrl` | string | Comment author picture link. |
| `comments[].author.type` | string | Comment author type stated by Facebook. |

**Example row**

This complete row comes from a successful beta run for travel posts linked to France. Optional fields vary by post.

```json
{
  "postId": "122113350200439631",
  "postUrl": "https://www.facebook.com/permalink.php?story_fbid=pfbid02FeyUfNi2PG1jRSVJryRczj2ULX4BYKqRvjGatd327tQ7vr9XFk6VHc3HGuuLn8Esl&id=61563188955737",
  "publishedAt": "2026-11-03T03:40:44.000Z",
  "searchInput": "travel",
  "text": "☀️ Good Morning from Beautiful Paris! 🇫🇷❤️\n\nImagine waking up to this breathtaking view of the Eiffel Tower, where golden sunshine meets the magic of Paris. ✨\n\nA beautiful morning, a peaceful atmosphere, and a city full of dreams. Paris truly has a special place in every travel lover's heart! 🥰\n\nWould you love to spend a morning here? ❤️\n\nComment \"PARIS\" if France is on your travel bucket list! 🇫🇷\n\n#PulseOfFrance #GoodMorningParis #EiffelTower #ParisFrance #BeautifulParis #FranceTravel #TravelDreams",
  "author": {
    "id": "61563188955737",
    "name": "Pulse Of France ",
    "url": "https://www.facebook.com/people/Pulse-Of-France/61563188955737/",
    "pictureUrl": "https://scontent-phl2-1.xx.fbcdn.net/v/t39.30808-1/680242297_2102339630309658_1161761036692744837_n.jpg?stp=c283.0.809.809a_cp0_dst-jpg_tt6&cstp=mx809x809&ctp=s50x50&_nc_cat=104&ccb=1-7&_nc_sid=2d3e12&_nc_ohc=f4sZvCw_tywQ7kNvwFWcyCS&_nc_oc=AdpVkq4ekFOF7G5uEHU7sDQkxHY4yrPsu9ybUc612NEEvVlpJ28pwAYz-kHdeQS19OcIkj5ewDS_3NiPKCwwETmA&_nc_zt=24&_nc_ht=scontent-phl2-1.xx&_nc_gid=dj7g43V7JnQUyAf8RaD0-A&_nc_ss=70180&oh=00_AQSyJSXjsHnX3_8PfhanFFFRHYY3cvW9iOjGibgLeE1qpw&oe=6AF4D4C7",
    "type": "User",
    "pageDetails": {
      "categories": [
        "Gaming video creator"
      ],
      "addresses": [
        "25pue de pivoli,75004 paris, Paris, France, 75001"
      ],
      "coordinates": {
        "latitude": 48.85646,
        "longitude": 2.35521
      },
      "phoneNumbers": [
        "+33 6 12 34 56 78"
      ],
      "emails": [
        "pulseoffrance@gmail.com"
      ],
      "createdAt": "2026-04-27T08:54:23.000Z",
      "hasActiveAds": false,
      "administratorCountries": [
        {
          "country": "Sri Lanka",
          "count": 1
        }
      ]
    }
  },
  "reactionCount": 293,
  "commentCount": 15,
  "shareCount": 19,
  "reactions": [
    {
      "type": "Like",
      "count": 259
    },
    {
      "type": "Love",
      "count": 33
    },
    {
      "type": "Care",
      "count": 1
    }
  ],
  "visibility": "Public",
  "places": [
    {
      "id": "105604449474183",
      "name": "France",
      "url": "https://www.facebook.com/France-105604449474183/"
    }
  ],
  "photos": [
    {
      "id": "122113350170439631",
      "url": "https://www.facebook.com/photo/?fbid=122113350170439631&set=a.122098978886439631",
      "downloadUrl": "https://scontent-phl2-1.xx.fbcdn.net/v/t39.30808-6/865085312_122113350176439631_2065444966917574947_n.jpg?stp=dst-jpg_tt6&cstp=mx1079x1443&ctp=p526x296&_nc_cat=109&ccb=1-7&_nc_sid=833d8c&_nc_ohc=NMZMJoMzCvAQ7kNvwFcRAhH&_nc_oc=Adp6uSGpedgvqJ5vjmaq2aGyO4gg0DHuSXHYu3GwuTt2_ctvHvoIYeX9-9PWGhc20a84UTWhzntvdmL_U-jyQcZj&_nc_zt=23&_nc_ht=scontent-phl2-1.xx&_nc_gid=dj7g43V7JnQUyAf8RaD0-A&_nc_ss=70180&oh=00_AQT4DPHJruvTyQG9vxJ35aEqh58oFnDq1p1hCI9UPG4ThA&oe=6AF4F929",
      "width": 526,
      "height": 703
    }
  ],
  "contentType": "Photo",
  "searchPlace": {
    "id": "105604449474183",
    "name": "France",
    "url": "https://www.facebook.com/France-105604449474183/"
  }
}
```

#### 💳 Pricing

You pay for each unique public post saved and, when enabled, each public comment saved within a post. Page details and available media are part of the post charge.

| Apify tier | Per post | Per comment |
|---|---|---|
| Free | $0.00215 | $0.00110 |
| Bronze | $0.00215 | $0.00090 |
| Silver | $0.00215 | $0.00080 |
| Gold | $0.00215 | $0.00065 |
| Platinum | $0.00215 | $0.00065 |
| Diamond | $0.00150 | $0.00065 |

There is no start event in this Actor's pricing. A run with no saved posts or comments has no post or comment event charge. Posts skipped by filters or monitor history do not create these charges. Your run charge limit can stop collection before the requested count.

#### 🔌 Integrations

Download the Apify dataset as JSON, CSV, or Excel, or read it through the Apify API. Use Apify schedules for repeat searches with the same monitor history.

https://www.youtube.com/watch?v=bNACk1_S_6w\&list=PLObrtcm1Kw6MUrlLNDbK9QRg8VDJg0gOW\&index=4

#### ❓ FAQ

##### Why did a repeat search return no posts?

The monitor skips posts it saved before. The same search and filters use the same history when you leave the monitor name empty. Use a new name for fresh history. Filters and Facebook's available search results can also leave no matches.

##### Why do recent results include older posts?

Recent posts is Facebook's selection, not a promise of strict time order. A monitor returns posts it has not saved before, even if they have older dates. Use date bounds when you need a set time window.

##### Does a place filter mean posts near that place?

It checks the place Facebook links to the post. It does not search within a distance. Use a numeric Facebook place ID if a name matches more than one place.

##### Why is the comment list shorter than the comment count?

Facebook may show only part of the thread. Your per-post limit and run charge limit can also reduce the saved list. Use `0` to request all available comments, with comments enabled.

##### Does every post have Page details or media files?

No. The Actor includes these fields when available. A raw account type can remain `User` even when Facebook links that publisher to Page details. Missing optional data does not exclude the post.

##### Can I use a search URL with filters?

Yes. The Actor keeps URL filters and adds the selected checks. Content and publisher choices check returned posts. Date and place filters must also match. If a URL selects recent posts, do not choose Top results.

##### Is this a full archive of Facebook posts?

No. Results depend on Facebook's public search coverage and your filters. A post limit sets a maximum, not a promised number of posts.

### 📝 Changelog

**v0.0** (07-11-2026)

- Initial release.

### 🆘 Support

For issues, questions, or feature requests, [file a ticket](https://console.apify.com/actors/maximedupre~facebook-posts-search-scraper/issues) and I'll fix or implement it in less than 24h 🫡

### 🔗 Related Actors

- [Facebook User Posts Scraper](https://apify.com/maximedupre/facebook-user-posts-scraper): Collect posts from known public profiles, Pages, or post links.
- [Facebook Groups Search Scraper](https://apify.com/maximedupre/facebook-groups-search-scraper): Find public groups by topic before you review their discussions.
- [Facebook Group Profile Scraper](https://apify.com/maximedupre/facebook-group-profile-scraper): Read group profiles, rules, and membership counts from known groups.
- [Facebook Page Transparency Scraper](https://apify.com/maximedupre/facebook-page-transparency-scraper): Review known Pages and collect public ad creatives.
- [Facebook Reactions Scraper](https://apify.com/maximedupre/facebook-reactions-scraper): Read reaction counts and available public reactor details for selected posts.

**Made with ❤️ by Maxime Dupré**

# Actor input Schema

## `maxPosts` (type: `integer`):

Stop after this many saved posts across the whole run, or earlier if no more matches are available. Leave empty or use 0 for all available matches.

## `searchMethod` (type: `string`):

Search with a list of keywords, phrases or hashtags, or use a Facebook post-search URL.

## `keywords` (type: `array`):

For Keywords, add one search per entry, such as gardening, community garden or #gardening. Keep a whole phrase in one entry. Add at least one entry. All entries use the same filters.

## `searchUrl` (type: `string`):

For Search URL, paste a full Facebook post-search URL with a query, such as https://www.facebook.com/search/posts/?q=gardening. Filters in the URL are kept as supplied. Post content and Where posts appear add filters to the returned posts. URL filters can return no matches.

## `sortOrder` (type: `string`):

Choose top results or recent posts. Recent posts may not be in time order. If empty, keep the Search URL choice, or use Top results for Keywords. If the URL selects recent posts, leave this empty or choose Recent posts; Top results stops the run.

## `contentType` (type: `string`):

Keep only the chosen kind of post, based on its content and attachments. This filter checks posts returned by either search method. Leave empty or choose All content types to add no content filter. Filters in a Search URL stay in use.

## `publicationContext` (type: `string`):

Keep posts from public groups, Pages and profiles, or business Pages, based on where the post appears and Facebook's publisher information. This filter checks posts returned by either search method. Leave empty or choose All public posts to add no such filter. Filters in a Search URL stay in use.

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

Enter a numeric Facebook place ID or a city or region name, such as Paris, France. This uses Facebook's place links, not a distance from the place. A name that matches more than one place stops the run. Results include the matched Facebook place. If empty, keep any place filter in the Search URL.

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

Keep posts with at least this many reactions. Posts with an unknown reaction count do not pass a positive minimum. Leave empty or use 0 for no reaction filter.

## `matchQuery` (type: `boolean`):

Keep a post only when its text contains the whole search query, ignoring letter case. For Keywords, use the entry that found the post. For Search URL, use the query in the URL.

## `textTerms` (type: `array`):

Each entry must appear in the post text, author name or shared link title, ignoring letter case. Keep each whole phrase in one entry. Leave empty for no extra text filter.

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

Keep posts on or after this date in UTC. Enter YYYY-MM-DD or a time back from the run start, such as 24 hours, 7 days, 2 weeks or 1 month. A calendar date starts at 00:00 UTC. If empty, keep the URL's lower date bound for Search URL, or use no lower bound for Keywords.

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

Keep posts on or before this date in UTC. Enter YYYY-MM-DD or a time back from the run start, such as 1 hour, 3 days, 1 week or 1 month. A calendar date includes that whole UTC day. If empty, keep the URL's upper date bound for Search URL, or use no upper bound for Keywords. This bound must not be before Published from.

## `includeComments` (type: `boolean`):

Add public comments Facebook highlights to each saved post, with available authors, dates, reaction counts and reply counts. Each saved comment has a separate charge. When off, no comments are collected, whatever the comment limit.

## `maxCommentsPerPost` (type: `integer`):

When Include comments is on, collect up to this many comments per saved post, where available. Leave empty to use 10. Use 0 for all available comments. This limit does not change Maximum posts.

## `monitorName` (type: `string`):

Name the saved history for one search. Use the same name for repeat runs of that search. If empty, the Actor uses a name based on the search and its filters. Each monitor returns only posts it has not returned before. These posts can have older dates. Use a different name for a different search.

## Actor input object example

```json
{
  "maxPosts": 10,
  "searchMethod": "keywords",
  "keywords": [
    "gardening"
  ],
  "matchQuery": false,
  "includeComments": false,
  "maxCommentsPerPost": 10
}
```

# Actor output Schema

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

Open the saved post rows.

# 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 = {
    "maxPosts": 10,
    "searchMethod": "keywords",
    "keywords": [
        "gardening"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("maximedupre/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 = {
    "maxPosts": 10,
    "searchMethod": "keywords",
    "keywords": ["gardening"],
}

# Run the Actor and wait for it to finish
run = client.actor("maximedupre/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 '{
  "maxPosts": 10,
  "searchMethod": "keywords",
  "keywords": [
    "gardening"
  ]
}' |
apify call maximedupre/facebook-posts-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,maximedupre/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/SBOc3uCQBgtEoIltv/builds/zLa9Sm1V0X6GNPf0g/openapi.json
