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

✨ Search for Facebook posts using keywords or hashtags. Retrieve post URLs, content, publication dates, author details, and engagement metrics. Ideal for monitoring brand mentions on Facebook over time.

- **URL**: https://apify.com/scraper\_one/facebook-posts-search.md
- **Developed by:** [Scraper One](https://apify.com/scraper_one) (community)
- **Categories:** Social media, News, Lead generation
- **Stats:** 3,681 total users, 1,092 monthly users, 100.0% runs succeeded, 61 bookmarks
- **User rating**: 4.09 out of 5 stars

## Pricing

from $2.00 / 1,000 result items

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Facebook Posts Search

- This **Apify Actor** searches for posts on **Facebook** based on keywords or hashtags. The results include post url,
  post content, publication date,
  author information, and engagement metrics.

- It is a perfect tool for **monitoring** Facebook for **brand mentions** over time
  **Stay ahead** of potential reputation risks, respond to significant events, and engage with **highly active** public
  discussions 🚀

***

### Features

- 🔍 Search by **keywords, hashtags**
- 📅 Filter by **location**
- 📊 Extract **likes, comments, reactions, shares etc.**
- 🖼️ Retrieve **images and links** from posts

### Input Parameters

| Parameter      | Type     | Required | Description                                                                                                  |
|----------------|----------|----------|--------------------------------------------------------------------------------------------------------------|
| `query`        | `string` | ✅        | Keyword to search posts for.                                                                                 |
| `resultsCount` | `number` | ❌        | Maximum number of posts to extract (e.g. `30`).  If not set, only a few of the first posts will be returned. |
| `location`     | `string` | ❌        | Search posts with pinned location. E.g. `London`, `Mexico`, `Disneyland`                                     |
| `searchType`   | `string` | ❌        | Search type: most popular - top (default) or latest. Defaults to platform’s default if not specified.        |
| `startDate`    | `string` | ❌        | Get posts starting from given date (YYYY-MM-DD).                                                             |
| `endDate`      | `string` | ❌        | Get posts ending on date (YYYY-MM-DD).                                                                       |

### Example Input

```json
{
    "query": "Orange",
    "resultsCount": 50,
    "searchType": "latest"
}
```

or

```json
{
    "query": "bronco",
    "resultsCount": 5,
    "startDate": "2025-01-01",
    "endDate": "2025-01-31"
}
```

### Output Data

The actor returns an array of JSON objects with extracted post data.

#### Example Output

```json
[
    {
        "url": "https://www.facebook.com/jeff.moerke.1/posts/pfbid02gAfuzjGqHuAk9APdU6mDwveqeNg7cXf3YrEyFohYjwu8F2zgxgzSayXZ4bXHEZHHl",
        "timestamp": 1743735597000,
        "postText": "🍾Dom Daily🍾\nLV Collection on Point🕺🏻💃\n40 Bottles in 40 days\n 2009 Dom Pèrignon at @themonarchsteakhouse.aspen 🤑 needed something to wash down the caviar. \n\nSquad has pieces on pieces \n#jeffmoerke #hospatality #dompérignon #louisevuitton #aspen @louisvuitton @domperignonofficial @domperignoncollectors",
        "reactionsCount": 251,
        "reactions": {
            "like": 218,
            "love": 30,
            "support": 3,
            "haha": 4,
            "wow": 5,
            "sorry": 6,
            "anger": 1
        },
        "commentsCount": 1,
        "sharesCount": 3,
        "postId": "1891857264894411",
        "author": {
            "id": "100022104669475",
            "name": "Jeff Moerke",
            "profilePicture": "https://scontent.fpoz3-1.fna.fbcdn.net/v/t39.30808-1/328653743_672376154638502_2292484167379744319_n.jpg?stp=cp0_dst-jpg_s40x40_tt6&_nc_cat=105&ccb=1-7&_nc_sid=e99d92&_nc_ohc=wzuppsF7tW4Q7kNvwG8Jokm&_nc_oc=AdmCjeJrDYFOkExMlTro1Go_4aIZPGVCdSU0isBvxAsSEUTMOOyND1H0-a5J1ilYdCg&_nc_zt=24&_nc_ht=scontent.fpoz3-1.fna&_nc_gid=3HnVNoc9LAaE2-rhHqoH3Q&oh=00_AYEWhweOAbsVEla31p_H1Lrg5kMPajznKLyvr7UEUAZjwA&oe=67F57505",
            "profileUrl": "https://www.facebook.com/jeff.moerke.1"
        },
        "attachments": [
            {
                "type": "video",
                "url": "https://www.facebook.com/jeff.moerke.1/videos/521227401036554/",
                "id": "521227401036554"
            },
            {
                "type": "photo",
                "url": "https://www.facebook.com/photo.php?fbid=1891857228227748&set=a.197904564289698&type=3",
                "id": "1891857228227748",
                "accessibilityCaption": "May be an image of text that says \"AplPay LOUIS VUITTONNEW YORK NY Mar 30, 2025 $3,628.76 AplPay LOUIS VUITTONNEW YORK NY Feb 24, 2025 $541.24 LOUIS VUITTON USA, INEW YORK NY Feb 2, 2025 $1,825.31 LOUIS VUITTON USA, INEW YORK NY Feb 2, 2025 $12,398.11 LOUIS VUITTON USA, INEW YORK NY Feb 1, 2025 $964.54 LOUIS VUITTON USA, INEW YORK NY Coh1 2025 $5,711.36\""
            }
        ]
    }
]
```

###### Let us know if you need any other output fields. 🤙

### Usage

1. **Create an Apify account** and navigate to the actor.
2. **Configure input parameters** in the Apify UI or via API.
3. **Run the actor** and monitor execution logs.
4. **Download extracted posts** as JSON, CSV, or Excel.

### Limitations & Notes

- Scraping Facebook data **must comply with their Terms of Service**.
- Avoid excessive scraping to prevent IP bans.
- Rate-limited – Free users can make only a few requests per day. **Contact us if you need higher or custom limits!**

### Works Best With

To maximize the effectiveness of this scraper, use it in combination
with [Facebook Comments Scraper](https://apify.com/scraper_one/facebook-comments-scraper).

By first extracting Facebook posts with this scraper, you can then pass the collected post URLs into the Facebook
Comments Scraper, allowing you to retrieve
comments associated with those posts.

#### Best Use Case Scenario

- 🔎 Run Facebook Posts Search actor → Collect a list of posts based on keywords.
- 📥 Feed post URLs into Facebook Comments Scraper → Extract comments from the collected posts for deeper analysis.
- 📊 Get full post insights → Combine post metadata and comments for a complete dataset.

This workflow is ideal for social media monitoring, sentiment analysis, and engagement tracking. 🚀

### Other Recommended Scrapers

If you're working with multiple platforms or want additional data sources, check out these scrapers:

- 🐦 [X (Twitter) Posts Search](https://apify.com/scraper_one/x-posts-search) — Find posts/tweets based on keywords,
  hashtags, and more
- 🐦 [X (Twitter) Post Replies Scraper](https://apify.com/scraper_one/x-post-replies-scraper) — Scrap replies of multiple
  X (Twitter) posts
- 🐦 [X (Twitter) Profile Posts Scraper](https://apify.com/scraper_one/x-profile-posts-scraper) — Scrap posts of specific
  X (Twitter) profile
- 📘 [Facebook Posts Search](https://apify.com/scraper_one/facebook-posts-search) — Discover Facebook posts for a given
  topic or page
- 📘 [Facebook Comments Scraper](https://apify.com/scraper_one/facebook-comments-scraper) — Extract comments from public
  Facebook posts
- 📘 [Facebook Reactions Scraper](https://apify.com/scraper_one/facebook-reactions-scraper) — Scrap reactions from
  Facebook posts (like, sad, haha, angry etc.)
- 📘 [Facebook Posts Scraper](https://apify.com/scraper_one/facebook-posts-scraper) — Scrap posts from Facebook pages,
  groups etc.
- 🎬 [YouTube Search Scraper](https://apify.com/scraper_one/youtube-search-scraper) — Extract videos from search queries
- 🎬 [YouTube Comments Scraper](https://apify.com/scraper_one/youtube-comments-scraper) — Extract comments from posted
  videos
- 🎬 [YouTube Downloader](https://apify.com/scraper_one/yt-downloader) — Download youtube videos

### Support & Contact

✉️ If you encounter issues or need help, feel free to **open an issue** or contact us at **scraper1one@gmail.com**

# Actor input Schema

## `query` (type: `string`):

The search term to look for.

## `resultsCount` (type: `integer`):

Number of search results to retrieve (between 1 and 200). If not set, only a few of the first posts will be returned.

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

What kind of posts you'd like to search for. Defaults to platform’s default if not specified.

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

Limit posts to a given **pinned** location. Selects the first result from the Facebook location dropdown. For example, entering 'Alaska' will result in 'Anchorage, Alaska'.

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

Get posts starting from given date (YYYY-MM-DD).

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

Get posts ending on given date (YYYY-MM-DD).

## Actor input object example

```json
{
  "query": "Tesla",
  "resultsCount": 10,
  "searchType": "top"
}
```

# 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 = {
    "query": "Tesla",
    "resultsCount": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("scraper_one/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 = {
    "query": "Tesla",
    "resultsCount": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("scraper_one/facebook-posts-search").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": "Tesla",
  "resultsCount": 10
}' |
apify call scraper_one/facebook-posts-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=scraper_one/facebook-posts-search",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/TMBawM4LZpKN15DZX/builds/1qti5c2y9a4i61YJh/openapi.json
