# Facebook Video Extractor (`kawsar/facebook-video-extractor`) Actor

Facebook Video Extractor that pulls title, views, reactions, comments and video links from public posts, so you can track video performance without opening each one by hand.

- **URL**: https://apify.com/kawsar/facebook-video-extractor.md
- **Developed by:** [Kawsar](https://apify.com/kawsar) (community)
- **Categories:** Social media, Videos, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 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 Extractor

Facebook Video Extractor pulls structured data from any public Facebook video post or Reel: title, caption, author, thumbnail, view count, reaction count, comment count, duration, and publish date. Give it a video URL and get the results back as clean JSON, CSV, or Excel, ready to use in a spreadsheet, a dashboard, or your own pipeline.

### What it does

Paste a link to a Facebook video, whether that's a `facebook.com/watch/?v=` link, a page's `/videos/` link, or a `facebook.com/reel/` link, and the actor returns:

- Video title and caption
- Author name and profile URL
- Thumbnail image
- View count, reaction count, comment count
- Duration in seconds
- Publish date
- Canonical post URL
- Direct HD and SD video file URLs

Run it against a single video or a batch of hundreds. No Facebook login required, and nothing to install locally.

### Why use it

- **Track performance** for your own Facebook videos, or a client's, without digging through Facebook's native analytics dashboard.
- **Monitor competitors** by pulling view and engagement counts from public pages on a recurring schedule.
- **Build a research dataset** of video metadata for content analysis, trend tracking, or academic research.
- **Power SEO and content reporting** by turning raw engagement numbers into a structured table you can chart or compare.
- **Feed other tools**: export to Google Sheets, connect the dataset to a BI dashboard, or pull results via the Apify API straight into your own pipeline.

### Who it's for

- Social media managers who need weekly video performance snapshots without opening each post
- Marketing and SEO teams tracking video reach and engagement across public pages
- Researchers and journalists collecting Facebook video metadata at scale
- Developers who want Facebook video data as an API call instead of a scraping project

### Input

| Field | Type | Required | Description |
|---|---|---|---|
| `startUrls` | array of strings | Yes | Facebook video URLs to extract data from |
| `maxItems` | integer | No | Maximum number of URLs to process per run (default 100, max 1000) |
| `requestTimeoutSecs` | integer | No | Per-request timeout in seconds (default 30) |

Example input:

```json
{
  "startUrls": [
    "https://www.facebook.com/watch/?v=414232415974682",
    "https://www.facebook.com/reel/2124425745096915"
  ],
  "maxItems": 100
}
```

Accepted URL formats:

- `https://www.facebook.com/watch/?v=<video_id>`
- `https://www.facebook.com/<page>/videos/<video_id>/`
- `https://www.facebook.com/reel/<video_id>`
- `https://facebook.com/watch?v=<video_id>` (with or without `www.`)

### Output

Each result is pushed to the dataset as one item:

```json
{
  "inputUrl": "https://www.facebook.com/watch/?v=414232415974682",
  "videoId": "414232415974682",
  "postUrl": "https://www.facebook.com/kidstoysandcolors/videos/.../414232415974682/",
  "videoTitle": "Car Toys Construction Trucks Looking for Excavator Vehicles Toy",
  "videoCaption": "Car Toys Construction Trucks Looking for Excavator Vehicles Toy",
  "authorName": "Kids Toys and Colors",
  "authorProfileUrl": "https://www.facebook.com/kidstoysandcolors/",
  "thumbnailUrl": "https://scontent.fna.fbcdn.net/...",
  "hdVideoUrl": "https://video.fna.fbcdn.net/...",
  "sdVideoUrl": "https://video.fna.fbcdn.net/...",
  "durationSeconds": 634.1,
  "viewCount": 649022,
  "reactionCount": 10000,
  "commentCount": 174,
  "publishedAt": "2019-04-25T10:34:00+00:00",
  "scrapedAt": "2026-08-16T05:20:29.621949+00:00",
  "error": null
}
```

#### Output fields

| Field | Description |
|---|---|
| `inputUrl` | The URL you provided in `startUrls` |
| `videoId` | Facebook's numeric ID for the video |
| `postUrl` | Canonical URL of the video post |
| `videoTitle` | Video title |
| `videoCaption` | Full caption or post text |
| `authorName` | Name of the page, profile, or account that posted the video |
| `authorProfileUrl` | Link to the author's Facebook page or profile |
| `thumbnailUrl` | Video thumbnail image |
| `hdVideoUrl` | Direct link to the HD video file, when available |
| `sdVideoUrl` | Direct link to the SD video file, when available |
| `durationSeconds` | Video length in seconds |
| `viewCount` | Total view count |
| `reactionCount` | Total reactions (likes, love, etc.) |
| `commentCount` | Total comment count |
| `publishedAt` | Publish date and time (ISO 8601, UTC) |
| `scrapedAt` | When the actor collected this data (ISO 8601, UTC) |
| `error` | Set when extraction failed for this URL, otherwise `null` |

If a URL fails, the actor logs the reason and pushes an item with `error` set, instead of stopping the whole run. Some fields, such as `hdVideoUrl`, `viewCount`, or `authorProfileUrl`, may come back `null` for certain videos depending on visibility settings and how Facebook renders that specific post.

### How to use it

1. Open the actor on Apify and click **Try for free** or **Start**.
2. Paste one or more Facebook video or Reel URLs into `startUrls`.
3. Set `maxItems` if you're running a large batch.
4. Click **Start**, then open the **Dataset** tab once the run finishes.
5. Export results as JSON, CSV, Excel, or push them straight to Google Sheets.
6. Or pull the dataset programmatically via the Apify API or one of the Apify SDKs (Python, JavaScript).

### Frequently asked questions

**Does this actor download Facebook videos?**
No. It extracts public metadata and the video's direct CDN link. Downloading and storing video files is your responsibility, and you should always respect Facebook's terms of service and the content owner's rights.

**Can it access private videos or videos that require login?**
No. Only publicly accessible Facebook video posts can be extracted.

**Do the video URLs in `hdVideoUrl` and `sdVideoUrl` work forever?**
No. These are signed Facebook CDN links that expire after a period of time, so use them soon after the run completes.

**Does this work on Reels?**
Yes, `facebook.com/reel/` links are supported alongside standard `/watch/` and page video links.

**How many videos can I process in one run?**
Up to 1000 per run via `maxItems`. Run it again or on a schedule for larger or recurring jobs.

### Support

Found a bug or have a feature request? Reach out through the Issues tab on the actor's Apify page.

# Actor input Schema

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

Public Facebook video URLs to extract data from, for example a facebook.com/watch/?v= link or a page's /videos/ link.

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

Maximum number of video URLs to process per run.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout in seconds.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.facebook.com/watch/?v=414232415974682"
  ],
  "maxItems": 100,
  "requestTimeoutSecs": 30
}
```

# Actor output Schema

## `videos` (type: `string`):

Extracted Facebook video data, one item per input URL.

# 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 = {
    "startUrls": [
        "https://www.facebook.com/watch/?v=414232415974682"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kawsar/facebook-video-extractor").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 = { "startUrls": ["https://www.facebook.com/watch/?v=414232415974682"] }

# Run the Actor and wait for it to finish
run = client.actor("kawsar/facebook-video-extractor").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 '{
  "startUrls": [
    "https://www.facebook.com/watch/?v=414232415974682"
  ]
}' |
apify call kawsar/facebook-video-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kawsar/facebook-video-extractor"
        }
    }
}

```

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/zTNNENtEgvwtg2Cgp/builds/d40uaA1aCvW6aHZy7/openapi.json
