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

Search Facebook's public video catalogue by keyword and collect each matching video with its title, owner, duration, publish date and thumbnail. Supply several search terms in one run and page through as many results as you need. No Facebook login is used.

- **URL**: https://apify.com/thenetaji/facebook-video-search-scraper.md
- **Developed by:** [The Netaji](https://apify.com/thenetaji) (community)
- **Categories:** Social media, For creators
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 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

## Facebook Video Search Scraper — Keyword Video Search

The Actor searches Facebook's public video catalogue by keyword and returns the matching videos, exactly as a logged-out visitor sees them. No Facebook account, login, or session cookie is used at any point.

### Accepted input

`searchQuery` is required and accepts a list of keywords or phrases, one per line; duplicates are collapsed before any request is made. Each term is searched separately, and every saved row records the term it came from. `maxItems` (default `50`) bounds the number of records saved per term; `0` continues until Facebook stops returning results.

```json
{
  "searchQuery": ["space launch", "coffee recipe"],
  "maxItems": 100
}
```

### Result fields

Each row carries `query`, `id`, `title`, `message`, `url`, `duration`, `published`, `imageUrl`, `name`, `isVerified`, and `raw`.

The example below illustrates field shapes; it is not captured from a live run.

```json
{
  "query": "space launch",
  "id": "1736405456734526",
  "title": "What's Up: December 2022 Skywatching Tips from NASA",
  "message": "Lots of Moon action this month—and we don't just mean Orion's journey!",
  "url": "https://www.facebook.com/NASA/videos/1736405456734526/",
  "duration": "3:33",
  "published": "1 Dec 2022 · 20K views",
  "imageUrl": "https://scontent.xx.fbcdn.net/v/t15.5256-10/...",
  "name": "NASA - National Aeronautics and Space Administration",
  "isVerified": true
}
```

`published` is one field, not two, because Facebook ships it as a single display label combining the date and the view count. Its wording and date format change with the locale Facebook serves the request in, so splitting it into a date column and a numeric view count would mean parsing a string whose format is not stable. The label is passed through exactly as returned; parse it yourself if your locale is consistent.

### Videos search vs. a Page's video list

These are different datasets and neither replaces the other:

- **This Actor** searches all public videos by keyword, across every Page, and returns titles, durations, publish labels and thumbnails.
- The [Facebook Videos Scraper](https://apify.com/thenetaji/facebook-videos-scraper) enumerates one specific Page's video library. Facebook's logged-out Page video list returns only IDs and watch links — no titles or durations exist in that response.

If you know whose videos you want, use the Page list. If you want to find videos by topic, use this one.

### Scope: videos only

Facebook's other search verticals — people, Pages, posts, groups, events, places — are not reachable without an account. Their `facebook.com/search/...` pages return `404` to logged-out clients, verified against both a plain HTTP client and a real browser. Only the video vertical serves public results, so this Actor covers videos and does not pretend to a general Facebook search it cannot perform.

### How many results a term returns

This varies a lot by term, and it is Facebook's ranking rather than a limit in the Actor. A well-defined topic like `nasa` returns a full page of matches per request and pages deeply; a broad conversational phrase can return only a handful in total before Facebook stops serving new ones. If a term returns less than you expected, several narrower terms will usually collect more than one broad term.

### Behaviour on partial results

Each search term is a separate paginated series of requests. A term that fails is logged as a warning and skipped, and the run continues with the rest of the list. A term with no matches simply saves no rows for that term.

### Public, logged-out data only

Everything returned here is visible to somebody who is not signed in to Facebook. Videos restricted to logged-in visitors are not returned, and results can vary by the region the request exits from — Facebook ranks video search regionally.

### Frequently asked questions

**Can I search for people, Pages or posts instead of videos?**
No. Those verticals are login-gated on Facebook's side; their search pages return `404` to logged-out clients. Only videos are publicly searchable.

**Why is the view count inside `published` instead of its own column?**
Facebook returns one combined, locale-dependent label rather than a numeric count. Rather than parse a format that changes per locale, the label is passed through as-is.

**Do results differ between runs?**
They can. Video search is ranked and regional, so ordering and the exact result set may shift between runs and between exit regions, in the same way they shift for a human searching twice.

**Is a Facebook account or login required?**
No. Only what Facebook already serves to a logged-out visitor is read.

### What this is useful for

Finding every public video on a topic regardless of which Page published it; tracking how a brand, product or event is being covered in video across Facebook; sourcing creator and Page leads by the subjects they actually publish on; and building topic-based video monitoring that a per-Page enumeration cannot reach.

# Actor input Schema

## `searchQuery` (type: `array`):

Keywords or phrases to search Facebook videos for, one per line. Each term is searched separately and every result records the term it came from.

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

Maximum videos to save per search term. Set `0` to continue until Facebook stops returning results.

## Actor input object example

```json
{
  "searchQuery": [
    "space launch",
    "coffee recipe"
  ],
  "maxItems": 20
}
```

# Actor output Schema

## `dataset` (type: `string`):

All records scraped by this run

# 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 = {
    "searchQuery": [
        "space launch"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("thenetaji/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 = {
    "searchQuery": ["space launch"],
    "maxItems": 20,
}

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

```

## MCP server setup

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