# Instagram Post Scraper (`social-fetch/instagram-post-scraper`) Actor

Scrape Instagram posts and reels by URL: likes, comments, captions, and media. Export data, schedule runs, and integrate with research or analytics workflows.

- **URL**: https://apify.com/social-fetch/instagram-post-scraper.md
- **Developed by:** [Social Fetch](https://apify.com/social-fetch) (community)
- **Categories:** Social media, Automation, Developer tools
- **Stats:** 3 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.98 / 1,000 post results

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 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 Post Scraper

Checking posts one by one in the app — or paying browser-scraper prices for a likes count — wastes hours you don't have. Paste up to 500 post or reel links and get likes, comments, captions, media URLs, and owner info back as structured rows at a flat $1.98 per 1,000.

Likes, comments, captions, and media metadata for any public Instagram post or reel URL — paste links, export rows.

🔥 **$1.98 per 1,000 rows** · up to **500** URLs per run · ⚡ API-based — no browser, no proxies · [integration guide](https://www.socialfetch.dev/docs/integrations/apify)

### 💡 Why this scraper

- 💵 **Flat $1.98 per 1,000 rows** — about 80% below typical Instagram scrapers on the Store, with platform API usage included in the price.
- ⚡ **API calls, not browser automation** — no headless Chrome to babysit, no proxies to rent, no cookies or logins. Runs start fast and fit in 256–512 MB of memory.
- 📦 **Structured rows, every time** — each dataset row is the same [Social Fetch API](https://www.socialfetch.dev/docs/api) envelope (`data`, `meta`, and `lookupStatus` where applicable), so your parsing never breaks when Instagram redesigns its UI.
- 🔁 **Nothing locked to Apify** — the same endpoint is available on the [Social Fetch API](https://www.socialfetch.dev/docs/api) with an `sfk_` key when you outgrow Actor runs.

New to Social Fetch on Apify? The [integration guide](https://www.socialfetch.dev/docs/integrations/apify) has screenshots, the actor catalog, and troubleshooting.

### 🎯 What can you do with it

| You need | Give the Actor | You get |
|---|---|---|
| Report on a campaign | Sponsored post and reel URLs | Likes and comments per deliverable, exportable to CSV |
| Benchmark reels in your niche | Competitor reel links | Engagement stats to compare formats and hooks |
| Reverse-engineer viral posts | Links to posts that took off | Captions and stats to study what worked |
| Reference media in your tools | Any batch of post URLs | Display media URLs, shortcodes, and owner handles |

### 📦 Data you get

**Post or reel**

- Shortcode, URL, and caption
- Media type and display image or video URLs

**Engagement**

- Likes and comment counts

**Owner**

- Owner handle
- `lookupStatus` per row (`found` / `not_found`)

### 🚀 Quick start

1. Fill in the **Input** below — sample values are pre-filled.
2. Click **Start** and wait for the run to finish.
3. Open the **Dataset** tab and export as JSON, CSV, or Excel.

### 🧪 Input recipes

- **`postUrls`** — public Instagram post or reel links

#### Single lookup

Start with one link to see the exact row shape.

```json
{
  "postUrls": [
    "https://www.instagram.com/p/DL2lr7ouyW5/"
  ]
}
```

#### Batch up to 500 links

Swap in your own links — one dataset row per URL, in input order.

```json
{
  "postUrls": [
    "https://www.instagram.com/p/DL2lr7ouyW5/",
    "https://www.instagram.com/reel/<shortcode>/"
  ]
}
```

### 📤 Example output

```json
{
  "data": {
    "lookupStatus": "found",
    "post": {
      "shortcode": "DL2lr7ouyW5",
      "url": "https://www.instagram.com/p/DL2lr7ouyW5/",
      "caption": "The blueprint to a better game. \n\nGet ready to outwork everyone in the Sabrina 3. The lightweight, versatile tool to build your game bucket by bucket.\n\nComing soon."
    },
    "owner": {
      "handle": "nike"
    },
    "metrics": {
      "likes": 64396,
      "comments": 426
    }
  },
  "meta": {
    "requestId": "req_b0afea53-45a7-4197-b753-e6451da410f0",
    "version": "v1"
  }
}
```

Rows may include `data.lookupStatus` (`found`, `not_found`, or `private`). Completed lookups are billed, including `not_found`.

### 💵 Pricing & cost control

| | Cost per 1,000 lookups |
|---|---|
| **Instagram Post Scraper** | $1.98 |
| Typical Instagram scrapers on Apify | $10.00 |

Roughly **80% less** than many Instagram post scrapers on the Store — structured API data behind every row.

**Keeping costs predictable**

- Pay-per-event pricing: you pay for results, not platform usage — no compute or proxy surcharges on top.
- A run can never bill more rows than the URLs you submit (up to 500), so the ceiling on a run's cost is known before you press Start.
- Completed lookups are billed even when the result is `not_found` or `private` — the work was done, and the row tells you why.

### 🧩 Related actors

- [Instagram Profile Scraper](https://apify.com/social-fetch/instagram-profile-scraper) — profile followers, bio, and metrics

### 🔗 Wire it up

Works with [Make](https://apify.com/integrations/make), [Zapier](https://apify.com/integrations/zapier), [n8n](https://www.socialfetch.dev/docs/integrations/n8n), Apify webhooks, and scheduled runs — or call the [Social Fetch API](https://www.socialfetch.dev/docs/api) directly.

### 🛠️ Troubleshooting

| Symptom | What's happening |
|---|---|
| A row says `"lookupStatus": "not_found"` | The Instagram content doesn't exist, was deleted, or the input has a typo. The lookup completed, so the row is billed — it echoes the input value so you can spot the culprit. |
| Links you know exist come back `not_found` | Check the URL format against the recipes above — this Actor expects `instagram.com/p/…` post or `instagram.com/reel/…` links. |
| Run fails with `No dataset items were produced` | The input list was empty or no lookups completed. Copy a recipe above and swap in your own values. |

### ❓ FAQ

- **Do I need a Social Fetch API key?** No — your Apify token is enough. Never paste an `sfk_` key into Actor input.
- **Why was I charged for `not_found`?** The lookup completed, but Instagram did not return that profile, video, or post. That still counts as a billable dataset row.
- **What URLs work?** Standard Instagram post or reel links (`.../p/...` or `.../reel/...`). Profile URLs belong in the profile Actor, not here.
- **Can I download media files?** Not through this Actor. Use the [Social Fetch API](https://www.socialfetch.dev/docs/api) with `downloadMedia=true` on your own API key.
- **Can it scrape stories or highlights?** No — public feed posts and reels only.
- **Is it legal to scrape Instagram?** This Actor reads only publicly available data — no logins, no private accounts, nothing beyond what Instagram shows any visitor. How you store and use the data is your responsibility; review Instagram's terms and the laws that apply to your use case.

### 🤝 Support & more

- [Apify integration guide](https://www.socialfetch.dev/docs/integrations/apify) — quick start and actor catalog
- [API reference](https://www.socialfetch.dev/docs/api) — same endpoints with your `sfk_` key
- Missing a field or hit a snag? Open an issue on this Actor's **Issues** tab or email <support@socialfetch.dev>.

# Actor input Schema

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

Public Instagram post or reel links to look up.

## Actor input object example

```json
{
  "postUrls": [
    "https://www.instagram.com/p/DL2lr7ouyW5/"
  ]
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset items — one row per handle or URL lookup, including lookupStatus and API payload fields.

# 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/DL2lr7ouyW5/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("social-fetch/instagram-post-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/p/DL2lr7ouyW5/"] }

# Run the Actor and wait for it to finish
run = client.actor("social-fetch/instagram-post-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/p/DL2lr7ouyW5/"
  ]
}' |
apify call social-fetch/instagram-post-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/EF5ji6Iug0dwPedw0/builds/ACc85WhaYG6swIkuN/openapi.json
