# Ultimate Instagram Scraper (`apigeek/ultimate-instagram-scraper`) Actor

Fast and reliable Instagram scraper for public profiles, recent posts, Reels, and carousels with optional AI content analysis and campaign monitoring.

- **URL**: https://apify.com/apigeek/ultimate-instagram-scraper.md
- **Developed by:** [API Geek](https://apify.com/apigeek) (community)
- **Categories:** Social media, Marketing, AI
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 instagram 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/actors/running/actors-in-store.md#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

## 📸 Ultimate Instagram Scraper

> **Fast and reliable Instagram scraper for extracting public profile metadata, latest posts, Reels, and carousels with optional AI-powered content analysis and campaign monitoring.**

***

### 🚀 Key Features

- **⚡ Fast & Efficient**: Streamlined extraction designed for speed, low latency, and high reliability.
- **🎯 Simple Profile Input**: Accepts Instagram usernames (e.g., `natgeo`, `@nasa`) or full profile URLs.
- **📅 Chronological Content**: Merges feed posts and Reels into a unified, newest-first timeline.
- **🔢 Per-Profile Result Limits**: Configure `latestPosts` per profile (e.g., 10 profiles × 10 items = up to 100 items).
- **⏳ Flexible Date Filtering**: Filter items with `onlyPostsNewerThan` using absolute ISO dates or relative timeframes.
- **🖼️ Posts, Reels & Carousels**: Full support for photos, video posts, Reels clips, and multi-slide carousel items with nested media.
- **📊 Public Engagement Metrics**: Collects view counts, play counts, like counts, comment counts, tagged users, and location metadata.
- **👤 Creator Profile Metadata**: Every content item is enriched with creator audience statistics including follower count, following count, post count, and verification status.
- **👥 Audience Size Filtering**: Filter results with `minFollowers` to focus on creators matching specific audience thresholds.
- **🧠 Optional AI Intelligence**: Enrich posts with automated summaries, sentiment classification, topic extraction, brand detection, and promotion classification.
- **🏆 Custom Campaign Monitoring**: Track sponsored campaigns, brand activations, and promotional hashtag compliance.
- **🔄 Automation-Ready Output**: Clean, normalized dataset schema ready for dashboards, spreadsheets, and automated workflows.

***

### ⚡ Quick Start

1. **Enter Target Profiles**: Provide one or more Instagram usernames or profile URLs in `profiles` (e.g. `["natgeo", "nasa"]`).
2. **Set Limit**: Choose how many items to collect per profile with `latestPosts` (default `10`).
3. **Select Content Types**: Keep `includePosts` and `includeReels` enabled to capture both feed posts and Reels.
4. **(Optional) Set Follower Filter**: Use `minFollowers` to only include creators with at least a certain follower count.
5. **(Optional) Enable AI**: Toggle `aiAnalysis` to enrich posts with automated summaries, sentiment, and topics.
6. **Run the Actor**: Click **Start** to begin extraction.
7. **Export Data**: Download your results in JSON, CSV, Excel, or connect via API/webhooks.

***

### 📥 Input Parameters Reference

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `profiles` | `string[]` | *Required* | List of Instagram usernames (e.g., `natgeo`, `@nasa`) or profile URLs (e.g., `https://www.instagram.com/instagram/`). |
| `latestPosts` | `integer` | `10` | Maximum number of latest items (Posts and Reels combined) to collect **per profile**. |
| `includePosts` | `boolean` | `true` | Include standard feed posts (photos, video posts, carousels). |
| `includeReels` | `boolean` | `true` | Include Reels video clips. |
| `onlyPostsNewerThan` | `string` | `null` | Filter items by creation date using ISO date or relative duration (e.g. `24 hours`, `3 days`, `7 days`, `30 days`). |
| `minFollowers` | `integer` | `0` | Filter content to creators with at least this number of followers (0 to disable). |
| `aiAnalysis` | `boolean` | `false` | Enable AI content intelligence (summaries, sentiment, topics, brands, promotion classification). |
| `campaignDetection` | `boolean` | `false` | Enable target campaign and marketing activation detection across scraped posts. |
| `campaigns` | `array` | `[]` | Target campaign monitoring definitions. |
| `proxyConfiguration` | `object` | `{ "useApifyProxy": true }` | Network proxy configuration for scraping reliability. |

***

### 🔢 Per-Profile Limits (`latestPosts`)

The `latestPosts` parameter applies **per profile**:

$$\text{Total Records} = \text{Number of Profiles} \times \text{latestPosts}$$

- **Example**: 5 profiles with `latestPosts = 10` can return up to 50 content records.
- Posts and Reels are merged and sorted chronologically (newest first) before applying the limit.

***

### ⏳ Date Filtering Examples

You can filter content by recency using `onlyPostsNewerThan`:

- **Relative timeframes**: `"24 hours"`, `"3 days"`, `"7 days"`, `"30 days"`
- **Absolute ISO timestamps**: `"2026-08-24T00:00:00Z"`

***

### 🧠 Optional AI Content Intelligence

When `aiAnalysis` is enabled, each scraped item is enriched with structured content intelligence:

- **Summary**: Concise factual overview of the post caption and media context.
- **Language**: Primary language detected (e.g. `en`, `es`, `id`).
- **Sentiment**: Content tone (`positive`, `neutral`, `negative`, `mixed`).
- **Topics**: Extracted theme keywords (e.g. `technology`, `travel`, `fitness`).
- **Brands**: Detected brand names and corporate mentions.
- **Promotion Detection**: Identifies whether the post is commercial or promotional (`isPromotion: true/false`).
- **Promotion Type**: Classification (`sponsorship`, `affiliate`, `direct_ad`, `giveaway`, `event`, `organic_none`).
- **Confidence**: Assessment confidence score ($0.0 - 1.0$).

> **Note**: AI intelligence is completely optional and disabled by default. When disabled, zero AI charges apply.

***

### 🏆 Custom Campaign Monitoring

Track specific influencer activations, hashtag campaigns, or partner promotions by adding campaign definitions to `campaigns`:

```json
[
  {
    "name": "Summer Tech Launch",
    "brand": "TechCorp",
    "keywords": ["SummerLaunch", "NextGen", "unboxing", "review"],
    "hashtags": ["#TechCorpSummer", "#NextGen2026"],
    "additionalContext": "Official summer product launch campaign"
  }
]
```

When a post matches your criteria, the output includes:

- `matched`: `true` / `false`
- `campaignName`: Name of the matched campaign
- `brand`: Associated brand
- `matchType`: `exact`, `keyword`, `semantic`, or `none`
- `evidence`: Matching keywords, hashtags, or phrases found in the content
- `reason`: Clear explanation for the classification

***

### 📤 Output Dataset Format

Each item in the dataset is a clean, normalized record:

```json
{
  "platform": "instagram",
  "type": "post",
  "id": "3970988688541745155",
  "shortCode": "DcbySxLoAAD",
  "url": "https://www.instagram.com/p/DcbySxLoAAD/",
  "ownerId": "787132",
  "ownerUsername": "natgeo",
  "ownerFullName": "National Geographic",
  "ownerFollowersCount": 284000000,
  "ownerFollowingCount": 165,
  "ownerPostsCount": 29800,
  "ownerIsVerified": true,
  "caption": "A stunning glimpse into the heart of the Amazon rainforest. Photo by @photographer #wildlife #nature",
  "hashtags": ["#wildlife", "#nature"],
  "mentions": ["@photographer"],
  "timestamp": "2026-08-24T14:30:00.000Z",
  "mediaType": "image",
  "displayUrl": "https://scontent.cdninstagram.com/.../img.jpg",
  "thumbnailUrl": "https://scontent.cdninstagram.com/.../thumb.jpg",
  "videoUrl": null,
  "images": [
    "https://scontent.cdninstagram.com/.../img.jpg"
  ],
  "likesCount": 14250,
  "commentsCount": 184,
  "videoViewCount": null,
  "videoPlayCount": null,
  "taggedUsers": ["photographer"],
  "collaborators": [],
  "location": {
    "name": "Amazon Rainforest",
    "slug": "amazon-rainforest"
  },
  "isSponsored": false,
  "scrapedAt": "2026-08-25T16:00:00.000Z",
  "aiAnalysis": {
    "summary": "National Geographic showcases a photograph captured in the Amazon rainforest highlighting biodiversity.",
    "language": "en",
    "sentiment": "positive",
    "topics": ["wildlife", "nature", "photography", "conservation"],
    "brands": ["National Geographic"],
    "isPromotion": false,
    "promotionType": "organic_none",
    "confidence": 0.95,
    "campaign": {
      "matched": false,
      "campaignName": "",
      "brand": "",
      "confidence": 1.0,
      "matchType": "none",
      "evidence": [],
      "reason": "No promotional campaign detected."
    }
  }
}
```

***

### 💰 Pay-Per-Event (PPE) Pricing

| Service | Price per Event | Price per 1,000 Results |
| :--- | :--- | :--- |
| **Base Instagram Content** | **$0.0025** | **$2.50** |
| **Optional AI Intelligence** | **+$0.0020** | **+$2.00** |

- Charges apply **strictly once** per successfully scraped content item.
- Failed targets, private profiles with zero items, and duplicate records are **never charged**.
- When AI is disabled (`aiAnalysis = false`), **zero AI charges** occur.

***

### 🛡️ Limitations & Best Practices

- **Public Content Only**: Extracts publicly available posts, reels, and metadata from public profiles. Private accounts and login-required features (Stories, direct messages) are not supported.
- **Platform Availability**: Public fields and engagement counts reflect publicly visible data at the time of scraping.
- **Budget Limits**: You can configure spending limits in your Apify Console task settings to control total spend on large scraping runs.

# Actor input Schema

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

List of Instagram usernames (e.g. 'natgeo', '@nasa') or full profile URLs (e.g. 'https://www.instagram.com/instagram/').

## `latestPosts` (type: `integer`):

Maximum number of latest content items (Posts and Reels combined chronologically) to collect per profile.

## `includePosts` (type: `boolean`):

Include standard feed posts (photos, video posts, and carousels).

## `includeReels` (type: `boolean`):

Include Reels video clips in the chronological output.

## `onlyPostsNewerThan` (type: `string`):

Filter content by date. Supports absolute ISO date (e.g. '2026-08-24T00:00:00Z') or relative timeframe (e.g. '24 hours', '3 days', '7 days', '30 days').

## `minFollowers` (type: `integer`):

Filter content to creators with at least this number of followers. Set to 0 to disable follower threshold filtering.

## `aiAnalysis` (type: `boolean`):

Analyze scraped Instagram content and enrich results with summaries, sentiment, topics, brand mentions, and promotion insights (+$2.00 / 1,000 items).

## `campaignDetection` (type: `boolean`):

Enable target campaign and marketing activation detection across scraped posts using AI Intelligence (+$2.00 / 1,000 items).

## `campaigns` (type: `array`):

Define target marketing campaigns, tournaments, activations, or brand initiatives to detect.

## `maxConcurrency` (type: `integer`):

Maximum number of concurrent profile scrapers running in parallel.

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

Configure proxy settings for scraping resilience. Uses Apify Proxy by default.

## Actor input object example

```json
{
  "profiles": [
    "natgeo"
  ],
  "latestPosts": 10,
  "includePosts": true,
  "includeReels": true,
  "minFollowers": 0,
  "aiAnalysis": false,
  "campaignDetection": false,
  "campaigns": [],
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

Normalized Instagram content records written to the default dataset.

## `summary` (type: `string`):

Run summary metrics written to Key-Value store OUTPUT.

# 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": [
        "natgeo"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("apigeek/ultimate-instagram-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 = { "profiles": ["natgeo"] }

# Run the Actor and wait for it to finish
run = client.actor("apigeek/ultimate-instagram-scraper").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 '{
  "profiles": [
    "natgeo"
  ]
}' |
apify call apigeek/ultimate-instagram-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,apigeek/ultimate-instagram-scraper"
        }
    }
}

```

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/IWgjH0yGb905RCmbV/builds/A05G8rOIjdauuC1Ls/openapi.json
