# Instagram Scraper - Profiles, Posts, Reels & Comments (`aiscraperdev/scrape-instagram-profiles-posts-reels`) Actor

Extract Instagram profiles, posts, reels, comments, and hashtags without login or API access. Input a direct URL, username, or hashtag and get structured JSON/CSV data including captions, likes, views, followers, and engagement metrics. Fast, reliable, no authentication required.

- **URL**: https://apify.com/aiscraperdev/scrape-instagram-profiles-posts-reels.md
- **Developed by:** [Randeep Dhillon](https://apify.com/aiscraperdev) (community)
- **Categories:** Social media, Developer tools, Automation
- **Stats:** 4 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 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 Public Data Scraper

Scrape publicly available Instagram profiles, posts, reels, hashtags, and search queries at scale **without requiring Instagram login credentials or API keys**.

***

### Features

- 👤 **Profile Scraping**: Extract profile bio, follower count, following count, post count, verification status, category, external URL, and latest posts.
- 📸 **Post Scraping**: Extract post captions, shortcodes, post IDs, hashtags, mentions, likes count, comments count, timestamps, owner details, and media URLs.
- 🎬 **Reel Scraping**: Extract video view/play count, audio track metadata (title, artist, audio URL), video source URL, and thumbnail.
- \#️⃣ **Hashtag Scraping**: Extract total post count, top posts, and recent posts for any target hashtag.
- 🔍 **Search Query Scraping**: Extract profile search results matching search terms.
- 🚨 **Structured Error Emitter**: Guarantees raw exceptions are never thrown. Returns structured error records (`PROFILE_PRIVATE`, `POST_NOT_FOUND`, `LOGIN_REQUIRED`, `RATE_LIMITED`, `PROXY_BLOCKED`).
- 📊 **Strict Dataset Consistency**: All fields are present in every dataset row (`null` returned for unavailable values), making export to CSV, Excel, BigQuery, PostgreSQL, and AI/RAG pipelines flawless.

***

### How to Use

#### Step 1 — Define your target inputs

Specify your target Instagram usernames:

- **`usernames`**: Array of Instagram account usernames (e.g. `["focus.on.form", "betamatkarmemes"]`).
- **`urls`** (optional): Array of full Instagram URLs (profiles, posts, reels, hashtags).
- **`searchQueries`** (optional): Array of search terms (e.g. `["fitness"]`).
- **`hashtags`** (optional): Array of hashtag names (e.g. `["fitness"]`).

#### Step 2 — Configure options

- Set `maxItems` to cap the number of extracted items per query/feed.
- Toggle `scrapeProfiles`, `scrapePosts`, `scrapeReels`, or `scrapeComments`.
- Enable Apify Proxy for automatic IP rotation and anti-bot bypass.

#### Step 3 — Run & Export

Click **Start** and export your structured dataset in **JSON, CSV, Excel, or JSONL**.

***

### Input Reference

```json
{
  "usernames": [
    "focus.on.form",
    "betamatkarmemes"
  ],
  "maxItems": 100,
  "scrapeProfiles": true,
  "scrapePosts": true,
  "scrapeReels": true,
  "searchQueries": [
    "fitness",
    "gym motivation"
  ],
  "hashtags": [
    "fitness",
    "bodybuilding"
  ],
  "maxItems": 100,
  "scrapeProfiles": true,
  "scrapePosts": true,
  "scrapeReels": true,
  "scrapeComments": false,
  "oldestPostDate": "2025-01-01",
  "newestPostDate": "2026-12-31",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

***

### Dataset Output Schemas

#### 1. Profile Output Sample

```json
{
  "scrapeType": "profile",
  "scrapedAt": "2026-07-22T12:00:00.000Z",
  "url": "https://www.instagram.com/nike/",
  "username": "nike",
  "fullName": "Nike",
  "biography": "Just Do It.",
  "isVerified": true,
  "isBusinessAccount": true,
  "isPrivate": false,
  "followersCount": 305000000,
  "followingCount": 150,
  "postsCount": 1200,
  "externalUrl": "https://www.nike.com",
  "profilePicUrl": "https://scontent.cdninstagram.com/v/t51.2885-19/nike.jpg",
  "highlightReelCount": 5,
  "category": "Clothing (Brand)",
  "businessAddress": null,
  "businessEmail": null,
  "businessPhone": null,
  "latestPosts": []
}
```

#### 2. Post Output Sample

```json
{
  "scrapeType": "post",
  "scrapedAt": "2026-07-22T12:00:00.000Z",
  "url": "https://www.instagram.com/p/C12345678/",
  "shortCode": "C12345678",
  "postId": "3210987654321",
  "caption": "Morning workout routine #fitness #gym",
  "hashtags": ["fitness", "gym"],
  "mentions": [],
  "likesCount": 12500,
  "commentsCount": 430,
  "videoViewCount": null,
  "timestamp": "2026-07-21T08:30:00.000Z",
  "ownerUsername": "fitnessguy",
  "ownerId": "987654321",
  "isVideo": false,
  "dimensions": { "width": 1080, "height": 1080 },
  "mediaUrls": ["https://scontent.cdninstagram.com/v/post1.jpg"],
  "locationName": "Venice Beach",
  "locationId": "123456"
}
```

#### 3. Structured Error Sample

```json
{
  "success": false,
  "errorCode": "PROFILE_PRIVATE",
  "message": "Profile is private",
  "url": "https://www.instagram.com/private_user/"
}
```

***

### Anti-Bot & Evasion Mechanics

- **Automatic Proxy Rotation**: Uses Apify Residential/Datacenter proxy pools to bypass IP throttling.
- **Request Retries & Backoff**: Automatically retries 429 and 5xx response codes with exponential backoff delays.
- **Header & Browser Randomization**: Emulates genuine Chromium browser fingerprints.

***

### Export & AI Pipeline Compatibility

Output dataset JSON structures strictly preserve object key schemas. Keys with missing data return `null` instead of being omitted, allowing seamless loading into **PostgreSQL, BigQuery, Snowflake, Pandas, Excel, and LLM RAG pipelines**.

# Actor input Schema

## `usernames` (type: `array`):

List of Instagram account usernames to scrape (e.g. 'focus.on.form', 'betamatkarmemes').

## `urls` (type: `array`):

Optional list of full Instagram profile, post, reel, or hashtag URLs to scrape.

## `searchQueries` (type: `array`):

List of search terms to query on Instagram search.

## `hashtags` (type: `array`):

List of hashtags to scrape (without the # symbol).

## `maxItems` (type: `integer`):

Maximum number of posts, reels, comments, or search results to extract.

## `scrapeProfiles` (type: `boolean`):

Whether to extract profile information when visiting profile URLs or usernames.

## `scrapePosts` (type: `boolean`):

Whether to extract post content when visiting profile feeds.

## `scrapeReels` (type: `boolean`):

Whether to extract Reel metadata and media URLs.

## `scrapeComments` (type: `boolean`):

Extract comments for posts or reels.

## `includeFollowers` (type: `boolean`):

Attempt to extract public followers count and highlights.

## `includeFollowing` (type: `boolean`):

Attempt to extract public following count.

## `oldestPostDate` (type: `string`):

Filter posts newer than or equal to this date (YYYY-MM-DD).

## `newestPostDate` (type: `string`):

Filter posts older than or equal to this date (YYYY-MM-DD).

## `downloadImages` (type: `boolean`):

Extract direct full-resolution image media URLs.

## `downloadVideos` (type: `boolean`):

Extract direct full-resolution video media URLs.

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

Apify Proxy configuration for IP rotation and stealth anti-bot bypass.

## Actor input object example

```json
{
  "usernames": [
    "focus.on.form"
  ],
  "urls": [],
  "searchQueries": [],
  "hashtags": [],
  "maxItems": 100,
  "scrapeProfiles": true,
  "scrapePosts": true,
  "scrapeReels": true,
  "scrapeComments": false,
  "includeFollowers": false,
  "includeFollowing": false,
  "oldestPostDate": "",
  "newestPostDate": "",
  "downloadImages": false,
  "downloadVideos": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

# 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 = {
    "usernames": [
        "focus.on.form"
    ],
    "urls": [],
    "searchQueries": [],
    "hashtags": [],
    "maxItems": 100,
    "scrapeProfiles": true,
    "scrapePosts": true,
    "scrapeReels": true,
    "scrapeComments": false,
    "includeFollowers": false,
    "includeFollowing": false,
    "oldestPostDate": "",
    "newestPostDate": "",
    "downloadImages": false,
    "downloadVideos": false,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("aiscraperdev/scrape-instagram-profiles-posts-reels").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 = {
    "usernames": ["focus.on.form"],
    "urls": [],
    "searchQueries": [],
    "hashtags": [],
    "maxItems": 100,
    "scrapeProfiles": True,
    "scrapePosts": True,
    "scrapeReels": True,
    "scrapeComments": False,
    "includeFollowers": False,
    "includeFollowing": False,
    "oldestPostDate": "",
    "newestPostDate": "",
    "downloadImages": False,
    "downloadVideos": False,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("aiscraperdev/scrape-instagram-profiles-posts-reels").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 '{
  "usernames": [
    "focus.on.form"
  ],
  "urls": [],
  "searchQueries": [],
  "hashtags": [],
  "maxItems": 100,
  "scrapeProfiles": true,
  "scrapePosts": true,
  "scrapeReels": true,
  "scrapeComments": false,
  "includeFollowers": false,
  "includeFollowing": false,
  "oldestPostDate": "",
  "newestPostDate": "",
  "downloadImages": false,
  "downloadVideos": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call aiscraperdev/scrape-instagram-profiles-posts-reels --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

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