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

Get likes, comments, shares, views and followers from Instagram, TikTok, Facebook, Threads and YouTube post URLs in one table, with the same columns for every platform. Hidden counts are null, never a made-up zero. Export to CSV, Excel or JSON, or use the API.

- **URL**: https://apify.com/sz022/social-post-metrics.md
- **Developed by:** [CHEN-SHU-CHEN](https://apify.com/sz022) (community)
- **Categories:** Social media
- **Features:** Limited permissions
- **Stats:** 25 total users, 9 monthly users, 99.7% 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?

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

You ran a campaign across **Instagram, Facebook, Threads, TikTok and YouTube**. Now you need one report.

Paste the post URLs, all platforms mixed together, and get back one table of **likes, comments, shares, views and follower counts**, with the same columns for every row. Export it as CSV, Excel or JSON, call it through the Apify API, or put it on a schedule.

This Actor reads posts you already have links to: campaign reports, influencer delivery checks, monthly performance decks. To *find* posts by hashtag, keyword or account, use a platform-specific scraper.

### Why use one Actor for every platform

- **The same columns everywhere.** `likeCount`, `replyCount`, `shareCount` and `viewCount` mean the same thing on every platform, so you can add them up straight away.
- **Unknown is `null`, never `0`.** If an author hid their like count, you get `null`, not a made-up zero that would quietly lower your totals.
- **Every URL gets a row.** 100 URLs in, 100 rows out. A post that could not be read is still listed, with a `status` saying why.

### How to get post metrics

1. In the **Input** tab, paste your post URLs into **Post URLs**, one per line, in any order.
2. Leave the proxy settings as they are.
3. Click **Start**. Each URL usually takes a few seconds.
4. Open the **Output** tab and export the table, or read the dataset through the API.
5. To refresh the numbers every week, save the input as a task and add it to a schedule.

### How much does it cost?

You pay per post.

| Event | Price | Per 1,000 |
|---|---|---|
| Instagram, Threads or YouTube post read | $0.003 | $3 |
| Facebook post read | $0.006 | $6 |
| TikTok post read | $0.005 | $5 |
| Post that could not be read (deleted, private, behind a login, or failed to load) | $0.0005 | $0.50 |
| Run start, per GB of memory | $0.001 | — |

Runs use 4 GB of memory by default, so starting a run costs $0.004. You can choose 1 GB instead: it costs $0.001 to start and runs at about half the speed.

Not charged: links that are not from a supported platform, and URLs the run never reached.

Facebook and TikTok cost more because they need residential proxies, which cost more to run.

To cap what a run can spend, set a maximum cost per run in the run options. The run stops when the next post would go over it, and the URLs it did not reach are listed as `not_processed`.

### Input

| Field | Description |
|---|---|
| `postUrls` | Post URLs. Platforms can be mixed in one run. |
| `fetchFollowers` | Also look up each author's follower count. |
| `abortAfterConsecutiveFailures` | Stop the run if this many posts in a row cannot be read, so a platform that is blocking requests does not use up your budget. Deleted posts do not count. |
| `proxyConfiguration` | Proxy for Instagram, Threads and YouTube. The default works. |
| `facebookProxyConfiguration` | Proxy for Facebook. Keep it on residential. |
| `tiktokProxyConfiguration` | Proxy for TikTok. Keep it on residential. |

Supported links:

- **Instagram:** posts and reels, with or without the account name in the link
- **Threads:** post links and `threads.com/t/` short links
- **Facebook:** posts, reels, videos and photos from Pages and profiles
- **TikTok:** videos, photo posts and share links (`vm.tiktok.com`, `vt.tiktok.com`)
- **YouTube:** videos, Shorts, live streams and `youtu.be` links

Example input:

```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
}
```

### Output

One row per URL:

| Field | Notes |
|---|---|
| `status` | `success`, or the reason the post could not be read (see below) |
| `platform` | Instagram, Facebook, Threads, TikTok or YouTube |
| `postUrl`, `username`, `authorUrl` | |
| `mediaType` | `image`, `video`, `carousel` or `text`. On YouTube: `short`, `live` or `video` |
| `likeCount` | Reactions on Facebook |
| `replyCount` | Comments |
| `shareCount` | Shares on Facebook and TikTok; reposts plus quotes on Threads. Instagram and YouTube do not show shares |
| `repostCount`, `quoteCount` | Threads only |
| `viewCount` | Plays on videos and reels, views on Threads posts and YouTube videos. Image posts on Instagram and Facebook have none |
| `followerCount` | The author's followers, or subscribers on YouTube |
| `createdAt` | When the post was published (UTC) |
| `text`, `hashtags`, `mentions` | The caption, and the hashtags and mentions in it. On YouTube, the title and description |
| `saveCount` | TikTok only: saves |
| `durationSeconds` | TikTok and YouTube only: video length |

Example row:

```json
{
  "platform": "Threads",
  "status": "success",
  "postUrl": "https://www.threads.com/@zuck/post/Db2wI-DilLt",
  "username": "zuck",
  "authorUrl": "https://www.threads.com/@zuck",
  "mediaType": "text",
  "text": "Today we're also opening the weights for Muse Glimmer…",
  "hashtags": [],
  "mentions": ["alexanddeer"],
  "createdAt": "2026-08-10T10:01:59.000Z",
  "likeCount": 1971,
  "replyCount": 477,
  "shareCount": 133,
  "repostCount": 88,
  "quoteCount": 45,
  "viewCount": 323526,
  "followerCount": 5752077
}
```

What each status means:

- `not_found`: the post was deleted, or the link points to a post that does not exist.
- `login_required`: the platform showed a login page instead of the post.
- `post_not_loaded`: the platform did not return the post this time. It may still exist, so try again later.
- `parse_failed`: the page loaded, but the post could not be read from it.
- `unsupported_url`: not a link to a post on a supported platform.
- `not_processed`: the run stopped before reaching this URL.

The URLs that could not be read are also listed, with the reason, under `FAILED_URLS` in the run's key-value store.

### Rounded numbers on TikTok and YouTube

Some counts are published only in rounded form, and this Actor returns them as the platform shows them:

- **TikTok:** plays, likes, comments and shares are exact below 10,000 and rounded above that (`31.2M` comes back as `31200000`). Saves are always exact.
- **YouTube:** views and likes are exact. Comments are rounded above one million. Subscriber counts are rounded to three significant figures for everyone except the channel owner.

### What it cannot return

- **Reach and impressions.** Only the account's own admins can see them.
- **Private accounts**, and posts that need a login to view.
- **Comment text**, follower lists, or posts found by hashtag or account. This Actor reads the posts you give it.

### Other Actors for social media reporting

| Actor | Use it when |
|---|---|
| [Instagram, Facebook & Threads Post Metrics Tracker](https://apify.com/sz022/social-post-metrics-tracker) | You want the same posts re-read on a schedule, with the change since the last run and since the first. |
| [Instagram Engagement Rate Calculator & Audit](https://apify.com/sz022/instagram-threads-influencer-audit) | You are choosing creators and want followers, median engagement and posting frequency per account. |

### FAQ

#### Why is a number `null` instead of `0`?

Because the platform did not show it. A hidden like count, or views on an image post, is unknown, not zero.

#### Why did a Facebook post come back as `login_required`?

Facebook showed a login page instead of the post. Check that **Proxy for Facebook** is set to residential. If it is, the post may only be visible to logged-in users.

#### Why is `followerCount` empty on some Threads rows?

Some accounts, many news outlets among them, show their Threads profile only to logged-in users. The post is still read, but its follower count is `null`.

#### Is the follower count exact?

On Threads, yes. On Instagram and Facebook it is usually exact. When the page shows only a rounded figure such as `2.8M`, that is what you get. On TikTok and YouTube, see the section on rounded numbers above.

#### Something broke or a number looks wrong

Platforms change their pages from time to time. Open an issue in the **Issues** tab with the post URL and the run link, and it will be looked at.

# Actor input Schema

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

Public post URLs. Instagram, Facebook, Threads, TikTok and YouTube can be mixed freely in one run. Facebook accepts the {pageId}\_{postId}, permalink.php, /posts/pfbid..., /reel/ and /videos/ forms. TikTok accepts video and photo links and vm.tiktok.com / vt.tiktok.com share links. YouTube accepts watch, youtu.be, /shorts/ and /live/ links.

## `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 platforms and cost a fraction of residential. YouTube always reads through Apify's datacenter proxy, even if a residential group is chosen here.

## `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.

## `tiktokProxyConfiguration` (type: `object`):

TikTok is strict with datacenter IPs, so this defaults to residential. It only applies to TikTok URLs and is not used at all by a run without one.

## 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"
    ]
  },
  "tiktokProxyConfiguration": {
    "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/GiTzNasMX7oVk9JAr/openapi.json
