# Facebook Posts Search Scraper - Bulk Keywords (`icoe-man/facebook-posts-search-scraper`) Actor

Search public Facebook posts by keyword or hashtag, with many queries per run, latest or top results, date filters and optional comments. No login or cookies.

- **URL**: https://apify.com/icoe-man/facebook-posts-search-scraper.md
- **Developed by:** [Moshe Zaudi](https://apify.com/icoe-man) (community)
- **Categories:** Social media, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.55 / 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

## Facebook Posts Search Scraper - Bulk Keywords

Search public Facebook posts for **many keywords in one run**: brand names, products, topics or hashtags. Get the latest or top posts for every query, optionally within a date range and with their comments. Use it for social listening, brand and crisis monitoring, market research and trend tracking.

- Up to 200 queries per run, each searched separately, with up to 500 posts per query. One run collects up to about 5,000 posts live (about 1,000 with comments), so split larger keyword lists into several runs
- Latest, top or hashtag search
- Date range for latest and top searches
- Optional comments and replies for every post found
- No Facebook login, no cookies and no proxies to manage

### Why this one

| | |
|---|---|
| Bulk keywords | Up to 200 queries per run, each searched separately |
| Three search types | Latest, top or hashtag search |
| Date range | Only posts newer or older than a date, for latest and top searches |
| Comments in the same run | Optional comments and replies for every post found |
| No start fee | You pay per post plus a small fee per query. Searches that cannot be completed are not charged |

### What you get

```json
{
  "platform": "facebook",
  "type": "post",
  "id": "1400000000000001",
  "url": "https://www.facebook.com/1400000000000001",
  "section": "search",
  "postType": "shared_link",
  "text": "Watching the launch tonight with the kids. Fingers crossed!",
  "language": "en",
  "createdAt": "2026-10-16T21:10:00.000Z",
  "author": { "id": "100000000000003", "username": "jane.doe", "name": "Jane Doe", "profileUrl": "https://www.facebook.com/jane.doe" },
  "reactionCount": 64,
  "reactions": { "like": 51, "love": 9, "care": 1, "haha": 0, "wow": 3, "sad": 0, "angry": 0 },
  "commentCount": 12,
  "shareCount": 2,
  "imageUrls": [],
  "videoUrl": null,
  "thumbnailUrl": null,
  "link": { "url": "https://news.example/launch-tonight", "description": "Everything you need to know before liftoff." },
  "hashtags": [],
  "mentionedProfileIds": [],
  "scrapedAt": "2026-10-17T16:09:00.000Z"
}
```

With **Include comments** on, each post's comments follow as `comment` rows, plus `reply` rows with **Include replies**, all linked by `postId`. The run summary in `OUTPUT` shows how many items each query returned.

### How to use it

1. Add your **Search queries**, one per line. Each line is a separate search.
2. Pick the **Search type** and **Max posts per query**. For latest and top searches you can also set **Only posts newer than** and **Only posts older than** (for example `7 days` or `2026-09-01`).
3. Optional: turn on **Include comments** and choose how many per post.
4. Run it. Searches we ran recently return instantly. New searches take 1-5 minutes each, and up to 3 queries are processed in parallel.

Calling it from an AI agent or with a short timeout? Start the run asynchronously and fetch the dataset when it finishes, or turn on **Previously collected data only** for an instant answer.

### Pricing

Pay only for what you get:

| | Free | Starter | Scale | Business |
|---|---|---|---|---|
| Per 1,000 posts | $3.00 | $2.85 | $2.70 | $2.55 |
| Per 1,000 comments | $1.25 | $1.05 | $0.90 | $0.75 |
| Per post with comments | $0.005 | $0.005 | $0.005 | $0.005 |
| Per search query | $0.025 | $0.025 | $0.025 | $0.025 |

The query fee is charged once for every search we complete. With **Include comments** on, every post also carries the per-post comment fee, even when it has no comments. Searches that cannot be completed are not charged.

**Example:** 50 queries with 20 posts each (1,000 posts) on the Starter plan cost 1,000 × $0.00285 + 50 × $0.025 = **$4.10**.

Use **Maximum cost per run** in the run options to cap your spend. The Actor stops cleanly at that limit.

**Free plan:** you get previously collected posts plus a small live allowance each day. Any paid Apify plan removes the limit.

### FAQ

#### Is scraping Facebook search results legal?

This Actor collects publicly visible posts only. Personal data is protected by laws such as GDPR, so only collect what you have a legitimate reason to process, and consult your lawyer if unsure.

#### How fresh is the data?

By default you get search results collected within the last 24 hours, or a fresh search. Set **Reuse data collected within** to 0 to always search live. When live collection is limited (for example on the free plan), earlier results are used if we have them, and `OUTPUT` notes it. With 0, such a query is reported as limited instead and not charged.

#### How many posts can one run collect?

Up to 200 queries with up to 500 posts each, but live collection is capped at about 5,000 posts per run and 10,000 per day on paid plans. With comments the cap is about 1,000 posts per run (at up to 40 comments per post, fewer above that), so split larger keyword lists into several runs. Queries past the cap get previously collected posts if we have them; otherwise they are reported as limited in `OUTPUT` and not charged. Above 40 comments per post, a query with many posts also collects fewer posts, and `OUTPUT` says how many.

#### Can I use it via API, Make, Zapier or n8n?

Yes. Use the Apify API or any Apify integration. Each run's results are in its default dataset, and `OUTPUT` in the key-value store has a per-query summary.

#### Can I use AND, OR or exact phrases?

Facebook search does not support operators such as AND or OR. Put each keyword or phrase on its own line, and each one runs as a separate search.

#### Why can't I set dates for hashtag searches?

Facebook's hashtag search has no date window. Use a latest or top search for the word instead, or filter on `createdAt` afterwards. Hashtag searches take a single word.

#### Can I use it from an AI agent or MCP server?

Yes. Connect the Apify MCP server at mcp.apify.com, or call the Apify API. Searches can take minutes, so start long runs asynchronously and fetch the dataset when the run finishes. For an instant answer, turn on **Previously collected data only**.

#### Why did I get no results?

Common reasons: Facebook has no public posts for the query, no posts fall inside your date range, a hashtag search was given more than one word, the free plan's daily live allowance is used up, or the run reached your **Maximum cost per run**. The run's `OUTPUT` record in the key-value store shows the status of every query, with a note when something went wrong, and lists any skipped input with the reason.

### Related Actors

- [Facebook Posts Scraper - Pages & Date Range](https://apify.com/icoe-man/facebook-posts-scraper)
- [Facebook Groups Scraper - Posts by Date](https://apify.com/icoe-man/facebook-groups-scraper)
- [Facebook Comments Scraper - Reaction Breakdown](https://apify.com/icoe-man/facebook-comments-scraper)
- [Facebook Reels Scraper - Video URLs & Engagement](https://apify.com/icoe-man/facebook-reels-scraper)
- [Social Media Comments Scraper - FB, IG, TikTok, Reddit](https://apify.com/icoe-man/social-media-comments-scraper)
- [Reddit Scraper - Posts & Comment Threads](https://apify.com/icoe-man/reddit-scraper)
- [Reddit Comments Scraper - Full Threads & Depth](https://apify.com/icoe-man/reddit-comments-scraper)
- [Instagram Comments Scraper - Profiles & Date Range](https://apify.com/icoe-man/instagram-comments-scraper)
- [TikTok Comments Scraper - Profiles & Date Range](https://apify.com/icoe-man/tiktok-comments-scraper)

**Something is wrong?** Open an issue in the Issues tab. We usually respond within 24 hours.

# Actor input Schema

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

Keywords or phrases to search, one per line, up to 200 per run. Each query is searched separately and has a small fee. Facebook search does not support operators such as AND or OR.

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

Latest returns the newest matching posts, Top the most relevant ones, and Hashtag the posts with that hashtag (one word, with or without #).

## `maxPostsPerQuery` (type: `integer`):

How many posts to collect for each query. Each post is billed, plus a small fee per query.

## `onlyNewerThan` (type: `string`):

Skip posts published before this date. Use a date like 2026-01-31 or a relative value like "7 days" (counted from midnight UTC). Not available for hashtag searches.

## `onlyOlderThan` (type: `string`):

Skip posts published after this date, e.g. 2026-06-30 or "1 month" (counted from midnight UTC). Not available for hashtag searches.

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

Also collect the comments of every post found. Each comment is billed, plus a small fee per post whose comments we collect.

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

How many comments (and replies, if enabled) to collect per post when Include comments is on. Up to 24 is fastest. Above 40, a query with many posts collects fewer posts, and the run summary says how many.

## `includeReplies` (type: `boolean`):

Also collect replies to comments when Include comments is on. Replies count toward the comment limit.

## `maxDataAgeHours` (type: `integer`):

If we ran this search within this many hours, you get the posts instantly at the same price. Use 0 to always collect fresh data.

## `cacheOnly` (type: `boolean`):

Return only posts we already collected, without waiting for live collection. Useful for AI agents with short timeouts.

## Actor input object example

```json
{
  "queries": [
    "NASA Artemis"
  ],
  "searchType": "latest",
  "maxPostsPerQuery": 10,
  "includeComments": false,
  "maxCommentsPerPost": 24,
  "includeReplies": false,
  "maxDataAgeHours": 24,
  "cacheOnly": false
}
```

# Actor output Schema

## `posts` (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 = {
    "queries": [
        "NASA Artemis"
    ],
    "maxPostsPerQuery": 10,
    "maxDataAgeHours": 24
};

// Run the Actor and wait for it to finish
const run = await client.actor("icoe-man/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 = {
    "queries": ["NASA Artemis"],
    "maxPostsPerQuery": 10,
    "maxDataAgeHours": 24,
}

# Run the Actor and wait for it to finish
run = client.actor("icoe-man/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 '{
  "queries": [
    "NASA Artemis"
  ],
  "maxPostsPerQuery": 10,
  "maxDataAgeHours": 24
}' |
apify call icoe-man/facebook-posts-search-scraper --silent --output-dataset

```

## MCP server setup

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