# Facebook Video Scraper Ultra (`neuro-scraper/facebook-video-scraper-ultra`) Actor

🔍 Explore Facebook videos like a pro! Get duration ⏱ and uploader details instantly. Privacy-safe, high-speed, and designed for developers to discover patterns, insights, and trends effortlessly😱

- **URL**: https://apify.com/neuro-scraper/facebook-video-scraper-ultra.md
- **Developed by:** [Neuro Scraper](https://apify.com/neuro-scraper) (community)
- **Categories:** Social media, Automation, Videos
- **Stats:** 13 total users, 0 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: 1.00 out of 5 stars

## Pricing

$8.99/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#rental-actors

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Scraper — Apify Actor

**Hero:** Instant, privacy-safe extraction of Facebook video metadata and direct media URLs — production-ready and easy to run from Apify Console.

---

### 📖 One-line summary

Turn Facebook video links into clean, structured JSON (URLs, titles, stats, and multiple duration formats) — no code changes required in Console.

---

### 💡 Use cases — When to use

* Monitor public pages for trending videos and engagement signals.
* Feed reliable video URLs into transcription, summarization, or indexing pipelines.
* Build content audits or competitor intelligence dashboards.
* Bulk-export media links and metadata for analytics teams.

---

### ⚡ Quick Start — Console (one-click)

1. Open this Actor in Apify Console.
2. Paste the example input (see Inputs section) into the Input tab.
3. Click **Run** — results appear in the Dataset when the run completes.

---

### ⚙️ Quick Start — CLI & API

**CLI (apify-cli)**

```bash
## Run with a simple input file
apify run --input input.example.json
````

**Python — apify-client**

```python
from apify_client import ApifyClient
client = ApifyClient('<APIFY_TOKEN>')
run_input = {"facebookVideoUrls": ["https://www.facebook.com/watch?v=1234567890"]}
run = client.actor('your-username/facebook-video-scraper').call(run_input=run_input)
print('Run started:', run['id'])
```

***

### 📝 Inputs (fields & schema)

Paste JSON into the Actor Input field in Console. Minimal example is in `input.example.json` (in Canvas).

**Schema (key fields):**

- `facebookVideoUrls` (array\[string]) — required. One or more Facebook watch/post URLs.
- `maxVideos` (integer) — optional. Limit processed items.
- `cookiesFile` (string) — optional. Key-value store name of a cookies file for logged-in scraping.
- `proxyConfig` (object) — optional. Proxy settings (Apify Proxy or custom).

***

### ⚙️ Configuration

| 🔑 Name     | 📝 Type | ❓ Required  | ⚙️ Default | 📌 Example              | 🧠 Notes                                                |
| ----------- | ------- | ----------- | ---------- | ----------------------- | ------------------------------------------------------- |
| username    | string  | ✅ Yes       | None       | "tiktok\_user123"        | Target username to fetch info for (optional alias).     |
| proxyConfig | object  | ⚙️ Optional | {}         | {"useApifyProxy": true} | Proxy settings (use Apify Proxy or custom credentials). |

> Example Console setup: Paste `"tiktok_user123"` into the *Input* field under `username`, then click *Run Actor*.

***

### 📄 Outputs (Dataset / KV examples)

The actor writes results to the default Dataset and to a key-value store `ALL_RESULTS`.
Each record is a compact JSON object with metadata and multiple duration formats.

**Output example**

```json
{
  "id": "1234567890",
  "title": "Funny Cat Compilation",
  "description": "The funniest cats of 2025",
  "upload_date": "1st October 2025",
  "timestamp": 1696158720,
  "timestamp_iso": "2025-10-01T14:32:00Z",
  "view_count": "154.3K",
  "like_count": 9200,
  "comment_count": 142,
  "videoUrl": "https://video.xx.fbcdn.net/v/t42.9040-2/...",
  "thumbnail": "https://scontent.xx.fbcdn.net/v/t15.5256-10/...",
  "duration_seconds": 97.0,
  "duration": "1m 37s",
  "duration_display": "1 Minute 37 Seconds (0.0270 Hours)",
  "duration_full": {
    "in_seconds": "97 Seconds",
    "in_minutes": "1 Minutes 37 Seconds",
    "in_hours": "0 Hours 1 Minutes 37 Seconds"
  },
  "duration_summary": "⏱ 97s | 1m 37s | 0h 1m 37s",
  "duration_decimal_hours": 0.027,
  "duration_decimal_minutes": 1.62,
  "raw_json": { }
}
```

***

### 🔑 Environment Variables

- `<APIFY_TOKEN>` — used by the Apify Console/CLI when calling via API.
- `<PROXY_USER:PASS@HOST:PORT>` — placeholder for custom proxy credentials (store as a secret).
- `FB_COOKIES` — optional placeholder for a cookies file name in key-value store when scraping private/restricted videos.

**TODO:** Replace placeholders with secrets via Console Secret Manager. Never paste credentials directly into Input.

***

### ▶️ How to Run

**Console**

1. Open the Actor page.
2. Paste `input.example.json` into *Input*.
3. Click **Run** — monitor progress in Logs and Dataset.

**CLI**

```bash
apify run --input input.example.json
```

**API**
Use the Python snippet above (apify-client) — call the actor with `run_input` and poll the run result.

***

### ⏰ Scheduling & Webhooks

- Schedule runs in Console using the Scheduler to automate daily or hourly collection.
- Configure Webhooks in Apify to receive run-complete notifications and processed payloads.

***

### 🕾️ Logs & Troubleshooting

- If extraction fails for certain URLs, enable proxy and provide a `cookiesFile` for logged-in access.
- Check the Logs tab for extractor errors — common causes: region restrictions, private content, or temporary changes to the source site.
- If you see parsing errors, try toggling proxy or updating cookies.

***

### 🔒 Permissions & Storage Notes

- The Actor writes to the default Dataset and `ALL_RESULTS` key in Key-Value store.
- Do not store credentials in public Datasets. Use Apify Secret Manager for sensitive data.
- This Actor is designed to respect privacy and collect only publicly accessible metadata unless you provide valid cookies.

***

### 🔟 Changelog / Versioning

- **v1.0.0** — Production-ready release: reliable extraction, multi-format durations, Console-friendly inputs.
- Future minor releases will focus on extractor resilience and proxy handling improvements.

***

### 🖌 Notes / TODOs

- TODO: Add explicit example of `cookiesFile` creation and upload instructions (reason: varies by user/browser).
- TODO: Consider adding native retry/backoff settings in Input schema for large-scale runs.

***

### 🌍 Proxy Configuration

Using proxies improves reliability when scraping public platforms:

- **Apify Proxy (recommended)** — enable `useApifyProxy` in the Input Proxy object in Console.
- **Custom proxies** — supply credentials in secret form: `<PROXY_USER:PASS@HOST:PORT>`.

**Environment examples**

```bash
## example environment variables (place these in your secret manager, not in plain input)
HTTP_PROXY="http://<PROXY_USER:PASS@HOST:PORT>"
HTTPS_PROXY="http://<PROXY_USER:PASS@HOST:PORT>"
```

**Security note:** Store proxy credentials as secrets, not plaintext. Do not hard-code credentials into Input.

**TODO:** Consider proxy rotation for large-scale scraping to minimize IP throttling.

***

### 📚 References

- Apify Actor best practices — official Console documentation. (Reference link placeholder)
- Apify Input / Output schema guide — reference doc (placeholder)
- Apify CLI & API quickstart — reference doc (placeholder)

***

### 🤔 What I inferred from `main.py`

- This Actor accepts a list of Facebook video/post URLs and extracts metadata and direct media URLs.
- Results are written to Dataset and a key-value store for easy download.
- Multiple duration formats are provided: human-readable, compact summary, decimals (minutes/hours) and raw seconds.
- Optional cookies and proxy support are inferred to handle private or geo-restricted content.

***

*Run this Actor on Apify Console — get instant, structured video metadata in seconds.*

# Actor input Schema

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

List of one or more Facebook video URLs

## `proxyConfiguration` (type: `object`):

Use Apify Proxy or your own HTTP proxies

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/share/v/1AFPhREWwh/"
    },
    {
      "url": "https://www.facebook.com/share/v/1D371fDF1y/"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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": [
        {
            "url": "https://www.facebook.com/share/v/1AFPhREWwh/"
        },
        {
            "url": "https://www.facebook.com/share/v/1D371fDF1y/"
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("neuro-scraper/facebook-video-scraper-ultra").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": [
        { "url": "https://www.facebook.com/share/v/1AFPhREWwh/" },
        { "url": "https://www.facebook.com/share/v/1D371fDF1y/" },
    ],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("neuro-scraper/facebook-video-scraper-ultra").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    {
      "url": "https://www.facebook.com/share/v/1AFPhREWwh/"
    },
    {
      "url": "https://www.facebook.com/share/v/1D371fDF1y/"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call neuro-scraper/facebook-video-scraper-ultra --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=neuro-scraper/facebook-video-scraper-ultra",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Facebook Video Scraper Ultra",
        "description": "🔍 Explore Facebook videos like a pro! Get duration ⏱ and uploader details instantly. Privacy-safe, high-speed, and designed for developers to discover patterns, insights, and trends effortlessly😱",
        "version": "0.0",
        "x-build-id": "2hyjuYU7cSBJSsOYs"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/neuro-scraper~facebook-video-scraper-ultra/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-neuro-scraper-facebook-video-scraper-ultra",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/neuro-scraper~facebook-video-scraper-ultra/runs": {
            "post": {
                "operationId": "runs-sync-neuro-scraper-facebook-video-scraper-ultra",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/neuro-scraper~facebook-video-scraper-ultra/run-sync": {
            "post": {
                "operationId": "run-sync-neuro-scraper-facebook-video-scraper-ultra",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "startUrls"
                ],
                "properties": {
                    "startUrls": {
                        "title": "Start URLs",
                        "type": "array",
                        "description": "List of one or more Facebook video URLs",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Use Apify Proxy or your own HTTP proxies",
                        "default": {}
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
