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

Search Facebook posts by keyword with no login or Graph API token: post text, date, reactions by type, comments, shares, photos, video and shared links, plus the author. Many keywords per run, recent posts option, export to CSV or Excel.

- **URL**: https://apify.com/piotrv1001/facebook-posts-search-scraper.md
- **Developed by:** [FalconScrape](https://apify.com/piotrv1001) (community)
- **Categories:** Social media, Automation, Lead generation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 62.5% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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

**Search Facebook posts by keyword** with no login, no account and no Graph API token. The **Facebook Posts Search Scraper** works like a Facebook post search from your code: type a word or phrase and get the matching public posts, each with its text, date, reactions by type, comments, shares, photos, video links, shared links and author. Run many keywords at once and export the posts to JSON, CSV or Excel. Use it for Facebook social listening, brand monitoring, sentiment analysis, trend research and finding what people say about a topic.

### ✨ Features

- **Search public posts by keyword**: The same results as searching Facebook posts, from pages, public profiles and public groups.
- **Top or recent**: Facebook's top posts by default, or switch on recent posts to follow what is being said right now.
- **Engagement counts**: Reactions with the breakdown by type, comments and shares on every post.
- **Media and links**: Photo and video URLs, thumbnails and the shared link with its title.
- **Author on every row**: Name, ID and profile link of whoever posted it.
- **Many keywords per run**: Each with its own limit; a post found by two keywords is saved and charged once.

### 🛠️ How It Works

1. **Enter your search keywords**, one per line.
2. **Choose top or recent posts** and set the limit (50 per keyword by default).
3. **Run it**: download the posts as JSON, CSV or Excel, or get them through the API.

### ⚙️ Input

| Field | What it does |
| --- | --- |
| **Search keywords** | Words to search public Facebook posts for, one per line. |
| **Recent posts first** | Ask for recent posts instead of Facebook's top posts. Off by default. |
| **Max posts per keyword** | Stop after this many posts for each keyword. Default 50. |

```json
{
    "queries": ["electric cars", "climate change"],
    "recentPosts": true,
    "maxItems": 100
}
```

### 💰 Pricing

You pay per post saved, with no monthly rental.

| Event | Price | What you get |
| --- | --- | --- |
| **Post** | $0.003 per post ($3 per 1,000) | One post with all the fields below |
| **Actor start** | $0.00005 per run | Charged once when the run starts |

Examples: 100 posts cost $0.30 and 1,000 posts cost $3.

### 📊 Sample Output Data

```json
{
    "id": "1517670340393039",
    "url": "https://www.facebook.com/unep/posts/pfbid02K8MVdygXjsiuj93BqCZfD2QGt4WKMcrVPPWfHJ5mkcxD21wwVBaZwsAtqeqGfKMyl",
    "text": "The ocean is the planet's lungs and its largest carbon sink.\n\nIt is our greatest ally against climate change, and it plays a crucial role in reducing greenhouse gas emissions.…",
    "createdAt": "2026-10-01T05:00:31.000Z",
    "reactions": 290,
    "topReactions": [
        {
            "name": "Like",
            "count": 223
        },
        {
            "name": "Care",
            "count": 27
        },
        {
            "name": "Sad",
            "count": 24
        },
        {
            "name": "Love",
            "count": 15
        },
        {
            "name": "Haha",
            "count": 1
        }
    ],
    "comments": 18,
    "shares": 97,
    "mediaType": "Photo",
    "media": [
        {
            "type": "Photo",
            "id": "1517670270393046",
            "url": "https://www.facebook.com/photo.php?fbid=1517670270393046&set=a.288492823310803&type=3",
            "imageUrl": "https://scontent-ord5-2.xx.fbcdn.net/v/t39.30808-6/829272001_1517670273726379_6995172207761789960_n.jpg?…",
            "videoUrl": null,
            "durationMs": null
        }
    ],
    "link": null,
    "author": {
        "name": "UN Environment Programme",
        "id": "100064502631842",
        "url": "https://www.facebook.com/unep"
    },
    "isSponsored": false,
    "query": "climate change",
    "scrapedAt": "2026-11-01T07:54:06.430Z"
}
```

`query` is the keyword that found the post, so rows from several keywords are easy to group.

### 🎯 Use Cases for Facebook Post Search

- **Facebook social listening**: collect what people post about your brand, product or market.
- **Brand and competitor monitoring**: run the same keywords on a schedule with recent posts on and compare the rows.
- **Sentiment analysis**: feed post text and reaction breakdowns into your own model or spreadsheet.
- **Trend and content research**: see which posts on a topic get the most reactions, comments and shares.
- **Facebook hashtag search**: use a hashtag such as `#electriccars` as the keyword.

### ❓ FAQ

**How do I search Facebook posts without an account?** Enter your keywords and run the Actor. You don't need a Facebook account, cookies or a Graph API token: it reads what a logged-out visitor can reach.

**Is there a Facebook search API for posts?** Facebook's own Graph API has no public post search. This Actor gives you one: start a run through the Apify API with your keywords and read the rows as JSON.

**How many posts does one keyword return?** Facebook lists a limited number of posts per search: we measured 75 to over 200 per keyword. When a search runs out before your limit, the run's status message says how many Facebook listed. For more posts, add related keywords.

**Can I filter by date?** There is no date filter, because Facebook ignores it on this search. Switch on "Recent posts first" for the newest posts: in our test the first 23 posts were all from the last two days. Every row has its `createdAt` date, so you can also filter in your spreadsheet.

**Why do some posts have no media or link?** `media` and `link` are filled only when the post has them. A text post has neither.

**Can I export the posts to Excel or CSV?** Yes. Every run's dataset downloads as CSV, Excel, JSON or XML, or through the Apify API.

### 🔗 More Facebook Actors

- [Facebook Search Scraper](https://apify.com/piotrv1001/facebook-search-scraper): search pages, places and events with contact details.
- [Facebook Video Search Scraper](https://apify.com/piotrv1001/facebook-video-search-scraper): search videos and reels by keyword.
- [Facebook Posts Scraper](https://apify.com/piotrv1001/facebook-posts-scraper): all the posts of a page you already know.
- [Facebook Comments Scraper](https://apify.com/piotrv1001/facebook-comments-scraper): the comments of any public post.

# Actor input Schema

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

Words to search public Facebook posts for, one per line, e.g. `electric cars`. Facebook lists about 75-200+ posts per keyword; use several related keywords to go further.

## `recentPosts` (type: `boolean`):

Ask Facebook for recent posts instead of its top posts.

## `maxItems` (type: `integer`):

Stop after this many posts for each keyword.

## Actor input object example

```json
{
  "queries": [
    "electric cars",
    "climate change"
  ],
  "recentPosts": false,
  "maxItems": 50
}
```

# Actor output Schema

## `results` (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": [
        "electric cars"
    ],
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("piotrv1001/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": ["electric cars"],
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("piotrv1001/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": [
    "electric cars"
  ],
  "maxItems": 50
}' |
apify call piotrv1001/facebook-posts-search-scraper --silent --output-dataset

```

## MCP server setup

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