# Facebook Shared Links Extractor (`alpha-scraper/facebook-shared-links-extractor`) Actor

\[ 1k/1.49$ ] Facebook Shared Links Extractor scans the latest posts of public Facebook Pages and profiles, or single posts, and extracts every external link shared in preview cards and text. One item per unique link with sharing posts and engagement, plus a domain summary.

- **URL**: https://apify.com/alpha-scraper/facebook-shared-links-extractor.md
- **Developed by:** [Alpha Scraper](https://apify.com/alpha-scraper) (community)
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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?

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 Shared Links Extractor

**Facebook Shared Links Extractor** scans the latest posts of public Facebook Pages and profiles, and single Facebook posts, and extracts every external link they share. Give Facebook Shared Links Extractor a Page username or a post URL, and it finds the links in link preview cards and in the post text, then returns one record per unique link.

Each link record lists the Facebook posts that shared it, how often it was shared and the engagement of those posts. A final summary record groups everything by domain. You do not need a Facebook account, a login or an API key, so you can see which websites a Facebook Page promotes in a few minutes.

> **📌 At a glance**
>
> - **Input:** Facebook Page usernames, Page or profile URLs, and single post, video or reel URLs
> - **Output:** one dataset record per unique link, plus a summary record grouped by domain
> - **Options:** keep Facebook links, and resolve short links to their final destination
> - **Control:** `maxItems` limits the posts scanned per Page, and `maxLinks` limits unique links

Marketers, SEO teams, PR analysts and researchers use Facebook Shared Links Extractor to study which articles, shops and websites Facebook Pages share. Because every link comes back in one JSON structure, the data is easy to export, rank or feed into a dashboard.

### 🔹 Facebook Shared Links Extractor – Key Features

Facebook Shared Links Extractor focuses on the links, not on the posts around them.

- **Two link sources:** links from Facebook preview cards and links typed into the post text.
- **One record per link:** the same link shared in several Facebook posts becomes a single record.
- **Share history:** every record lists the posts that shared the link, with time, type and text.
- **Engagement per link:** reactions, comments, shares and views of each sharing post, plus a combined total.
- **Preview details:** title, description, source and preview image when Facebook shows a link card.
- **Domain summary:** a final record groups links, shares and engagement by website.
- **Short link resolving:** optionally follow short links such as bit.ly style links to the final page.
- **Single posts:** read the shared links of one post, video or reel URL.
- **Facebook links on request:** keep links that point back to Facebook when you want them.

> **✅ Why use this Actor**
>
> Facebook Shared Links Extractor replaces manual link hunting. Facebook Shared Links Extractor reads the feed for you, removes duplicates and ranks the links by how often and how widely Facebook posts shared them.

### 🔍 What Data Does Facebook Shared Links Extractor Extract?

Most dataset items describe one unique link. The last item is a summary. The table groups the link fields by purpose.

| Group | Fields | What you get |
|---|---|---|
| Link | `url`, `normalizedUrl`, `domain`, `linkType` | The link, its cleaned form, its website and where it was found |
| Preview | `title`, `description`, `source`, `previewImage` | Link card details when Facebook shows them |
| Sharing | `timesShared`, `firstSharedAt`, `lastSharedAt`, `pages` | How often, when and by which Pages |
| Posts | `sharedIn` | Each Facebook post that shared the link, with its engagement |
| Engagement | `totalEngagement` | Reactions, comments and shares of all sharing posts |
| Short links | `resolvedUrl`, `resolvedDomain`, `alternateUrls` | Final destination, filled by `resolveShortLinks` |
| Run info | `number`, `recordType`, `scrapedAt` | Position, record type and collection time |

Link records have `recordType` set to `link`. The closing record has `recordType` set to `summary`.

### 🚀 How to Use Facebook Shared Links Extractor

Running Facebook Shared Links Extractor takes a few steps in Apify Console.

- **Step 1 – Open the Actor:** start Facebook Shared Links Extractor from the Apify Store and open the Input tab.
- **Step 2 – Add sources:** type Page usernames such as `natgeo`, or paste Facebook URLs into *Start URLs* or *Post URLs*.
- **Step 3 – Set a scan size:** choose *Max items* to cap the Facebook posts scanned per Page.
- **Step 4 – Pick options:** switch on *Resolve short links* or *Include Facebook links* if you need them.
- **Step 5 – Run:** start Facebook Shared Links Extractor and watch the dataset fill with links.
- **Step 6 – Export:** download JSON, CSV or Excel, or read the results through the Apify API.

> **💡 Tip:** the input is prefilled with the sample username `natgeo`. Clear it if you only want to scan your own Facebook Pages or posts.

### 📥 Facebook Shared Links Extractor Input

Facebook Shared Links Extractor has seven input fields. All are optional, but you need at least one username or URL.

| Field | Type | Description |
|---|---|---|
| `usernames` | array | Facebook Page usernames, vanity names or numeric ids, for example `natgeo`. Combined with `startUrls` and `postUrls`. |
| `startUrls` | array | Page or profile URLs, and/or URLs of single posts, videos and reels. Page URLs have their latest posts scanned, and post URLs are read once. Default: empty. |
| `postUrls` | array | Optional URLs of single posts, videos or reels, handled like the post URLs in `startUrls`. Default: empty. |
| `includeFacebookLinks` | boolean | Also keep links that point to facebook.com, fb.com, fb.me or fb.watch. By default only external links are returned. Default: `false`. |
| `resolveShortLinks` | boolean | Follow redirects and report the final destination in `resolvedUrl`. Links with the same destination are merged. Costs one extra lookup per link. Default: `false`. |
| `maxLinks` | integer | Stop after this many unique links have been found. Minimum 1. Empty means no limit. |
| `maxItems` | integer | Maximum number of posts to scan per Page or profile. Minimum 1, default 30. Single post URLs are always read once. |

Facebook Shared Links Extractor gives every Page its own `maxItems` limit, so three Pages with `maxItems` set to 40 scan up to 120 posts. The `usernames` list is combined with the URL lists, so clear it when you only want your own URLs.

Here is a sample input for Facebook Shared Links Extractor that scans 40 posts of one Page and resolves short links:

```json
{
  "usernames": ["natgeo"],
  "startUrls": [],
  "postUrls": [],
  "includeFacebookLinks": false,
  "resolveShortLinks": true,
  "maxLinks": 100,
  "maxItems": 40
}
```

### 📤 Facebook Shared Links Extractor Output

Facebook Shared Links Extractor writes one record per unique link and then one summary record. Links are sorted by how often they were shared, then by engagement.

```json
{
  "url": "https://news.example.com/travel/hidden-coast",
  "normalizedUrl": "https://news.example.com/travel/hidden-coast",
  "domain": "news.example.com",
  "title": "The hidden coast that few travellers find",
  "description": "A photo essay from the northern shoreline.",
  "source": "news.example.com",
  "previewImage": "https://example.com/preview/hidden-coast.jpg",
  "linkType": "attachment",
  "timesShared": 2,
  "firstSharedAt": "2026-10-21T14:00:00.000Z",
  "lastSharedAt": "2026-10-30T09:30:00.000Z",
  "totalEngagement": 5230,
  "sharedIn": [
    {
      "postId": "1234567890123456",
      "postUrl": "https://www.facebook.com/samplepage/posts/1234567890123456",
      "postTime": "2026-10-30T09:30:00.000Z",
      "page": "Sample Travel Magazine",
      "where": "attachment",
      "postType": "link",
      "postText": "Read the full photo essay on our website.",
      "reactions": 2400,
      "comments": 61,
      "shares": 140,
      "views": null
    }
  ],
  "pages": ["Sample Travel Magazine"],
  "resolvedUrl": null,
  "number": 1,
  "recordType": "link",
  "scrapedAt": "2026-11-06T15:18:04.000Z"
}
```

The summary record closes the dataset:

```json
{
  "recordType": "summary",
  "postsScanned": 40,
  "postsWithExternalLinks": 27,
  "uniqueLinks": 31,
  "uniqueDomains": 4,
  "domains": [
    {
      "domain": "news.example.com",
      "uniqueLinks": 20,
      "timesShared": 24,
      "totalEngagement": 73983,
      "exampleLinks": ["https://news.example.com/travel/hidden-coast", "https://news.example.com/travel/night-sky"]
    }
  ],
  "inputs": { "pages": ["https://www.facebook.com/samplepage"], "posts": [] },
  "scrapedAt": "2026-11-06T15:18:04.000Z"
}
```

#### 🧾 Output field guide

- `url` is the shared link, and `normalizedUrl` is the cleaned form used to merge duplicates.
- `linkType` is `attachment` for a Facebook link card and `text` for a link typed into the post.
- `title`, `description`, `source` and `previewImage` come from the link card, so text links leave them `null`.
- `timesShared`, `firstSharedAt` and `lastSharedAt` describe the sharing history.
- `sharedIn` lists every Facebook post that shared the link, with `reactions`, `comments`, `shares` and `views`.
- `totalEngagement` adds reactions, comments and shares across those posts.
- `resolvedUrl` shows the final page when `resolveShortLinks` is on, and `alternateUrls` lists merged short links.
- The summary record of Facebook Shared Links Extractor reports `postsScanned`, `postsWithExternalLinks`, `uniqueLinks` and `uniqueDomains`.
- `domains` ranks websites by shares and engagement and gives example links.

### 🔗 How to Extract Links Shared by a Facebook Page

To extract links shared by a Facebook Page with Facebook Shared Links Extractor, enter the Page username and choose how many posts to scan. Facebook Shared Links Extractor looks at link cards and at the post text, so a link counts whether or not Facebook shows a preview.

To find the website a Page promotes most with Facebook Shared Links Extractor, open the summary record and read the first entry of `domains`. For a single campaign post, paste its URL into *Post URLs* and the run returns only that post's links.

### 🎯 Facebook Shared Links Extractor Use Cases

Facebook Shared Links Extractor fits many workflows that depend on public Facebook posts.

- **Content curation research:** see which articles and sources a Facebook Page shares most often.
- **Competitor analysis:** compare the websites and landing pages rival Pages promote.
- **Link engagement ranking:** find the shared links whose Facebook posts earn the most reactions.
- **Media monitoring:** track how often news sites are linked by a set of Pages.
- **Campaign checks:** list the destination links of a post, video or reel with Facebook Shared Links Extractor.
- **Short link audits:** resolve short links to see where they really lead.
- **Reporting:** export link and domain data to a spreadsheet or BI tool.

### 💰 Pricing

Facebook Shared Links Extractor runs on the Apify platform. The current pricing is shown on the Actor page in the Apify Store, and your cost depends on the number of posts scanned and the resources used by the run.

> **💡 Cost tip:** start with a small `maxItems` value such as 10 or 20, and set `maxLinks` if you only need the top links. Leave `resolveShortLinks` off in Facebook Shared Links Extractor unless you need final destinations.

### 💡 Tips and Best Practices

- **Start small:** a short test run of Facebook Shared Links Extractor shows the fields before a large scan.
- **Use maxLinks as a stop:** Facebook Shared Links Extractor ends the scan as soon as that many unique links are found.
- **Keep short link resolving for audits:** Facebook Shared Links Extractor does extra work for every link when `resolveShortLinks` is on.
- **Read the summary:** the last record of Facebook Shared Links Extractor shows the top domains at a glance.
- **Clear the sample username:** remove the prefilled `natgeo` if you only want your own sources.
- **Expect fewer links than posts:** many Facebook posts share no external link at all.
- **Check nulls:** Facebook Shared Links Extractor leaves `title` and `description` as `null` for links typed into the post text.
- **Schedule regular runs:** use Apify schedules to track shared links over time.

> **⚠️ Important:** only collect data you are allowed to use. Public Facebook posts can contain personal data, so follow Facebook's terms and the privacy rules that apply to you, such as GDPR. This Actor is not affiliated with or endorsed by Meta.

### ❓ Frequently Asked Questions

#### 🔎 What is Facebook Shared Links Extractor?

Facebook Shared Links Extractor is an Apify Actor that scans public Facebook posts and extracts the external links they share, with the posts, engagement and domains behind each link.

#### 🧭 How do I extract all links from a Facebook Page?

Enter the Page username, set `maxItems` and start the run. Facebook Shared Links Extractor scans the latest posts and returns one record per unique link.

#### 🔐 Does Facebook Shared Links Extractor need a Facebook login?

No. Facebook Shared Links Extractor reads publicly visible content, so no account, cookies or API key are required.

#### 🔗 Can I get links from a single Facebook post or reel?

Yes. Paste the URL into `postUrls` or `startUrls`. Facebook Shared Links Extractor reads that post once and returns its links.

#### 🌐 Can I include links that point to Facebook itself?

Yes. Turn on `includeFacebookLinks` to keep facebook.com, fb.com, fb.me and fb.watch links. They are skipped by default.

#### 🔀 Can Facebook Shared Links Extractor resolve short links?

Yes. Turn on `resolveShortLinks`. The final address appears in `resolvedUrl`, and links that end at the same page are merged.

#### 📦 What data does Facebook Shared Links Extractor return?

Each link record has the URL, domain, preview details, share count, dates, engagement, the sharing posts and the Pages. A summary record groups the results by domain.

#### 🧩 Can I scan several Facebook Pages in one run?

Yes. Add several usernames or URLs, and Facebook Shared Links Extractor scans up to `maxItems` posts per Page and merges the links.

#### 🧐 Why did a Facebook post return no links?

Many posts share no external link, and Facebook Shared Links Extractor skips links to Facebook unless `includeFacebookLinks` is on. A Page with no public posts returns nothing.

#### 📊 Can I export Facebook shared links to CSV or Excel?

Yes. Any Apify dataset can be downloaded as JSON, CSV, Excel, XML or HTML, or read through the Apify API.

#### ⚖️ Is it legal to extract links from Facebook posts?

Facebook Shared Links Extractor collects public Facebook content only. You are responsible for how you use the data, so check Facebook's terms, local laws and privacy rules before you store or share personal information.

### 📞 Support

If you have questions about Facebook Shared Links Extractor, ideas for new fields or find a Facebook Page that does not return the expected links, send the Page name and the input you used.

- Contact me by email: alphascraper69@gmail.com

# Actor input Schema

## `usernames` (type: `array`):

Page usernames, vanity names or numeric ids (for example natgeo). Combined with 'Start URLs' and 'Post URLs': clear this list if you only want to scan those.

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

Page or profile URLs, and/or URLs of single posts, videos and reels. Page URLs have their latest posts scanned; post URLs are read once.

## `postUrls` (type: `array`):

Optional URLs of single posts, videos or reels whose shared links you want. Handled like the post URLs in 'Start URLs'.

## `includeFacebookLinks` (type: `boolean`):

Also keep links that point to facebook.com, fb.com, fb.me or fb.watch. By default only external links are returned.

## `resolveShortLinks` (type: `boolean`):

Follow the redirects of every link (bit.ly style short links) and report the final destination in 'resolvedUrl'. Links that end up at the same destination are merged. Adds one extra request per link.

## `maxLinks` (type: `integer`):

Stop after this many unique links have been found. Leave empty for no limit.

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

Maximum number of posts to scan per Page / profile. Every Page gets its own limit, so N Pages scan up to N x this value. Single post URLs are always read once.

## Actor input object example

```json
{
  "usernames": [
    "natgeo"
  ],
  "startUrls": [
    "https://www.facebook.com/Cristiano/"
  ],
  "postUrls": [],
  "includeFacebookLinks": false,
  "resolveShortLinks": false,
  "maxItems": 15
}
```

# Actor output Schema

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

Structured records extracted by Facebook Shared Links Extractor and stored in the run's default dataset.

# 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 = {
    "usernames": [
        "natgeo"
    ],
    "startUrls": [
        "https://www.facebook.com/Cristiano/"
    ],
    "maxItems": 15
};

// Run the Actor and wait for it to finish
const run = await client.actor("alpha-scraper/facebook-shared-links-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 = {
    "usernames": ["natgeo"],
    "startUrls": ["https://www.facebook.com/Cristiano/"],
    "maxItems": 15,
}

# Run the Actor and wait for it to finish
run = client.actor("alpha-scraper/facebook-shared-links-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 '{
  "usernames": [
    "natgeo"
  ],
  "startUrls": [
    "https://www.facebook.com/Cristiano/"
  ],
  "maxItems": 15
}' |
apify call alpha-scraper/facebook-shared-links-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,alpha-scraper/facebook-shared-links-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/MARfE1d8lsGmt6wkB/builds/sOHC50gMtVJXasXAJ/openapi.json
