# Facebook Search Scraper (`calm_builder/facebook-search-scraper`) Actor

Search Facebook by keyword without login. Get public posts with text, author, date, reactions, comments, shares, photos and videos, plus videos, people, pages, places and events. Filter posts by date range and city. Export JSON, CSV, Excel.

- **URL**: https://apify.com/calm\_builder/facebook-search-scraper.md
- **Developed by:** [Coder](https://apify.com/calm_builder) (community)
- **Stats:** 13 total users, 13 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 search results

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 Search Scraper

Search **Facebook by keyword** and export the results to JSON, CSV or Excel, **without logging in or providing cookies**. Get public **posts** with their full text, author, date, reactions, comments, shares and media, or search **videos, people, pages, places and events**. Filter posts by **date range** and **city**, and get the newest posts first.

### What you get

- **Posts:** post link and ID, full text, posting date, author (name, link, ID, picture), the group it was posted in, tagged city, reaction count with a breakdown by type (Like, Love, Haha...), comment count, share count, view count for videos, photos and videos with their links, external link and privacy.
- **Videos:** video link, caption, author, views, publish date, thumbnail, duration and, for most videos, direct SD/HD video file links plus reactions, comments and shares.
- **People, pages, places and events:** name, link, ID, profile picture, verified badge, and the details Facebook shows in public search (for example "Lives in New York, New York", or a page's description).
- **Top:** Facebook's mixed "Top" results for a term.
- **Deep searches:** posts and videos are searched month by month, newest first, so you can collect far more posts for a term than a single Facebook search shows (which stops at about 100). This works with or without a date range.
- **Every row carries the search term and search type** that found it, so several terms can go into one run.

### Use cases

- **Social listening and brand monitoring:** collect public posts that mention your brand, product or competitors, on a schedule.
- **Trend and sentiment research:** pull posts on a topic for a date range and feed them into NLP or BI tools.
- **Lead generation:** find pages, places and people matching a keyword, with links and pictures.
- **Content research:** find the most viewed videos and most engaged posts on a subject.
- **Event discovery:** find public events by keyword and date.

### Input

| Field | Description |
|---|---|
| **Search terms** (`searchTerms`) | One or more keywords. Each is searched separately. |
| **Search type** (`searchType`) | `posts`, `top`, `people`, `pages`, `places`, `videos` or `events`. Default `posts`. |
| **Max results per search term** (`maxResults`) | Default 50, up to 5,000. |
| **Posted after / before** (`dateFrom`, `dateTo`) | Posts and videos. A date like `2026-01-31` or a period like `3 months`. |
| **Most recent first** (`recentFirst`) | Posts and videos. Newest results first. |
| **City** (`location`) | Posts and people. The city's Facebook page link, e.g. `https://www.facebook.com/New-York-New-York-108424279189115/`, or just its number. |
| **Event date** (`eventDate`) | Events. Events on this day, e.g. `2026-10-03`. |

```json
{
  "searchTerms": ["iced latte", "cold brew"],
  "searchType": "posts",
  "maxResults": 300,
  "dateFrom": "2026-06-01",
  "dateTo": "2026-09-30",
  "location": "https://www.facebook.com/New-York-New-York-108424279189115/"
}
```

**Finding a city's link:** search the city's name on Facebook, open its place page (for example "New York, New York") and copy the address. The number at the end is the city's ID.

### Output

One dataset item per result. A post:

```json
{
  "type": "post",
  "id": "1072805661929638",
  "url": "https://www.facebook.com/permalink.php?story_fbid=pfbid0UWkMov9...",
  "text": "Caramel Cheesecake And Toasted Marshmallow Canned Coffee ☀️",
  "createdAt": "2026-06-29T14:05:29Z",
  "author": {
    "id": "100076006434154",
    "name": "Sweet Tooth Stop",
    "url": "https://www.facebook.com/people/Sweet-Tooth-Stop/100076006434154/",
    "profilePicture": "https://scontent.xx.fbcdn.net/...",
    "type": "User"
  },
  "group": null,
  "taggedLocation": { "id": "108347462523015", "name": "Chattanooga, TN, United States", "url": "https://www.facebook.com/Chattanooga-Tennessee-108347462523015/" },
  "reactionCount": 73,
  "reactions": { "Like": 49, "Love": 24 },
  "commentCount": 36,
  "shareCount": 8,
  "viewCount": null,
  "media": [
    { "type": "photo", "id": "1072805638596307", "url": "https://www.facebook.com/photo/?fbid=1072805638596307", "imageUrl": "https://scontent.xx.fbcdn.net/...", "width": 526, "height": 526, "caption": "May be an image of dessert, drink and text" }
  ],
  "externalLink": null,
  "privacy": "Public",
  "searchTerm": "coffee",
  "searchType": "posts",
  "scrapedAt": "2026-10-01T16:20:11Z"
}
```

A page (people, places and events have the same shape):

```json
{
  "type": "page",
  "id": "100064910490989",
  "name": "7 Brew Coffee",
  "url": "https://www.facebook.com/7brewcoffee",
  "profilePicture": "https://scontent.xx.fbcdn.net/...",
  "isVerified": true,
  "subtitle": null,
  "description": "We Cultivate Kindness™ one cup at a time 🥤 Download the 7 Brew App now!",
  "searchTerm": "coffee",
  "searchType": "pages",
  "scrapedAt": "2026-10-01T16:20:11Z"
}
```

The dataset has one **Overview** view; the Output tab shows all fields.

### Good to know

- **Only public content.** The Actor sees what anyone sees on Facebook without logging in. Friends-only posts and searches that depend on your own account (such as "posts from friends") are not available.
- **Facebook limits some searches.** A term may have fewer public results than you ask for, especially places, events and Top. The run log reports how many results each term returned and whether Facebook ran out.
- **People, pages, places and events** come with the details Facebook shows in its public search list. Event dates and page categories are not part of those results.
- **Groups, photos and reels searches** are not offered, because Facebook does not show them to logged-out visitors.
- **Date filters** use the date Facebook assigns to each post.
- **Video dates:** video results show a relative date ("3 days ago") in `publishedText` instead of an exact `createdAt`.

### Pricing

You pay per result saved to the dataset. Searches that fail and duplicate results are never charged. Set a maximum cost per run in the run options, and the Actor stops cleanly when it is reached.

**Free plan:** all features, up to 3 search terms and 50 results per term per run.

### FAQ

**Do I need a Facebook account or cookies?** No.

**How many posts can I get for one keyword?** Usually hundreds or more. Facebook's own search stops at about 100 posts, but the Actor searches each month separately, newest first, so it keeps going far past that. Set a date range to choose exactly which months are searched.

**Can I run it on a schedule?** Yes. Save your input as a task and schedule it in Apify Console, for example daily with `dateFrom` set to `1 day`.

**Can I use it through the API or with AI agents?** Yes, like any Apify Actor: through the Apify API, SDKs, integrations (Make, Zapier, n8n) or the Apify MCP server.

# Actor input Schema

## `searchTerms` (type: `array`):

What to search for, one term per line. Each term is searched separately.

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

Which Facebook search tab to collect.

## `maxResults` (type: `integer`):

Stop after this many results for each term. Facebook shows a limited number of results publicly for some searches; the run log says when a search ran out.

## `dateFrom` (type: `string`):

Posts and videos only. A date like 2026-01-31 or a period like '3 months'. Date ranges also reach deeper: each month is searched on its own.

## `dateTo` (type: `string`):

Posts and videos only. A date like 2026-06-30. Leave empty for today.

## `recentFirst` (type: `boolean`):

Posts and videos only. Return the newest results first instead of Facebook's relevance order.

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

Posts and people only. Paste the city's Facebook page link, e.g. https://www.facebook.com/New-York-New-York-108424279189115/, or just its number. For people, Facebook ranks people from that city first rather than excluding others.

## `eventDate` (type: `string`):

Events only. Events happening on this day, e.g. 2026-10-03.

## Actor input object example

```json
{
  "searchTerms": [
    "coffee"
  ],
  "searchType": "posts",
  "maxResults": 50,
  "recentFirst": false
}
```

# 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 = {
    "searchTerms": [
        "coffee"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("calm_builder/facebook-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 = { "searchTerms": ["coffee"] }

# Run the Actor and wait for it to finish
run = client.actor("calm_builder/facebook-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 '{
  "searchTerms": [
    "coffee"
  ]
}' |
apify call calm_builder/facebook-search-scraper --silent --output-dataset

```

## MCP server setup

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