# Instagram profile engagement analytics (`easy_scraper/instagram-profile-engagement-analytics`) Actor

Analyze Instagram posts. Measure real engagement. Discover what works.

- **URL**: https://apify.com/easy\_scraper/instagram-profile-engagement-analytics.md
- **Developed by:** [easy scraper](https://apify.com/easy_scraper) (community)
- **Categories:** Social media, Lead generation, Automation
- **Stats:** 7 total users, 4 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.60 / 1,000 posts analyzeds

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/platform/actors/running/actors-in-store#pay-per-event

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

### 🚀 Instagram Profile Engagement Analytics

This Actor helps you benchmark Instagram creators and profiles using simple, repeatable engagement KPIs—without needing Instagram Insights.

It:
- Takes one or more Instagram profile URLs (full link), usernames, or `@username`
- Fetches the follower count using a lightweight HTML request (no heavy browser)
- Loads the most recent N posts (configurable) from the public timeline feed
- Computes engagement performance metrics
- Outputs **one dataset row per profile** with KPIs you can paste into spreadsheets, dashboards, or reporting tools

---

### 🎯 Goal

If you’re selecting creators for outreach, sponsorships, or campaigns, you need more than follower count. You need performance.

This Actor gives you industry-style metrics like:
- Engagement Rate (ER)
- Engagement Velocity (per day)
- Engagement consistency
- Posting frequency
- Content mix (Reels vs Carousel vs Images)
- Caption/hashtag/mentions signals
- Links to the most engaging post

---

### ⭐ Key Features

- Multi-profile input in one run (array of profiles)
- Adjustable sample size: analyze `postsToAnalyze` per profile
- Lightweight follower parsing from profile HTML
- Timeline scraping using public endpoints (GraphQL feed pagination)
- Clear, dataset-ready output (one row per profile)
- PPE-ready charging model (charge per analyzed post event)

---

### ⚙️ Input Parameters

| Parameter | Type | Required | Default | What it does |
|----------|------|----------|---------|---------------|
| `profiles` | array of strings | Yes | — | Instagram profiles to analyze. Accepts full URL, username, or `@username`. |
| `postsToAnalyze` | integer | No | `30` | How many recent timeline posts to load and use for metric calculations per profile. |
| `postTypeFilter` | string | No | `all` | Limit which post types count toward the sample. Options: `all`, `feed`, `clips`, `carousel_container`. |
| `skipPinnedPosts` | boolean | No | `true` | If `true`, pinned posts are excluded from the analyzed sample. |
| `dateFilter` | string | No | (empty) | Only include posts newer than a given date. Examples: `2026-01-01` or `90 days`. |
| `proxyConfiguration` | object | No | residential Apify proxy | Proxy settings for reaching Instagram endpoints reliably. |

#### Examples (what to put in `profiles`)
- `therock`
- `@nasa`
- `https://www.instagram.com/leomessi/`

---

### 📊 Output Data Format

The Actor outputs a dataset where each item represents one analyzed profile.

The “overview” table includes these end-user friendly columns:

- `profile_username`
- `profile_url`
- `followers_count`
- `total_posts_analyzed`
- `average_engagement_rate_pct`
- `avg_engagement_velocity_per_day`
- `like_to_comment_ratio`
- `posting_frequency_posts_per_week`
- `top_post_lift`
- `engagement_consistency_score`
- `content_mix_ratio_counts`
- `content_mix_clips_pct`
- `content_mix_carousel_pct`
- `content_mix_image_pct`
- `avg_caption_length_chars`
- `avg_hashtags_per_post`
- `comment_rate_pct`
- `total_mentions_in_captions`
- `avg_mentions_per_post`
- `most_engaged_post_link`
- `date_span_days`
- `oldest_post_at`
- `newest_post_at`
- `analyzed_at`
- `note`

Other fields may exist in the raw item for advanced use (example: most-viral post id, reel cross-platform fields).

---

### 🧾 Metrics Explained (with formulas)

All metrics use the analyzed post sample you requested via `postsToAnalyze` (and any filters you set).

#### 1) Average Engagement Rate (ER)
**Formula**
- avg( (likes + comments) / followers × 100 )

**Meaning**
- Normalizes engagement by audience size so you can compare any account size.

#### 2) Engagement Velocity (per day)
**Formula**
- avg( (likes + comments) / max(1, post_age_days) )

**Meaning**
- How fast engagement is accumulating relative to post age.

#### 3) Like-to-Comment Ratio
**Formula**
- total_likes / total_comments

**Meaning**
- Depth vs “passive” engagement signal.

#### 4) Posting Frequency (posts/week)
**Formula**
- (post_count / date_span_days) × 7

**Meaning**
- Content velocity you can correlate with ER.

#### 5) Top Post Lift
**Formula**
- max(post_likes) / avg(post_likes)

**Meaning**
- How strongly the best post outperforms the average.

#### 6) Engagement Consistency Score
**Formula**
- 1 - (std_dev(ER_per_post) / avg_ER)
- clipped to `[0, 1]`

**Meaning**
- High score = predictable audience response (more brand-safe).

#### 7) Cross-Platform Amplification Rate (Reels only)
**Formula**
- total_fb_likes / total_ig_likes × 100

**Meaning**
- Only computed when Facebook like info exists for qualifying reels.

#### 8) Content Mix Ratio
**Formula**
- count(clips) : count(carousel) : count(image)

**Meaning**
- Helps you see whether the profile is strategy-driven around Reels vs other formats.

#### 9) Average Caption Length (characters)
**Formula**
- sum(len(caption_text)) / post_count

**Meaning**
- Caption style fingerprint.

#### 10) Hashtag Usage (count per post)
**Formula**
- sum(hashtags_per_post) / post_count

**Meaning**
- A practical proxy for discoverability strategy.

#### 11) Comment Rate
**Formula**
- comments / followers × 100

#### 12) Mention Count
**Formula**
- count(@\w+ in captions)

**Meaning**
- Collaboration signal.

#### 13) Total Posts Analyzed
- `total_posts_analyzed`

#### 14) Most Engaged Post
- The post with maximum `(likes + comments)`
- Provided as a direct link in `most_engaged_post_link`

#### 15) Most Viral Post
- The post with maximum `view_count` (if view data exists)

---

### 🧠 Notes That Matter (real-world expectations)

- Results quality depends heavily on sample size (`postsToAnalyze`).
- If follower count can’t be parsed, ER-based metrics may be null.
- Instagram public endpoints may occasionally block or return partial data; you’ll see a `note` field when that happens.
- If you filter by `dateFilter`, you may end up with fewer posts than requested.

---

### 💡 How to Control Cost (and PPE Pricing)

This Actor supports Pay-Per-Event (PPE) charging.

#### What is charged?
- 1 PPE event per **analyzed post** per profile
- The event name is typically `post`

#### How the Actor controls charging
- It computes an effective `postsToAnalyze` cap based on your remaining PPE budget.
- If the PPE budget runs out, the Actor will:
  - stop processing additional profiles early, or
  - produce partial rows (with a `note` explaining the cap)


---

### ❓ FAQ

#### Q: What should I set for `postsToAnalyze`?
- Start with `100` for quick comparisons.
- Use `500–1000` for more stable ER consistency and posting frequency signals.

#### Q: Why are some ER fields null?
- If follower count wasn’t successfully parsed from profile HTML or if Instagram returned incomplete data.

#### Q: Why does the Actor stop early sometimes?
- With PPE enabled, budget limits can stop additional analyzed posts to prevent exceeding your max spend.

---

# Actor input Schema

## `profiles` (type: `array`):

One or more Instagram profiles: username, @handle, or full profile URL (https://www.instagram.com/…/).
## `postsToAnalyze` (type: `integer`):

How many recent timeline posts to load for metrics (after filters). Pagination loads up to 12 per request until this cap or the feed ends.
## `postTypeFilter` (type: `string`):

Restrict which product_type values are counted. "All" uses every post that passes other filters.
## `skipPinnedPosts` (type: `boolean`):

If true, pinned items are excluded from the sample (matches typical scraper behavior).
## `dateFilter` (type: `string`):

Optional. Calendar date (YYYY-MM-DD) or relative phrase (e.g. "90 days"). Empty = no date cutoff.

## Actor input object example

```json
{
  "profiles": [
    "therock",
    "@nasa",
    "https://www.instagram.com/leomessi/"
  ],
  "postsToAnalyze": 50,
  "postTypeFilter": "all",
  "skipPinnedPosts": false
}
````

# 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 = {
    "profiles": [
        "therock",
        "@nasa",
        "https://www.instagram.com/leomessi/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("easy_scraper/instagram-profile-engagement-analytics").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 = { "profiles": [
        "therock",
        "@nasa",
        "https://www.instagram.com/leomessi/",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("easy_scraper/instagram-profile-engagement-analytics").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 '{
  "profiles": [
    "therock",
    "@nasa",
    "https://www.instagram.com/leomessi/"
  ]
}' |
apify call easy_scraper/instagram-profile-engagement-analytics --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=easy_scraper/instagram-profile-engagement-analytics",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Instagram profile engagement analytics",
        "description": "Analyze Instagram posts. Measure real engagement. Discover what works.",
        "version": "1.0",
        "x-build-id": "AnAfKn1j8G7JkQCK0"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/easy_scraper~instagram-profile-engagement-analytics/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-easy_scraper-instagram-profile-engagement-analytics",
                "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/easy_scraper~instagram-profile-engagement-analytics/runs": {
            "post": {
                "operationId": "runs-sync-easy_scraper-instagram-profile-engagement-analytics",
                "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/easy_scraper~instagram-profile-engagement-analytics/run-sync": {
            "post": {
                "operationId": "run-sync-easy_scraper-instagram-profile-engagement-analytics",
                "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": [
                    "profiles"
                ],
                "properties": {
                    "profiles": {
                        "title": "Profile URLs or usernames",
                        "type": "array",
                        "description": "One or more Instagram profiles: username, @handle, or full profile URL (https://www.instagram.com/…/).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "postsToAnalyze": {
                        "title": "Posts to analyze per profile",
                        "minimum": 1,
                        "type": "integer",
                        "description": "How many recent timeline posts to load for metrics (after filters). Pagination loads up to 12 per request until this cap or the feed ends.",
                        "default": 50
                    },
                    "postTypeFilter": {
                        "title": "Post type filter",
                        "enum": [
                            "all",
                            "feed",
                            "clips",
                            "carousel_container"
                        ],
                        "type": "string",
                        "description": "Restrict which product_type values are counted. \"All\" uses every post that passes other filters.",
                        "default": "all"
                    },
                    "skipPinnedPosts": {
                        "title": "Skip pinned posts",
                        "type": "boolean",
                        "description": "If true, pinned items are excluded from the sample (matches typical scraper behavior).",
                        "default": false
                    },
                    "dateFilter": {
                        "title": "Only posts newer than",
                        "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
                        "type": "string",
                        "description": "Optional. Calendar date (YYYY-MM-DD) or relative phrase (e.g. \"90 days\"). Empty = no date cutoff."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
