# Instagram, Facebook & Threads Post Metrics (`sz022/social-post-metrics`) Actor

Give it a mixed list of Instagram, Facebook and Threads post URLs and get one normalized table of likes, comments, shares, views and follower counts.

- **URL**: https://apify.com/sz022/social-post-metrics.md
- **Developed by:** [CHEN-SHU-CHEN](https://apify.com/sz022) (community)
- **Categories:** Social media
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 post metrics extracteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Instagram, Facebook & Threads Post Metrics

You ran a campaign across Instagram, Facebook and Threads. Now you need one report, and the tools you would normally reach for cover one platform each.

Paste the post URLs, all three mixed together, and get back a single table with the same columns for every row.

Built for checking posts you already know about: campaign reporting, influencer delivery checks, monthly performance decks. If instead you need to *find* posts by hashtag, keyword or account, use a platform-specific scraper; this one takes URLs and nothing else.

### Why one Actor instead of three

Running a separate scraper per platform leaves you joining three tables with three different column names before you can add anything up. This returns `likeCount`, `replyCount`, `shareCount` and `viewCount` under the same names whether the URL was Instagram, Facebook or Threads.

Two more things matter once you start computing on the numbers:

**Unknown is `null`, never `0`.** A post whose author hid its like count reports `likeCount: null`. Instagram's own embed returns `0` for those posts and its post page returns a different number again — both are fabrications. Summing a fabricated `0` silently understates your total, so this Actor refuses to emit one.

**Failed URLs still appear.** A deleted post comes back as a row with `status: "not_found"` and null metrics, not as a row that quietly vanishes. 100 URLs in, 100 rows out. A missing row is invisible; a marked row is something you can account for.

### Input

| Field | Description |
|---|---|
| `postUrls` | Post URLs. Platforms can be mixed freely in one run. |
| `fetchFollowers` | Look up each author's follower count. Costs one extra request per account. |
| `abortAfterConsecutiveFailures` | Stops the run when a platform stops responding, so a broken run cannot burn through a long list. Deleted posts do not count toward this. |
| `proxyConfiguration` | For Instagram and Threads. Datacenter proxies are enough. |
| `facebookProxyConfiguration` | For Facebook only, which needs residential proxies — see below. |

Accepted URL shapes:

- Instagram — `/p/{code}/`, `/reel/{code}/`
- Threads — `threads.com/@user/post/{code}` and `threads.net` equivalents
- Facebook — `{pageId}_{postId}`, `permalink.php`, `/posts/pfbid…`, `/reel/{id}`, `/videos/{id}`, `/photo/?fbid=`

### Output

One row per input URL:

| Field | Notes |
|---|---|
| `status` | `success`, `not_found`, `login_required`, `parse_failed`, `unsupported_url` |
| `platform` | Instagram, Facebook or Threads |
| `postUrl`, `username`, `authorUrl` | |
| `mediaType` | `image`, `video`, `carousel`, `text` |
| `likeCount` | Reactions on Facebook |
| `replyCount` | Comments |
| `shareCount` | Facebook shares; reposts plus quotes on Threads. Instagram does not expose shares. |
| `repostCount`, `quoteCount` | Threads only, kept separate as well |
| `viewCount` | Video and reel plays. Image and carousel posts have none. |
| `followerCount` | Exact on Facebook and Threads. Exact on Instagram carousels and reels; single-image posts fall back to the displayed figure, which is rounded above ~10K |
| `createdAt` | ISO 8601, UTC |
| `text`, `hashtags`, `mentions` | Hashtags and mentions are parsed from the caption |

### Facebook needs residential proxies

Facebook serves a login wall to datacenter IP ranges. Measured on this platform: 0 of 4 posts readable through datacenter proxies, 3 of 4 through residential, where the fourth was a page that really had been removed.

Instagram and Threads have no such restriction, which is why they get their own proxy setting. Leaving them on datacenter keeps a mixed run cheap — paying residential rates for all three platforms would cost roughly forty times more for the two that do not need it.

### What it cannot return

- **Reach and impressions.** Visible only to a page's own administrators. No public scraper can produce these; anything claiming otherwise is estimating.
- **Private accounts**, and posts behind a login.
- **Comment text**, follower lists, hashtag search, account crawling. This Actor reads posts you name; it does not discover them.
- **Paid-partnership labels.** The field exists in Meta's data but is empty for logged-out requests.

### Limits worth knowing

- Instagram single-image posts are the one place a follower count comes from displayed text rather than data, so it is rounded above ~10K. Facebook and Threads are exact.
- Some news accounts gate their Threads profile behind a login; those rows return `login_required` rather than a guess.
- Extraction depends on undocumented internal JSON, which Meta can change without notice. Failures are reported per URL rather than crashing the run.

# Actor input Schema

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

Public post URLs. Instagram, Facebook and Threads can be mixed freely in one run. Facebook accepts the {pageId}\_{postId}, permalink.php, /posts/pfbid..., /reel/ and /videos/ forms.

## `fetchFollowers` (type: `boolean`):

Look up the author's follower count. This costs one extra request per account, so turn it off if you only need post metrics.

## `abortAfterConsecutiveFailures` (type: `integer`):

Ends the run early when a platform stops responding, so a broken run cannot burn through your whole list. Set to 0 to never stop early.

## `debugSaveHtml` (type: `boolean`):

Store the raw response of failed URLs in the key-value store. For diagnosing why a proxy or platform change broke extraction.

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

Datacenter proxies are enough for these two platforms and cost a fraction of residential.

## `facebookProxyConfiguration` (type: `object`):

Facebook serves a login wall to datacenter IPs, so it needs residential proxies. This only applies to Facebook URLs, so Instagram and Threads in the same run stay on the cheap proxy.

## Actor input object example

```json
{
  "postUrls": [
    "https://www.instagram.com/p/DcMXl1IPNtB/",
    "https://www.threads.com/@zuck/post/Db2wI-DilLt",
    "https://www.facebook.com/NASA/posts/2081961582409340"
  ],
  "fetchFollowers": true,
  "abortAfterConsecutiveFailures": 5,
  "debugSaveHtml": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "facebookProxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `metrics` (type: `string`):

Engagement metrics per post: likes, comments, shares, views and follower counts, plus media type, hashtags and mentions. Unknown values are null, never 0.

## `failedUrls` (type: `string`):

The subset of input URLs that returned no metrics, with the reason for each. Also present in the dataset itself.

# 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 = {
    "postUrls": [
        "https://www.instagram.com/p/DcMXl1IPNtB/",
        "https://www.threads.com/@zuck/post/Db2wI-DilLt",
        "https://www.facebook.com/NASA/posts/2081961582409340"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("sz022/social-post-metrics").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 = { "postUrls": [
        "https://www.instagram.com/p/DcMXl1IPNtB/",
        "https://www.threads.com/@zuck/post/Db2wI-DilLt",
        "https://www.facebook.com/NASA/posts/2081961582409340",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("sz022/social-post-metrics").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 '{
  "postUrls": [
    "https://www.instagram.com/p/DcMXl1IPNtB/",
    "https://www.threads.com/@zuck/post/Db2wI-DilLt",
    "https://www.facebook.com/NASA/posts/2081961582409340"
  ]
}' |
apify call sz022/social-post-metrics --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,sz022/social-post-metrics"
        }
    }
}

```

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/9zPsH6gSsbbPtb3qy/builds/cyoGvo8byfKfkw5pn/openapi.json
