# Instagram Post Scraper (`clappi/instagram-posts-scraper`) Actor

Scrape Instagram Posts and Reels with combined Instagram + Facebook metrics. Get views, likes, comments from both platforms when content is cross-posted — all with built-in authentication, no cookies required.

- **URL**: https://apify.com/clappi/instagram-posts-scraper.md
- **Developed by:** [Clappi](https://apify.com/clappi) (community)
- **Categories:** Social media, Videos, Automation
- **Stats:** 252 total users, 52 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: 4.46 out of 5 stars

## Pricing

from $1.70 / 1,000 posts

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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 Posts Scraper

Scrape Instagram post and reel metrics with built-in authentication — no need for your own cookies. Get views, likes, comments, and optionally include combined Instagram + Facebook metrics when content is cross-posted.

### Input

| Field | Type | Description |
|-------|------|-------------|
| `postUrls` | array | Instagram post/reel URLs |
| `includeFacebookMetrics` | boolean | Enable to get combined IG + FB metrics for cross-posted content (slower) |
| `cookies` | string | (Optional) Use your own Instagram cookies if preferred |

#### Example Input

```json
{
  "postUrls": [
    "https://www.instagram.com/reel/ABC123/",
    "https://www.instagram.com/p/XYZ789/"
  ],
  "includeFacebookMetrics": false
}
```

### Output

Each post includes:

```json
{
  "url": "https://www.instagram.com/reel/ABC123/",
  "originalUrl": "https://www.instagram.com/share/reel/Tok3n/",
  "shortcode": "ABC123",
  "mediaId": "1234567890123456789",
  "author": "username",
  "authorId": "12345678",
  "authorUrl": "https://www.instagram.com/username/",
  "caption": "Amazing content! #viral",
  "views": 150000,
  "likes": 5000,
  "comments": 200,
  "isVideo": true,
  "thumbnailUrl": "https://...",
  "datePosted": "2024-01-15T10:30:00.000Z",
  "status": "available",
  "scrapedAt": "2024-01-20T12:00:00.000Z"
}
```

### Supported URLs

- `https://www.instagram.com/p/SHORTCODE/` - Posts
- `https://www.instagram.com/reel/SHORTCODE/` - Reels
- `https://www.instagram.com/tv/SHORTCODE/` - IGTV
- `https://www.instagram.com/share/...` - Share links (resolved to the canonical post URL)

For share links, `url` holds the resolved canonical post URL (the one actually scraped) and `originalUrl` holds the exact link you submitted. For non-share links the two are identical.

### Facebook Metrics

When `includeFacebookMetrics` is enabled, the scraper fetches combined metrics from both Instagram and Facebook for content that was cross-posted. This uses a deeper scraping method that takes longer but provides total engagement across both platforms.

### Use Cases

- **Content Analysis** - Track post performance metrics
- **Competitor Research** - Monitor competitor content engagement
- **Influencer Vetting** - Verify engagement rates and content quality
- **Cross-Platform Analytics** - Get combined Instagram + Facebook metrics
- **Portfolio Building** - Collect content data for reporting

### Cost Estimation

This scraper is optimized for efficiency. Scraping 100 posts typically costs less than $0.10 in platform usage.

# Actor input Schema

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

List of Instagram post URLs to scrape. Supports posts, reels, and IGTV.

## `includeFacebookMetrics` (type: `boolean`):

Enable to get combined Instagram + Facebook metrics for cross-posted content. Uses deeper scraping which takes longer. Only enable if you know the content was shared to Facebook.

## `cookies` (type: `string`):

Optional. Provide your own Instagram cookies if you prefer to use your account instead of built-in authentication.

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

Optional proxy settings. Use Apify Proxy or custom proxies.

## Actor input object example

```json
{
  "postUrls": [
    "https://www.instagram.com/reel/DR5fmMgEjWs/",
    "https://www.instagram.com/p/DP1ewP1EbyD/"
  ],
  "includeFacebookMetrics": false,
  "proxyConfiguration": {
    "useApifyProxy": 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 = {
    "postUrls": [
        "https://www.instagram.com/reel/DR5fmMgEjWs/",
        "https://www.instagram.com/p/DP1ewP1EbyD/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("clappi/instagram-posts-scraper").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/reel/DR5fmMgEjWs/",
        "https://www.instagram.com/p/DP1ewP1EbyD/",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("clappi/instagram-posts-scraper").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 '{
  "postUrls": [
    "https://www.instagram.com/reel/DR5fmMgEjWs/",
    "https://www.instagram.com/p/DP1ewP1EbyD/"
  ]
}' |
apify call clappi/instagram-posts-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/bInft7nKPaSDnHDbm/builds/vFbnlAYHZ3QJWgtHm/openapi.json
