# Facebook Posts Search (`deepmine/facebook-posts-search`) Actor

Search public Facebook posts by keyword: text, author, reactions by type, comment and share counts, video views, photos, links, hashtags and mentions, plus comments if wanted; top or recent, date filters. $1.49 per 1,000 posts on Starter, 2.5x cheaper than the most-used posts search. No login.

- **URL**: https://apify.com/deepmine/facebook-posts-search.md
- **Developed by:** [DeepMine](https://apify.com/deepmine) (community)
- **Categories:** Social media, Marketing, Lead generation
- **Features:** Limited permissions
- **Stats:** 6 total users, 3 monthly users, 86.1% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

**Facebook Posts Search** finds public Facebook posts by keyword: type `black friday` or your brand name and get one row per matching post with its author, text, reactions by type, comments and shares counts, video views, photos, links and the place it is tagged at, plus the keyword that found it. Download CSV, Excel or JSON or call it as an API. No login, no cookies, no browser.

| 🔎 Keyword | 🏷️ Author | 📝 Text | ❤️ Reactions | 💬 Comments | 🔁 Shares | 📅 Posted |
|---|---|---|---:|---:|---:|---|
| black friday | Coupon with Carli | 🚨🛒 WALMART BLACK FRIDAY SNEAK PEEK! 🛒🚨 Here’s a sneak peek… | 2,905 | 447 | 926 | 2026-11-11T22:11:09Z |
| black friday | Txfrugalfinds | Walmart Black Friday deals are here!! The first round of deals… | 130 | 70 | 13 | 2026-11-12T16:02:54Z |
| black friday | Christian's Furniture | 🚚💨 IN STOCK & Ready for IMMEDIATE DELIVERY! Hurry in for the… | 165 | 3 | 2 | 2026-11-04T00:00:19Z |

<sub>Collected 2026-11-14 with the prefilled input (one keyword, "black friday", Top order). Three business-page rows are shown, text cut short. The run delivered 78 posts in 18 seconds, and 78 posts were charged. One run, not a speed guarantee.</sub>

**$1.49 per 1,000 posts on the Starter plan** ($1.79 Free, $1.19 Scale, $0.79 Business). The prefilled run asks for up to 100 posts, so it costs at most $0.149 on Starter; the run above found 78 posts and cost $0.116. There is no start fee, date filters are free, and comments are an optional add-on at $0.24 per 1,000 comments.

### Who uses it

**Brands and PR teams** search their own name, products and campaign hashtags to see who is talking about them and which posts get traction, and run it on a schedule to catch a complaint or a viral post early.

**Local businesses and franchises** search a keyword in one city (`coffee` in London) to see what people post there and which local pages they tag.

**Marketing agencies and e-commerce teams** watch what competitors and deal pages post around a launch, a sale or a season ("black friday", "back to school") and which offers draw the most reactions and shares.

**Researchers and analysts** collect public posts on a topic, with dates and engagement counts, for trend and sentiment work.

**Lead generation:** the author of each post is in the row (`pageName`, `facebookUrl`). Paste those page links into [Facebook Pages Scraper](https://apify.com/deepmine/facebook-pages-scraper) for the business's email, phone, website and address.

### Start in three steps

1. **Type your keywords**, one per line. Each keyword is its own search.
2. **Choose the order** (Top or Most recent), how many posts you want per keyword, and a location or date window if you want one.
3. **Run, then export.** Open the dataset's Overview view and download CSV, Excel or JSON, or schedule the run to watch a keyword daily.

Copy/paste input for the API (Actor id `deepmine/facebook-posts-search`):

```json
{
  "searchQueries": ["black friday", "cyber monday"],
  "searchSortBy": "recent",
  "resultsLimit": 100,
  "onlyPostsNewerThan": "7 days"
}
```

### How many posts you get

Facebook's own search shows about 80 to 150 posts per keyword before it stops paging, and fewer for rare words. For more posts on one topic, add related keywords and spellings (`black friday`, `black friday deals`, `blackfriday`). A post found by two of your keywords is kept and charged once, with the keyword whose search reached it first.

### Input

- **Keywords** (`searchQueries`): the words to search for. `resultsLimit` applies to each keyword.
- **Search results order** (`searchSortBy`): `top` (Facebook's best matches, the default) or `recent` (newest first).
- **Location** (`searchLocation`): only posts tagged at a place. Give its Facebook location ID (`106078429431815` is London) or the place's Facebook link, which ends in that ID. Facebook applies this filter to the newest-first order only, so a location turns the order to Most recent.
- **Posts newer than / older than** (`onlyPostsNewerThan`, `onlyPostsOlderThan`): `2026-01-31`, an ISO time, or `7 days`, `3 months`. Checked on every post, and free.
- **Video transcripts** (`captionText`): each video's captions as plain text in `transcriptText`, where the video has captions. Free.
- **Comments** (optional, off by default): each post's comments and replies go to a separate Comments dataset at $0.24 per 1,000 comments. Its link is in the run summary.
- **Advanced:** rows shaped like apify/facebook-posts-scraper (`apifyCompatible`), the proxy, and the residential retry.

### Output

One row per post, the same keys as [Facebook Posts Scraper](https://apify.com/deepmine/facebook-posts-scraper) plus `searchQuery`, the keyword that found the post, and the place the post is tagged at: `taggedLocationName` (e.g. London, United Kingdom), `taggedLocationId` and `taggedLocationUrl`, or `null` when the post tags no place. Every row has every key (`null` when Facebook doesn't show a value). The main ones:

`searchQuery`, `taggedLocationName`, `pageName` (the author), `facebookUrl` (the author's link), `text`, `url`, `time`, `postType`, `likes` (all reactions), `reactionLikeCount` to `reactionAngryCount`, `comments`, `shares`, `viewsCount`, `isVideo`, `videoUrl`, `imageUrls`, `link`, `hashtags`, `mentions`, `sharedPostText`, `topComments`, `userId`, `pageAdLibraryId`, `postId`, `scrapedAt`.

Picture and video links are Facebook's signed links and expire after a few days, so download what you keep.

### Pricing

Pay per post, and per comment when you ask for comments. No start fee, no charge for date filters. A run never charges past your spending limit.

| Apify plan | Per 1,000 posts | Per 1,000 comments |
|---|---:|---:|
| Free | $1.79 | $0.24 |
| Starter | $1.49 | $0.24 |
| Scale | $1.19 | $0.24 |
| Business | $0.79 | $0.24 |

### More Facebook and Meta Actors

- [Facebook Posts Scraper](https://apify.com/deepmine/facebook-posts-scraper): every post of the pages you found here, newest first.
- [Facebook Pages Scraper](https://apify.com/deepmine/facebook-pages-scraper): the business behind a page: emails, phone numbers, websites and addresses.
- [Facebook Comments Scraper](https://apify.com/deepmine/facebook-comments-scraper): every comment and reply under a post you found here.
- [Facebook Video Downloader](https://apify.com/deepmine/facebook-video-downloader): MP4 and audio links for the video posts.
- [Meta Ad Library](https://apify.com/deepmine/meta-ad-library): the ads the same pages run, next to their organic posts.

### Did it help?

If the data was useful, a short review on this page helps other people find the Actor. Missing a field, or a keyword that doesn't come back the way you expect? Open an issue on the **Issues** tab and we'll look into it.

# Actor input Schema

## `searchQueries` (type: `array`):

Words to search Facebook posts for, e.g. <code>black friday</code> or <code>coffee shop</code>. One search per keyword; 'Max posts' applies per keyword. Each row says which keyword found it (searchQuery).

## `searchSortBy` (type: `string`):

Top results (Facebook's own order) or most recent first.

## `searchLocation` (type: `string`):

Only posts tagged at this place: a Facebook location ID like <code>106078429431815</code> (London), or the place's Facebook link, which ends in that ID. With a location, results come newest first (Facebook applies the filter to the recent order only).

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

The most posts to get for each keyword (empty: as many as Facebook gives).

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

Also get each video's captions as plain text (<code>transcriptText</code>), where the video has captions. Free: no extra charge. The captions file's link (<code>captionsUrl</code>) is in every video row either way.

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

Only posts published after this date: <code>2026-01-31</code>, an ISO time, or relative like <code>7 days</code>, <code>3 months</code>. With Most recent order the search stops once its posts are older.

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

Only posts published before this date (same formats).

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

Also get each post's comments, into a separate Comments dataset (the run's Output tab shows both). Each comment is charged as a 'comment' event, $0.24 per 1,000 comments, on top of the post. Off: no comments are read and none is charged.

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

Up to this many comments of each post (with 'Get each post's comments' on).

## `viewOption` (type: `string`):

Facebook's own comment orders.

## `includeNestedComments` (type: `boolean`):

Replies to comments (up to 3 levels), each as its own row with the comment it answers.

## `onlyCommentsNewerThan` (type: `string`):

Only comments written after this date (comments are then read newest first).

## `apifyCompatible` (type: `boolean`):

For code written against apify/facebook-posts-scraper's rows: <code>topComments</code> and <code>collaborators</code> hold objects (as <code>topCommentsDetails</code> and <code>collaboratorsDetails</code>), <code>collaborators</code> is <code>\[]</code> on a post without any, and a field the post has no value for is left out instead of <code>null</code>. Every other key stays as it is. Off: the rows as described on the Output tab.

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

Apify Proxy datacenter IPs by default.

## `residentialFallback` (type: `boolean`):

When Facebook refuses a datacenter IP, ask again on a residential one.

## Actor input object example

```json
{
  "searchQueries": [
    "black friday"
  ],
  "searchSortBy": "top",
  "resultsLimit": 100,
  "captionText": false,
  "includeComments": false,
  "maxCommentsPerPost": 20,
  "viewOption": "RANKED_UNFILTERED",
  "includeNestedComments": false,
  "apifyCompatible": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "residentialFallback": true
}
```

# 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 = {
    "searchQueries": [
        "black friday"
    ],
    "resultsLimit": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("deepmine/facebook-posts-search").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 = {
    "searchQueries": ["black friday"],
    "resultsLimit": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("deepmine/facebook-posts-search").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 '{
  "searchQueries": [
    "black friday"
  ],
  "resultsLimit": 100
}' |
apify call deepmine/facebook-posts-search --silent --output-dataset

```

## MCP server setup

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

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/NKMRaS5x0G2BylSga/builds/dK2mOayufMogHsw78/openapi.json
