# Facebook Video Search scraper (`data_dino/facebook-video-search-scraper`) Actor

Search Facebook's public Watch index and collect matching reels/videos — URL, permalink, CDN mp4 download links, title, caption, owner, engagement, duration, and creation time — one dataset item per video. Works logged-out with no account or cookies.

- **URL**: https://apify.com/data_dino/facebook-video-search-scraper.md
- **Developed by:** [Data Dino](https://apify.com/data_dino) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Video Search scraper

Searches Facebook's **public Watch index** (reels/videos) by keyword and exports each video as a dataset item — with **no account, log-in, cookies, or API key required**.

### What you get

For each video, the scraper captures:

- **Page & permalink URLs** – direct URL to the reel and to the video's permalink on the owner's profile.
- **Playable CDN mp4 download URLs** – signed, directly-downloadable SD and HD mp4 links (with their expiry time). These are standalone: you can download the mp4 bytes with a bare request.
- **Content** – title, full caption, accessibility label, thumbnail image.
- **Owner** – Facebook id, name, profile URL, verified badge.
- **Engagement & metadata** – views, reactions, comments, shares, video duration (text + milliseconds), relative time string, and creation date.

### How to use

Just hit **Run** — the defaults give you a quick sample of videos for the keyword `Sikorsky helicopter`.

To customize:

1. Set a **Search keyword** (or provide **Start URLs** — Facebook video-search URLs) — the `q=` parameter of each URL becomes a keyword.
2. Optionally set **Max results** (default 10; spread evenly across keywords) and **Max pages per query** for a deeper walk.
3. Toggle **Include CDN mp4 download URLs** (on by default) — turn it off for a fast SERP-only walk that skips the per-video CDN resolution.
4. Run. Results appear in the dataset as one item per video.

### Options

| Field | What it does |
| --- | --- |
| Search keyword | Keyword or a full Facebook search URL (required unless Start URLs are given). |
| Start URLs | A list of Facebook video-search URLs; each URL's `q=` parameter becomes a keyword. |
| Max results | Stop after N videos total (default 10; 0 not allowed — use a high number for a full walk). |
| Max pages per query | Safety cap on SERP pages walked per keyword (~7 videos/page). |
| Include CDN mp4 download URLs | Also resolve playable SD/HD CDN mp4 links per video (default on). |
| Managed proxy | Optional proxy URL (http://user:pass@host:port) for IP-bound blocks. Leave blank to use the actor's managed residential proxy. |

### Notes

- Uses Facebook's **public Watch SERP** via its own GraphQL endpoint — no login or cookies needed. The actor routes requests through a **managed residential proxy** by default to avoid Facebook's per-IP GraphQL rate limits when running in the cloud.
- The public result set is finite: a broad term walks ~15 pages (~99 videos) before stopping; a niche term may end earlier. Asking for more than exists returns fewer rows — not a bug.
- CDN mp4 links expire (~4 days); re-run to refresh them.
- Paces requests automatically and retries transient failures; self-heals if Facebook rotates its GraphQL operation id.
- Output is one JSON item per video in the default dataset, viewable from the Output tab.

# Actor input Schema

## `searchTerm` (type: `string`):

Keyword to search videos for (the actor's `searchTerm`). A full Facebook search URL (e.g. https://www.facebook.com/watch/search/?q=drone) also works. Required unless Start URLs are given.

## `startUrls` (type: `array`):

Alternative to a keyword: a list of Facebook video-search URLs (e.g. https://www.facebook.com/watch/search/?q=drone). Each URL's `q=` parameter becomes a keyword.

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

Stop after this many video rows total (spread evenly across keywords). Default 10 keeps the run quick; raise it for a fuller pull.

## `maxPages` (type: `integer`):

Safety cap on SERP pages walked per keyword (~7 videos/page). Pagination terminates naturally once no new video ids arrive.

## `cdnUrls` (type: `boolean`):

Also resolve the playable signed CDN mp4 URL(s) per video (SD/HD + expiry). One extra ~1 MB permalink fetch per video; disable for a fast SERP-only walk.

## `proxy` (type: `string`):

Optional proxy URL (http://user:pass@host:port) for IP-bound blocks. Leave blank to use the actor's managed residential proxy.

## Actor input object example

```json
{
  "searchTerm": "Sikorsky helicopter",
  "resultsLimit": 10,
  "maxPages": 50,
  "cdnUrls": true
}
```

# Actor output Schema

## `results` (type: `string`):

All scraped Facebook videos, one item per row. Keys: videoUrl, videoCdnUrl, videoCdnUrlHd, videoCdnUrlSd, videoCdnUrlExpires, permalinkUrl, video (id), title, save_description, label, thumbnail_image (uri), video_duration_text, video_duration_ms, video_owner_profile (typename/id/name/url/is_verified), video_broadcast_status, relative_time_string, views, reactions, comments, shares, createdAt, createdAtTimestamp, facebookId, facebookUrl, inputUrl, query, searchType, position, resultRole, renderingStrategy, scrapedAt.

# 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 = {};

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

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

```

## MCP server setup

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