# Facebook Search Scraper - Posts, Pages & Places (`thirdwatch/facebook-search-scraper`) Actor

Search publicly indexed Facebook posts, pages, profiles and places by keyword. Supports location and date filters without a Facebook login, cookies or account pool.

- **URL**: https://apify.com/thirdwatch/facebook-search-scraper.md
- **Developed by:** [Thirdwatch](https://apify.com/thirdwatch) (community)
- **Categories:** Social media, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 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/platform/actors/running/actors-in-store#pay-per-usage

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

Search publicly indexed Facebook posts, pages, profiles and local businesses by keyword. The Actor runs over HTTP through Apify's Google Search proxy, so it does not need a Facebook account, cookies, a browser or an authenticated Graph API token.

### What it returns

- Public Facebook post URLs with indexed titles and snippets
- Public Page and profile URLs
- Location-focused results for places and local businesses
- Raw date labels when the public index exposes them
- Query, result type, position and collection timestamp for every row

### Input

The input is compatible with `danek/facebook-search-ppr` for the core fields.

| Field | Type | Description |
|---|---|---|
| `query` | string | Keyword or phrase to search |
| `search_type` | string | `posts`, `pages`, `places`, or `global` |
| `max_posts` | integer | Maximum unique results (5-1,000) |
| `recent_posts` | boolean | Prefer posts indexed in the past week |
| `location` | string | Optional city, region, or country |
| `start_date` | string | Optional start date in `YYYY-MM-DD` |
| `end_date` | string | Optional end date in `YYYY-MM-DD` |
| `queries` | array | Up to 19 additional search terms |

Example:

```json
{
  "query": "artificial intelligence",
  "search_type": "posts",
  "max_posts": 25,
  "recent_posts": true,
  "location": "United States"
}
```

### Example result

```json
{
  "title": "OpenAI - New research update",
  "url": "https://www.facebook.com/openai/posts/123456789/",
  "description": "A public update about new AI research...",
  "date_text": "2 days ago",
  "result_type": "post",
  "query": "artificial intelligence",
  "search_type": "posts",
  "location": "United States",
  "page": 1,
  "position": 1,
  "source": "google_public_index",
  "scraped_at": "2026-08-07T12:00:00+00:00"
}
```

### Important limitations

This is public web-index search, not Facebook's personalized logged-in search. Results are limited to Facebook content visible to search engines, ranking and coverage can differ from facebook.com, and newly published or de-indexed content may be missing. Date filters apply to the public search index; `date_text` is returned as displayed rather than converted into a guessed publication timestamp. Private profiles, closed groups, login-only posts and deleted content are intentionally unavailable.

The Actor accesses only public URLs. Use personal data lawfully and in accordance with Facebook's terms and applicable privacy laws.

# Actor input Schema

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

Keyword or phrase to find in public Facebook results.

## `search_type` (type: `string`):

Search public posts, pages/profiles, places, or all indexed Facebook result types.

## `max_posts` (type: `integer`):

Maximum number of unique results across all queries. The minimum of 5 protects the Actor's per-run economics; public search-index depth varies by keyword.

## `recent_posts` (type: `boolean`):

For post searches, prefer results indexed during the past week. Explicit dates take precedence.

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

Optional city, region or country added to the search, for example Austin, Texas or London, UK.

## `start_date` (type: `string`):

Optional earliest index date in YYYY-MM-DD format.

## `end_date` (type: `string`):

Optional latest index date in YYYY-MM-DD format.

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

Optional additional search terms processed in the same run.

## Actor input object example

```json
{
  "query": "OpenAI",
  "search_type": "posts",
  "max_posts": 50,
  "recent_posts": false,
  "queries": []
}
```

# 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": "OpenAI"
};

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

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

```

## MCP server setup

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