# Instagram Profile Scraper (`scrapeai/instagram-profile-scraper`) Actor

Scrape all Instagram profile info. Just add Instagram usernames, IDs or URLs and extract name, join date, number of followers, location, bio, website, related profiles, video\&post count, latest posts. Export scraped data, schedule scraper via API, and integrate with other tools or AI workflows.

- **URL**: https://apify.com/scrapeai/instagram-profile-scraper.md
- **Developed by:** [ScrapeAI](https://apify.com/scrapeai) (community)
- **Categories:** Social media, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

Scrape full Instagram profile information automatically. Just input Instagram usernames, account IDs, or profile URLs to extract comprehensive metrics including full name, join date, number of followers & following, location, bio, external website URL, related profiles, video & post counts, and latest posts.

Export scraped profile datasets in **JSON**, **CSV**, **Excel**, **HTML**, or **XML** formats, schedule automatic runs via the Apify API, and seamlessly integrate with AI workflows, CRM pipelines, and lead generation systems.

***

### 🌟 Key Features

- 👤 **Complete Profile Intelligence**: Extract name, bio, profile avatar, verified badge, and account privacy status.
- 📅 **Account Metadata & History**: Access approximate join date, registered location, and account website.
- 📊 **Audience & Activity Metrics**: Get exact follower counts, following count, total post count, and total video/reel count.
- 🔗 **Related Profiles Discovery**: Scrape recommended and related Instagram profile handles for audience overlap analysis.
- 📸 **Latest Posts Extraction**: Retrieve recent post items per profile including shortcodes, URLs, captions, likes, comments, and video view counts.
- ⚡ **Dynamic Output Datasets**: Real-time structured data output formatted dynamically according to your input parameters.
- 🔄 **API & Automation Ready**: Trigger via REST API, Webhooks, Python, JavaScript, or Zapier/Make integrations.

***

### 📥 Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `usernames` | `array` | `["instagram", "zuck"]` | List of Instagram handles or usernames to scrape. |
| `directUrls` | `array` | `["https://www.instagram.com/instagram/"]` | List of direct Instagram profile links or URLs. |
| `resultsLimit` | `integer` | `20` | Maximum number of profile records to extract. |
| `includeLatestPosts` | `boolean` | `true` | Include recent published posts per profile. |
| `latestPostsLimit` | `integer` | `5` | Number of recent posts to include per profile. |
| `proxyConfiguration` | `object` | `{ "useApifyProxy": true }` | Proxy configuration settings for residential or datacenter IP routing. |
| `debugLog` | `boolean` | `false` | Enable verbose logging for debugging. |

#### Example Input (`input.json`)

```json
{
  "usernames": [
    "instagram",
    "zuck",
    "cristiano"
  ],
  "directUrls": [
    "https://www.instagram.com/leomessi/"
  ],
  "resultsLimit": 10,
  "includeLatestPosts": true,
  "latestPostsLimit": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "debugLog": false
}
```

***

### 📤 Output Data Format

Each item in the dataset represents a single extracted Instagram profile.

```json
{
  "id": "user_19827394",
  "username": "zuck",
  "fullName": "Mark Zuckerberg",
  "url": "https://www.instagram.com/zuck/",
  "biography": "Official Instagram profile for Mark Zuckerberg. Creator, innovator, and storyteller. 📸 ✨",
  "externalUrl": "https://zuck.com",
  "followersCount": 14250000,
  "followsCount": 620,
  "postsCount": 890,
  "videoCount": 210,
  "joinDate": "Oct 2012",
  "location": "Palo Alto, CA",
  "isVerified": true,
  "isPrivate": false,
  "profilePicUrl": "https://instagram.com/zuck/avatar.jpg",
  "hdProfilePicUrl": "https://instagram.com/zuck/avatar_hd.jpg",
  "relatedProfiles": [
    {
      "username": "creator_zuck",
      "fullName": "CREATOR ZUCK",
      "url": "https://www.instagram.com/creator_zuck/",
      "isVerified": true,
      "profilePicUrl": "https://instagram.com/creator_zuck/avatar.jpg"
    }
  ],
  "latestPosts": [
    {
      "id": "post_C9K8X2M",
      "shortCode": "C9K8X2M",
      "url": "https://www.instagram.com/p/C9K8X2M/",
      "type": "Reel",
      "caption": "Latest update from @zuck #zuck #palo",
      "likesCount": 420000,
      "commentsCount": 18200,
      "videoViewCount": 1680000,
      "displayUrl": "https://instagram.com/p/C9K8X2M/media_1.jpg",
      "timestamp": "2026-08-03T10:00:00.000Z"
    }
  ],
  "scrapedAt": "2026-08-06T15:10:00.000Z"
}
```

***

### ⏰ Scheduling & API Integration

You can trigger the scraper programmatically using Apify's API or Webhooks:

#### Node.js / JavaScript SDK

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor('instagram-profile-scraper').call({
    usernames: ['instagram', 'zuck'],
    resultsLimit: 10,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python SDK

```python
from apify_client import ApifyClient

client = ApifyClient('YOUR_APIFY_TOKEN')

run = client.actor('instagram-profile-scraper').call(run_input={
    'usernames': ['instagram', 'zuck'],
    'resultsLimit': 10,
})

for item in client.dataset(run['defaultDatasetId']).iterate_items():
    print(item)
```

***

### 🤖 AI Workflows & LLM Automation

- **Brand & Creator Audit**: Feed extracted follower ratios, bios, and engagement stats into LLMs (GPT-4 / Claude / Gemini) for automated influencer vetting.
- **Lead Generation & Enrichment**: Match Instagram profiles with domain websites (`externalUrl`) and locations for outreach campaigns.
- **Competitor Tracking**: Schedule weekly automated runs to monitor changes in follower counts, post frequencies, and related account recommendations.

***

### 💡 Best Practices

- Use **Apify Residential Proxies** for large-scale profile scraping to bypass geo-blocks and rate limits.
- Set `includeLatestPosts: false` if you only require profile header information to speed up execution.
- Utilize dataset webhook notifications to automatically push newly scraped profile records to your web server or database.

# Actor input Schema

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

List of Instagram usernames or handles to scrape (e.g. \["instagram", "zuck", "cristiano"]).

## `directUrls` (type: `array`):

List of direct Instagram profile, post, or user URLs.

## `resultsLimit` (type: `integer`):

Maximum number of profiles to scrape.

## `includeLatestPosts` (type: `boolean`):

Whether to extract latest posts for each scraped profile.

## `latestPostsLimit` (type: `integer`):

Number of recent posts to extract per profile.

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

Select Apify Proxy or custom proxies to avoid rate limiting.

## `debugLog` (type: `boolean`):

Enable detailed verbose debug logging.

## Actor input object example

```json
{
  "usernames": [
    "instagram",
    "zuck"
  ],
  "directUrls": [
    "https://www.instagram.com/instagram/"
  ],
  "resultsLimit": 20,
  "includeLatestPosts": true,
  "latestPostsLimit": 5,
  "debugLog": false
}
```

# Actor output Schema

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

Dataset containing scraped Instagram profile details and metrics.

# 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("scrapeai/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 = {}

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

```

## MCP server setup

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