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

Extract Facebook video data from search or direct video URLs. Get video metadata like description, play URL, author data, reactions, engagement data and more.

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

## Pricing

from $3.10 / 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.
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?

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

### What does Facebook Video Search Scraper do?

**Facebook Video Search Scraper** is an Apify Actor designed to extract detailed information about videos from Facebook. It can scrape video details using search terms or direct video URLs, allowing users to gather comprehensive data on a wide range of videos available on Facebook, including reels, watch videos, and profile videos.

### ✨ Features

- 🔎 Scrape by search terms or video URLs
- ⚡ Fast and reliable scraping with automatic retry handling
- 🧑‍💻 Perfect for non-technical users
- 🔒 No need for authentication
- 🔄 Automatically handles retries for failed requests
- 📦 Outputs detailed data in JSON format for easy integration with other tools
- 📊 Extracts engagement metrics (likes, comments, shares, views)
- 🎬 Multiple video format support (reels, watch videos, profile videos)

### 🎯 Who Is This For?

- Content creators and marketers looking to analyze Facebook video content and trending videos
- Social media researchers studying engagement patterns and viral content
- Developers needing structured data from Facebook for their applications
- Business analysts tracking video performance and audience metrics
- Anyone interested in gathering insights from Facebook's vast video library

### ⬇️ Input Options

- 🔍 `searchTerms` (optional) - List of search terms to query on Facebook. The Actor will search for each term and scrape results until it reaches the `maxItems` limit.

- 🔗 `startUrls` (optional) - List of Facebook video or search URLs to scrape directly. Supports video URLs, reel URLs, search URLs, and profile video URLs.
  URL formats accepted:
  - https://www.facebook.com/search/videos/?q=gaming
  - https://www.facebook.com/watch/?v=847715267732382
  - https://www.facebook.com/reel/1305159624385094/
  - https://www.facebook.com/Gamemaster4u/videos/847715267732382
  - https://www.facebook.com/Gamemaster4u/reels/847715267732382/
  - https://www.facebook.com/video.php?v=847715267732382
  - https://fb.watch/vidxLFrQDH
  - https://www.facebook.com/share/v/1ATZr1dSxN/

- ⚙️ `maxItems` (optional) - Maximum number of videos to scrape per search term. Default is `50`, maximum is `100` videos per search term.

#### 💡 Input Examples

###### 🔍 Scrape by Search Terms

```json
{
  "searchTerms": [
    "funny videos",
    "gaming highlights"
  ],
  "maxItems": 50
}
```

###### 🔗 Scrape by Video URLs

```json
{
  "startUrls": [
    "https://www.facebook.com/watch/?v=847715267732382",
    "https://www.facebook.com/reel/1305159624385094/",
    "https://www.facebook.com/Gamemaster4u/videos/847715267732382"
  ]
}
```

###### 🔍 Scrape by Search URLs

```json
{
  "startUrls": [
    "https://www.facebook.com/search/videos/?q=gaming"
  ],
  "maxItems": 100
}
```

### 📤 Output Format

The scraper returns comprehensive video data with engagement metrics and metadata.

#### Video Fields

- `postId`: Unique identifier for the video post
- `videoUrl`: Direct URL to the video on Facebook
- `creationTime`: Unix timestamp of when the video was posted
- `description`: Description or caption of the video
- `author`: Creator information including ID, URL, name, and profile picture
- `totalReactionCount`: Total number of reactions (all types combined)
- `reactions`: Breakdown of reaction types (likeCount, loveCount, hahaCount, wowCount, sadCount, angryCount, careCount)
- `shareCount`: Number of times the video was shared (Not available when scraping by Video URLs)
- `commentCount`: Number of comments on the video
- `viewCount`: Number of views the video has received
- `durationMs`: Duration of the video in milliseconds
- `thumbnailUrl`: URL of the video's thumbnail image
- `playUrlSd`: URL to the video file in SD quality
- `playUrlHd`: URL to the video file in HD quality
- `inputSearchTerm`: The search term used (if scraped via search)
- `inputUrl`: The start URL used (if scraped via direct video or search URL)

### 🗂️ Output Examples

#### Video Output Example

```json
{
  "postId": "122219081600295548",
  "videoUrl": "https://www.facebook.com/reel/1305159624385094/",
  "creationTime": 1779016082,
  "description": "Mans best friend who? #doglover #dog #fyp #viral",
  "author": {
    "id": "61558866457481",
    "url": "https://www.facebook.com/people/Funny-Funny/61558866457481/",
    "name": "Funny Funny",
    "profilePicture": "https://scontent-sjc6-1.xx.fbcdn.net/v/t39.30808-1/486530529_122168024750295548_49330640692057205_n.jpg"
  },
  "totalReactionCount": 85289,
  "shareCount": 2798,
  "commentCount": 1676,
  "viewCount": 1140430,
  "reactions": {
    "likeCount": 58745,
    "loveCount": 5814,
    "hahaCount": 19822,
    "wowCount": 47,
    "sadCount": 25,
    "angryCount": 8,
    "careCount": 828
  },
  "durationMs": 82666,
  "thumbnailUrl": "https://scontent-sjc6-1.xx.fbcdn.net/v/t15.5256-10/700799701_1928705034496667_7931285091674000058_n.jpg",
  "playUrlSd": "https://video-sjc3-1.xx.fbcdn.net/o1/v/t2/f2/m412/...",
  "playUrlHd": "https://video-sjc3-1.xx.fbcdn.net/o1/v/t2/f2/m366/...",
  "inputSearchTerm": "funny"
}
```

### How many results can I scrape?

You can scrape up to 100 results per search term. When scraping by direct video URLs, this limit does not apply.

### 💲 How much will scraping Facebook Video cost you?

The pricing changes according to your Apify plan.

| Plan | Cost |
|---|---|
| Free | $6 per 1000 videos |
| Starter | $3.8 per 1000 videos |
| Scale | $3.4 per 1000 videos |
| Business | $3.1 per 1000 videos |

### 🧩 Integrations and Facebook Video Search Scraper

Facebook Video Search Scraper can be connected with almost any cloud service or web app thanks to [integrations on the Apify platform](https://apify.com/integrations). You can integrate with Make, Zapier, Slack, Airbyte, GitHub, Google Sheets, Google Drive, [and more](https://docs.apify.com/integrations). Or you can use [webhooks](https://docs.apify.com/integrations/webhooks) to carry out an action whenever an event occurs, e.g. get a notification whenever Facebook Video Search Scraper successfully finishes a run.

### 🔌 Using Facebook Video Search Scraper with the Apify API

The Apify API gives you programmatic access to the Apify platform. The API is organized around RESTful HTTP endpoints that enable you to manage, schedule, and run Apify actors. The API also lets you access any datasets, monitor actor performance, fetch results, create and update versions, and more.

To access the API using Node.js, use the `apify-client` NPM package. To access the API using Python, use the `apify-client` PyPI package.

Check out the [Apify API reference](https://docs.apify.com/api/v2) docs for full details or click on the  [API tab](https://apify.com/natanielsantos/facebook-video-search-scraper/api) for code examples.

### 💬 Giving feedback

We're always working on improving the performance of our Actors. So if you've got any technical feedback for Facebook Video Search Scraper or simply found a bug, please create an issue on the Actor's [Issues tab](https://apify.com/natanielsantos/facebook-video-search-scraper/issues/open) in Apify Console.
📧 Email: nathan.santos159@hotmail.com

# Actor input Schema

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

List of search terms to scrape videos from Facebook's search results.

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

The maximum number of items to scrape per search term.

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

List of Facebook video URLs or search URLs to start scraping from. Example URLs:

- `https://www.facebook.com/watch/?v=847715267732382`
- `https://www.facebook.com/reel/847715267732382`
- `https://www.facebook.com/Gamemaster4u/videos/847715267732382`
- `https://www.facebook.com/video.php?v=847715267732382`
- `https://www.facebook.com/Gamemaster4u/reels/847715267732382/`
- `https://www.facebook.com/search/videos/?q=game`
- `https://fb.watch/vidxLFrQDH`
- `https://www.facebook.com/share/v/1ATZr1dSxN/`

## Actor input object example

```json
{
  "searchTerms": [
    "game"
  ],
  "maxItems": 50,
  "startUrls": [
    {
      "url": "https://www.facebook.com/watch/?v=847715267732382"
    },
    {
      "url": "https://www.facebook.com/reel/847715267732382"
    },
    {
      "url": "https://www.facebook.com/Gamemaster4u/videos/847715267732382"
    },
    {
      "url": "https://www.facebook.com/video.php?v=847715267732382"
    },
    {
      "url": "https://www.facebook.com/Gamemaster4u/reels/847715267732382/"
    },
    {
      "url": "https://www.facebook.com/search/videos/?q=game"
    },
    {
      "url": "https://fb.watch/vidxLFrQDH"
    },
    {
      "url": "https://www.facebook.com/share/v/1ATZr1dSxN/"
    }
  ]
}
```

# 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": [
        "game"
    ]
};

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

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

```

## MCP server setup

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