# Social Media Analytics API - Posts, Metrics, Listening, Emplifi (`nabeelbaghoor/social-media-analytics-api`) Actor

Export social media analytics from your own Emplifi account: posts with engagement and insights for Facebook, Instagram, TikTok, LinkedIn, YouTube, X, Pinterest and Snapchat, daily profile metrics, Listening mentions, Community inbox and Care cases. Read only. Bring your own API token.

- **URL**: https://apify.com/nabeelbaghoor/social-media-analytics-api.md
- **Developed by:** [Nabeel Hassan](https://apify.com/nabeelbaghoor) (community)
- **Categories:** Social media, Marketing, Developer tools
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $8.00 / 1,000 post or message returneds

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

## Social Media Analytics API - Posts, Metrics, Listening, Emplifi

Export the social media analytics your Emplifi account already collects (posts with engagement and insights, daily profile metrics, Listening mentions, the Community inbox and Care cases) into a dataset, a spreadsheet or a warehouse, one row per post, mention, message or metric value. Uses your own Emplifi API credentials, never changes anything in your account, and charges only for rows that carry data.

### What it collects

- **Posts and videos** for Facebook, Instagram, YouTube, X (Twitter), LinkedIn, Pinterest, TikTok and Snapchat profiles in your account: ID, publish time, URL, author, text, content and media type, interactions, reactions, likes, comments, shares, sentiment and content labels, plus any insights field (reach, impressions, media views, video views, saves, clicks, view time) for profiles with insights connected. Lifetime post metrics, sorted and filtered the way the API documents.
- **Daily profile metrics**: followers, fans, subscribers and their change, reach, impressions, media views, profile views, engagements, per day, week or month, split by profile, profile label, country, gender and age, post attribution and the other documented dimensions.
- **Aggregated post metrics** across profiles and networks: interactions, engagement rate, page posts, shares, comments, sentiment, response rates and times, video and story metrics, split by profile, platform, date, content type, media type or label.
- **Listening**: mentions matched by your Listening queries across Facebook, Instagram, X, YouTube, blogs, forums and news, with author, site, language, country, sentiment, interactions and potential impressions; and Listening metrics (mentions, authors, interactions, comments, shares, potential impressions) by platform, country, language, sentiment, topic, hashtag, keyword, person, organization and more.
- **Community**: comments, direct messages, mentions, reviews and wall posts from the Community inbox with author, message, sentiment, labels and first response; and Community metrics (content and message counts, median response times, Salesforce escalations).
- **Care**: Care cases with status, priority, sentiment, platform, languages, assignees and custom fields, and the messages of any case.
- **Account setup**: connected profiles (with insights and Community status), content labels and label groups, profile labels, Listening queries and ad accounts.
- Read only, pay per result, bring your own API token.

### Input

| Field | What it does |
| --- | --- |
| What to read | Connected profiles (default), posts, profile metrics, aggregated post metrics, Listening mentions or metrics, Community content or metrics, Care cases or case messages, Listening queries, content labels, label groups, profile labels or ad accounts. |
| Network | Facebook, Instagram, X, YouTube, LinkedIn, Pinterest, TikTok, Snapchat, WhatsApp or Google Business, for the profiles, posts and profile metrics modes. |
| Profile IDs | Up to 100, as the connected profiles mode lists them. Use `instagram:1784...` to mix networks in aggregated metrics, Community and Care. |
| Listening query IDs | For Listening modes, or Community instead of profiles. |
| Start date / End date | `YYYY-MM-DD`; Community, Care and Listening metrics also take `YYYY-MM-DDTHH:MM:SS`. |
| Profile metrics / Aggregated metric / Community metric / Listening metric | The metric names from the provider's tables. |
| Dimensions, Buckets per dimension | How to split metric values, such as `profile` and `date.day`. |
| Fields | The post, mention, message or case fields to return; empty means a basic set. |
| Sort by / Sort order | Any field the endpoint allows for sorting, such as `interactions` or `insights_reach`. |
| Content label IDs, Profile label IDs, Content types, Media types, Origin, Post attribution, Post grades, Community types, Platforms, Sentiment, Languages, Countries | The documented filters, applied only where the endpoint supports them. |
| Advanced filter | Raw `match_all` / `match_any` clauses as the provider documents them. |
| Care case IDs / Care case ID / Include internal notes | Care modes. |
| Maximum results | Row cap for the run. |
| Requests per minute | Pacing. |
| API token / API secret | Your own Emplifi credentials, as secret inputs. |

Run the connected profiles mode first, then posts or profile metrics with the profile IDs it lists.

#### Credentials

Emplifi documents two ways in, and this actor takes both:

- **Token and secret** (Basic authorization): put the token in API token and the secret in API secret, or paste `token:secret` into API token alone. Emplifi support issues the pair for a user of your Emplifi suite account.
- **OAuth 2.0 access token**: paste the access token from your Emplifi custom integration into API token and leave the secret empty. It is sent as a Bearer token; access tokens last 30 days.

The `DATA_API_KEY` and `DATA_API_SECRET` environment secrets work instead of the inputs.

### Limits on the Emplifi side

- API access is an add-on for Emplifi clients; your plan decides which modules (Listening, Community, Care, Ads) and how much history you can read.
- 1000 requests an hour per account and 500 per user, shared with your other integrations. Each content page holds up to 100 records, so 1000 posts take about 10 requests.
- Each metrics request: at most 100 profiles, 25 metrics and 12 months.
- Community data is kept for 90 days, Care messages for 24 months. Reddit is not available in Community or Care.
- Metrics starting with `insights_`, and all LinkedIn, Pinterest, TikTok and Snapchat metrics, need profiles with insights enabled (the connected profiles mode shows `insightsEnabled`).
- X (Twitter) posts return only the post ID, author ID and labels, under X's developer policy.

### FAQ

#### What is a social media analytics API used for?

Moving the numbers out of the Emplifi dashboard into your own tools. A social team exports every post of the last quarter with reach, interactions and labels into a spreadsheet to find the formats that work. An agency pulls daily follower growth for all client profiles into a BI dashboard. A brand feeds Listening mentions with sentiment into a warehouse to join with sales data. A support lead tracks Community response times and Care case volumes per week.

#### Which data source does this actor read?

The Emplifi API v3 at api.emplifi.io (Emplifi was formerly Socialbakers), through the read routes documented at https://api.emplifi.io/: connected profiles, labels, Listening queries and ad accounts; profile metrics; posts for eight networks; aggregated post metrics; Community content and metrics; Listening content and metrics; and Care cases and messages. The documentation and its changelog (v3.75, 2026-09-21) were checked on 2026-10-03, and the host was probed live the same day.

#### Do I need an Emplifi API token?

Yes. This actor is bring-your-own-credentials and never ships any. Emplifi gives API access to its clients on request: ask Emplifi support (support@emplifi.io) or your account team for a token and secret for your user, or create a custom integration in Emplifi settings for OAuth 2.0. Missing, wrong or expired credentials, and a module your user cannot access, each end the run cleanly with a message saying which it was.

#### Can it read competitor profiles?

It reads every profile your Emplifi account can see. Basic metrics and posts (followers, fans, interactions, reactions, comments, shares) are public data, so profiles you track in Emplifi without owning them work; insights metrics such as reach and impressions exist only for profiles connected with insights. A profile that is not in your account is refused with "Profiles not allowed for user", and the run ends cleanly.

#### How do I get daily follower growth for several profiles?

Choose profile metrics, pick the network, add the profile IDs, set the metrics to `fans_change` and `fans_lifetime` (Facebook) or `followers_change` and `followers_lifetime` (Instagram, X, LinkedIn, Pinterest), and keep the default dimensions `profile` and `date.day`. Each row is one profile, one day and one metric, with the number in `value`.

#### How many posts can one run export?

Up to 100,000 rows per run. The API pages 100 posts at a time with a cursor, so a run reads until the date range is exhausted or the row cap is reached. With the hourly limit of 500 requests per user, that is about 50,000 posts an hour.

#### Can this actor change anything in my Emplifi account?

No. The GET routes only list; the POST routes are the read queries Emplifi defines for metrics and content. The routes that create, edit, archive, restore or delete collections and assets, and the one that labels Community content, are not used. Credentials go only in the Authorization header and are stripped from any log or error text.

#### How is it priced?

Pay per result: one price per post, mention, message or case, and a lower price per metric value and per account record (profile, label, query, ad account). Requests that find nothing, and metric cells with no value, are free. Your Emplifi subscription applies separately.

### Example output

```json
{
  "mode": "posts",
  "modeLabel": "Posts",
  "recordType": "post",
  "network": "facebook",
  "found": true,
  "id": "164929129743_10155892118379744",
  "name": "Example Brand",
  "date": "2026-09-25T16:06:00+00:00",
  "platform": "facebook",
  "profileId": "164929129743",
  "author": "Example Brand",
  "url": "https://www.facebook.com/164929129743/posts/10155892118379744",
  "message": "Our autumn collection is here.",
  "contentType": "post",
  "mediaType": "photo",
  "sentiment": "positive",
  "interactions": 1840,
  "comments": 96,
  "shares": 41,
  "created_time": "2026-09-25T16:06:00+00:00",
  "content": "Our autumn collection is here.",
  "content_type": "post",
  "media_type": "photo",
  "reactions": 1703,
  "post_labels": [{ "id": "5d879004a44a4cbcb13e", "name": "Campaign: Autumn" }],
  "metric": null,
  "dimension1": null,
  "dimension2": null,
  "dimension3": null,
  "value": null,
  "retrievedAt": "2026-10-03T09:14:52.118Z",
  "note": null
}
```

Values are illustrative; every field is one the provider documents. Metric rows carry `metric`, `value`, `date`, `profileId`, and `dimension1` to `dimension3` as `type=value` (for example `profile=facebook:164929129743` and `date.day=2026-09-25`), plus a `dimensions` object.

### Keyword map

social media analytics API, social media reporting API, Instagram analytics export, Facebook page insights export, TikTok analytics API, LinkedIn page analytics, YouTube channel analytics, post engagement data, follower growth data, social listening API, brand mentions export, community management data, customer care case export, competitor social benchmarking, Emplifi API, Emplifi export, Socialbakers API.

# Actor input Schema

## `mode` (type: `string`):

Connected profiles lists the profiles of one network in your Emplifi account and needs nothing else, so it is the default; run it first to get profile IDs. Content labels, label groups, profile labels and Listening queries list account setup. Profile metrics, posts and aggregated post metrics read profiles. Community content and metrics read profiles or Listening queries. Listening mentions and metrics read Listening queries. Care cases read the Care inbox; Care case messages read one case.

## `network` (type: `string`):

Connected profiles, posts and profile metrics: the social network to read. Also the default network for profile IDs written without a prefix in the cross-network modes. Profile metrics exist for Facebook, Instagram, X, YouTube, LinkedIn, Pinterest and TikTok; posts also for Snapchat; WhatsApp and Google Business appear in the profiles list and in Community.

## `profileIds` (type: `array`):

Profiles to read, as the connected profiles mode lists them (up to 100 per run). Write platform:id, such as instagram:17841400000000000, to mix networks in aggregated metrics, Community or Care; a bare ID uses the network above. LinkedIn IDs look like urn:li:organization:2056516.

## `listeningQueryIds` (type: `array`):

Listening mentions and metrics, or Community instead of profiles: query IDs as the Listening queries mode lists them.

## `dateStart` (type: `string`):

YYYY-MM-DD (Community, Care and Listening metrics also take YYYY-MM-DDTHH:MM:SS). Defaults to 30 days back for metrics, posts and ad accounts, 7 days back for mentions, Community and Care. Metrics requests cover at most 12 months; Community keeps 90 days; older history depends on your Emplifi plan.

## `dateEnd` (type: `string`):

YYYY-MM-DD, included. Defaults to today (UTC).

## `metrics` (type: `array`):

Profile metrics mode: up to 25 metric names from the provider tables for the chosen network, such as fans_lifetime, fans_change, insights_reach or insights_media_views (Facebook), followers_lifetime or insights_reach (Instagram), subscribers_lifetime or views_change (YouTube), insights_fans_lifetime (TikTok). Metrics starting with insights\_ need profiles with insights enabled. Defaults to the network follower count.

## `aggregatedMetric` (type: `string`):

Aggregated post metrics mode: one metric summed or averaged over the posts published in the date range.

## `communityMetric` (type: `string`):

Community metrics mode.

## `listeningMetric` (type: `string`):

Listening metrics mode.

## `dimensions` (type: `array`):

Metrics modes: how to split the values. Profile metrics: date.day, date.week, date.month, profile, profile_label and per network ones such as gender_age, country or post_attribution (default profile and date.day). Aggregated: up to 2 of date.day, date.week, date.month, date.quarter, date.year, platform, profile, post_labels, profile_label, content_type, media_type, published_status, sentiment_type, interaction_type, response_time, sentiment (default profile). Community: community_type, date, post_label, profile, profile_label, resolve_status, sentiment, response_date, user_actions_created_time, with date types written as date.day, date.week and so on (default profile and date.day). Listening: content_type, country, hashtag, keyword, language, listening_query, location, media_type, organization, person, platform, post_label, profession, sentiment, topic, url (default listening_query).

## `dimensionLimit` (type: `integer`):

Community and Listening metrics: keep only the top N values of each non-date dimension (the provider default is 10).

## `fields` (type: `array`):

Posts, Community, Listening and Care modes: the fields to return. Leave empty for a basic set (ID, date, URL, author, text, type, interactions, comments and labels). Insights fields such as insights_reach, insights_impressions or insights_video_views need profiles with insights enabled.

## `sortField` (type: `string`):

Posts, Community, Listening mentions and Care cases: a field the provider allows for sorting on that endpoint, such as created_time (the default), interactions, comments, reactions, likes, shares, video_views or insights_reach. X posts take no sort; Listening mentions sort by interactions, comments, shares or potential_impressions.

## `sortOrder` (type: `string`):

Descending or ascending.

## `postLabelIds` (type: `array`):

Keep only posts or messages with these content labels, as the content labels mode lists them.

## `profileLabelIds` (type: `array`):

Aggregated and Community metrics: keep only profiles with these profile labels.

## `contentTypes` (type: `array`):

Facebook, Instagram and Pinterest posts, aggregated metrics, Community content and Listening: keep only these content types.

## `mediaTypes` (type: `array`):

Facebook, Instagram, YouTube and LinkedIn posts, aggregated metrics and Listening: keep only these media types.

## `origin` (type: `array`):

Facebook, Instagram and X posts and Community: brand content or user-generated content.

## `postAttribution` (type: `array`):

Facebook and Instagram posts: organic or paid.

## `grades` (type: `array`):

Facebook and Instagram posts: keep only these grade scores.

## `communityTypes` (type: `array`):

Community content and metrics: comments, direct messages, mentions, reviews and the other documented types.

## `platformsFilter` (type: `array`):

Aggregated metrics and Listening: keep only these platforms (Listening also has blogs, forums and news). Care cases: the case platforms.

## `sentiments` (type: `array`):

Listening mentions and metrics: keep only this sentiment.

## `languages` (type: `array`):

Listening: ISO 639-1 language codes such as en or de.

## `countries` (type: `array`):

Listening: ISO 3166-1 alpha-2 country codes such as GB or FR.

## `filter` (type: `array`):

Extra filter clauses exactly as the provider documents under Advanced Post Filters, added to the ones above, such as \[{"match_any": \[{"field": "post_labels", "value": \["fa14dde7e4f041e3a646"]}]}].

## `caseIds` (type: `array`):

Care cases mode: read only these cases.

## `careCaseId` (type: `string`):

Care case messages mode: the case to read, as the Care cases mode lists it (for example CCC_123456_8GWYLU3OSK2d7rxwHg_3879).

## `includeInternalNotes` (type: `boolean`):

Care case messages mode: include the internal notes of the case.

## `maxResults` (type: `integer`):

The most rows this run returns and charges for. Content endpoints page up to 100 records at a time.

## `requestsPerMinute` (type: `integer`):

Pacing. The provider allows 500 requests an hour per user and 1000 per account, shared with your other integrations.

## `apiKey` (type: `string`):

Your own Emplifi API token, issued for your Emplifi user by Emplifi support. You can also paste token:secret here, or an OAuth 2.0 access token from your Emplifi custom integration (then leave the secret empty). Stored as a secret. You can instead set the DATA_API_KEY environment secret.

## `apiSecret` (type: `string`):

The secret that goes with the API token (Basic authorization uses both). Leave empty when the token field holds token:secret or an OAuth 2.0 access token. Stored as a secret. You can instead set the DATA_API_SECRET environment secret.

## Actor input object example

```json
{
  "mode": "profiles",
  "network": "facebook",
  "aggregatedMetric": "interactions",
  "communityMetric": "content_count",
  "listeningMetric": "content_count",
  "sortOrder": "desc",
  "includeInternalNotes": false,
  "maxResults": 100,
  "requestsPerMinute": 10
}
```

# Actor output Schema

## `records` (type: `string`):

One row per post, mention, message, case, metric value, profile, label, query or ad account.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("nabeelbaghoor/social-media-analytics-api").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("nabeelbaghoor/social-media-analytics-api").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 '{}' |
apify call nabeelbaghoor/social-media-analytics-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nabeelbaghoor/social-media-analytics-api"
        }
    }
}
```

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/AMUC4zuP9UdE8Mtdc/builds/uhAZvSuFQeBWTmh1N/openapi.json
