# Instagram Scraper - Profiles, Posts & Hashtags (`pear_fight/instagram-scraper`) Actor

Scrape Instagram profiles, posts, reels & hashtags. Extract followers, bio, captions, likes, comments, engagement metrics, image URLs. No login or API needed. Bulk scraping supported. Pay per result. Export JSON/CSV.

- **URL**: https://apify.com/pear_fight/instagram-scraper.md
- **Developed by:** [Harald](https://apify.com/pear_fight) (community)
- **Categories:** Social media
- **Features:** Limited permissions
- **Stats:** 55 total users, 2 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.98 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## 📸 Instagram Profile & Post Scraper

Scrape Instagram profiles and posts at scale. Extract follower counts, bios, verification status, post captions, likes, comments, hashtags, and more.

### Features

- **Profile scraping** — username, full name, bio, followers, following, post count, verification badge, profile picture, external URL
- **Post scraping** — shortcode, caption, likes, comments, timestamp, image/video URLs, location, hashtags
- **Automatic post discovery** — optionally crawl posts directly from each profile's grid
- **Anti-detection** — residential proxy support + browser fingerprint injection
- **Full JS rendering** — Playwright-based, handles Instagram's dynamic SPA

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `profiles` | string\[] | `[]` | Instagram usernames to scrape (without `@`) |
| `postUrls` | string\[] | `[]` | Direct URLs to Instagram posts or reels |
| `maxPostsPerProfile` | integer | `12` | Max posts to scrape per profile (0–100) |
| `scrapePostsFromProfiles` | boolean | `true` | Also scrape posts from each profile's grid |
| `proxyConfig` | object | Residential | Apify proxy configuration |

#### Example Input

```json
{
  "profiles": ["instagram", "cristiano"],
  "postUrls": ["https://www.instagram.com/p/ABC123/"],
  "maxPostsPerProfile": 12,
  "scrapePostsFromProfiles": true,
  "proxyConfig": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

### Output

#### Profile

```json
{
  "type": "profile",
  "username": "cristiano",
  "fullName": "Cristiano Ronaldo",
  "bio": "Football player...",
  "followers": 620000000,
  "following": 583,
  "posts": 3600,
  "isVerified": true,
  "profilePicUrl": "https://...",
  "externalUrl": "https://...",
  "scrapedAt": "2026-02-21T12:00:00.000Z"
}
```

#### Post

```json
{
  "type": "post",
  "id": "ABC123",
  "shortcode": "ABC123",
  "caption": "Great day! #blessed",
  "likes": 5000000,
  "comments": 45000,
  "timestamp": "2026-02-20T15:30:00.000Z",
  "imageUrl": "https://...",
  "videoUrl": "",
  "isVideo": false,
  "location": "Madrid, Spain",
  "hashtags": ["blessed"],
  "postUrl": "https://www.instagram.com/p/ABC123/",
  "profileUsername": "cristiano",
  "scrapedAt": "2026-02-21T12:00:00.000Z"
}
```

### Tips

- **Use residential proxies** — Instagram aggressively blocks datacenter IPs. The default configuration uses Apify residential proxies.
- **Login walls** — Instagram may show login prompts for some content. The scraper extracts as much as possible from public meta tags and structured data.
- **Rate limiting** — Keep `maxPostsPerProfile` reasonable to avoid triggering blocks. Start with 12 and increase gradually.

### Cost Estimation

The actor uses Playwright with Chromium, so it consumes more compute than simple HTTP scrapers. Rough estimate: ~$0.25–0.50 per 100 results depending on proxy usage.

### License

Apache-2.0

# Actor input Schema

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

List of Instagram usernames to scrape (without @). Example: \['instagram', 'cristiano']

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

List of Instagram post or reel URLs to scrape. Example: \['https://www.instagram.com/p/ABC123/']

## `maxPostsPerProfile` (type: `integer`):

Maximum number of posts to scrape from each profile page.

## `scrapePostsFromProfiles` (type: `boolean`):

If enabled, also scrapes post data from each profile's post grid.

## `proxyConfig` (type: `object`):

Apify proxy configuration. Residential proxies strongly recommended for Instagram.

## Actor input object example

```json
{
  "profiles": [
    "instagram"
  ],
  "postUrls": [
    "https://www.instagram.com/p/ABC123/"
  ],
  "maxPostsPerProfile": 12,
  "scrapePostsFromProfiles": true,
  "proxyConfig": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("pear_fight/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 = {}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,pear_fight/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/uHbBLX56Qb1sqokmE/builds/SRw1LrSbmaWwOpyXI/openapi.json
