# Instagram Scraper — Profiles, Posts & Engagement Data (`lanky_quantifier/instagram-profile-scraper`) Actor

Extract Instagram profiles, posts, and engagement data without API keys. Get bio, follower count, posts with likes and comments. Export JSON/CSV. Bundle: 30 scrapers at vhubster3.gumroad.com/l/fjmtqn

- **URL**: https://apify.com/lanky\_quantifier/instagram-profile-scraper.md
- **Developed by:** [Vhub Systems](https://apify.com/lanky_quantifier) (community)
- **Categories:** Social media, Automation
- **Stats:** 88 total users, 4 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $50.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/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

## Instagram Profile Scraper

Scrape Instagram public profile data including follower counts, bios, and recent posts — no account required for public profiles.

**Followers · Following · Post count · Bio · Recent posts with likes & comments · Business category**

***

### What You Get

- ✅ Username, full name, biography, and external URL
- ✅ Follower count, following count, total post count
- ✅ Verified status and business account flag with category
- ✅ Profile picture URL (high resolution)
- ✅ Recent posts: image URL, caption, like count, comment count, timestamp
- ✅ Reels support (toggle on/off)
- ✅ Three-layer fallback: Instagram API → embedded JSON → OG meta tags
- ✅ Login wall detection so you know when a session cookie is needed

***

### Use Cases

#### 📊 Influencer Discovery & Analytics

Collect follower counts and engagement data from hundreds of creator accounts for influencer marketing research.

```json
{
  "usernames": ["natgeo", "nasa", "bbcnews"],
  "maxPosts": 12,
  "includeReels": false
}
```

#### 🏆 Competitor Benchmarking

Track competitor brand accounts weekly — follower growth, post frequency, and top-performing content.

#### 🎯 Lead Generation for Agencies

Find businesses in a niche by filtering on `isBusinessAccount: true` and `category`, then collect their external URLs as outreach leads.

#### 📱 Social Media Research

Analyze posting patterns, caption length, and engagement rates across accounts in a vertical for academic or market research.

#### 🤝 Partnership Identification

Find micro-influencers (10K–100K followers) by scraping accounts and filtering by follower range in your downstream tool.

***

### Quick Start

1. Click **Try for free** above
2. Enter Instagram usernames in the **Usernames** field (plain usernames or full profile URLs)
3. Set **maxPosts** to control how many recent posts to collect per profile (default 12)
4. Optionally toggle **includeReels** to include video reels
5. Run and export as JSON or CSV

*For profiles that trigger a login wall: add your Instagram `sessionid` cookie value to the **sessionCookie** field to unlock full data.*

***

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `usernames` | `string[]` | required | Usernames or full Instagram profile URLs |
| `maxPosts` | `number` | `12` | Max recent posts to collect per profile |
| `includeReels` | `boolean` | `false` | Include video reels in post results |
| `sessionCookie` | `string` | — | Your Instagram `sessionid` cookie for authenticated access |

***

### Output JSON Example

```json
{
  "username": "natgeo",
  "fullName": "National Geographic",
  "biography": "The world's premium destination for science, exploration, and adventure.",
  "profilePicUrl": "https://scontent.cdninstagram.com/...",
  "externalUrl": "https://www.nationalgeographic.com/",
  "followers": 283000000,
  "following": 154,
  "postsCount": 31200,
  "isVerified": true,
  "isPrivate": false,
  "isBusinessAccount": true,
  "category": "Media/News Company",
  "source": "api",
  "scrapedAt": "2025-01-15T10:23:44.000Z",
  "recentPosts": [
    {
      "postId": "3284710293847",
      "shortcode": "C8xYzABCDEF",
      "imageUrl": "https://scontent.cdninstagram.com/...",
      "caption": "The Milky Way rises over ancient ruins...",
      "likes": 84321,
      "comments": 412,
      "timestamp": "2025-01-14T18:30:00.000Z",
      "isVideo": false,
      "url": "https://www.instagram.com/p/C8xYzABCDEF/"
    }
  ]
}
```

***

### Pricing

| Volume | Estimated cost |
|--------|---------------|
| 10 profiles | ~$0.01 |
| 100 profiles with posts | ~$0.10 |
| 1,000 profiles | ~$0.80 |

*Apify free tier includes $5/month of compute.*

***

### Why This Scraper

**Three-layer extraction strategy.** The actor tries Instagram's internal API first (fastest, most data), falls back to embedded page JSON, then extracts from OpenGraph meta tags. You get data even when Instagram updates its page structure.

**No account needed for public profiles.** Most public business and creator accounts work without any credentials.

**Session cookie support for full data.** When Instagram shows a login wall, provide your `sessionid` cookie to unlock complete profile data and post lists.

**Automatic URL normalization.** Pass `https://www.instagram.com/natgeo/` or just `natgeo` — both work identically.

**Login wall detection.** The output includes a `loginWallDetected` field so you know exactly which profiles need a session cookie.

***

### FAQ

**Q: Can I scrape private Instagram accounts?**
A: No. Private accounts require you to be an approved follower. Even with a session cookie, private account data is not accessible.

**Q: Do I need to provide Instagram cookies?**
A: Not for public profiles. For profiles behind a login wall, add your `sessionid` cookie in the input.

**Q: How many posts can I collect per profile?**
A: Up to 12 posts per profile without authentication. With a session cookie the limit is higher.

**Q: What is the `source` field in the output?**
A: It shows how data was collected: `api` (Instagram internal API), `embedded_json` (page JavaScript data), `og_meta` (OpenGraph tags), or `login_wall` (blocked).

**Q: Does this collect the profile picture in high resolution?**
A: Yes — when available, the actor fetches the HD variant (`profile_pic_url_hd`) rather than the standard thumbnail.

***

⭐ If this actor saves you time, please leave a review — it helps other developers find it.

# Actor input Schema

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

List of Instagram usernames or profile URLs.

## `maxPosts` (type: `integer`):

The maximum number of recent posts to scrape per profile.

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

Whether to include Reels in the posts results.

## `sessionCookie` (type: `string`):

Instagram sessionid cookie value for authenticated access. Without it, Instagram shows a login wall and only limited data can be extracted. To get it: log into Instagram in your browser, open DevTools > Application > Cookies > instagram.com > copy the 'sessionid' value.

## Actor input object example

```json
{
  "profiles": [
    "apifytech"
  ],
  "maxPosts": 12,
  "includeReels": 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 = {
    "profiles": [
        "apifytech"
    ]
};

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

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

```

## MCP server setup

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