# Instagram Scraper - Public Profile & Recent Posts (`santamaria-automations/instagram-scraper`) Actor

Scrape public Instagram profiles: bio, follower count, following count, post count, verification status, business category, external website, and up to 12 recent posts per profile with captions and engagement metrics. No login required. Pay-per-result.

- **URL**: https://apify.com/santamaria-automations/instagram-scraper.md
- **Developed by:** [NanoScrape](https://apify.com/santamaria-automations) (community)
- **Categories:** Social media, Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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 Scraper

Extract public [Instagram](https://www.instagram.com/) profile data in bulk. No API key, no login. Supply a list of usernames or profile URLs and get structured profile records back: bio, follower and following counts, verification status, business category, external website, and up to 12 recent posts per profile with captions and engagement metrics.

HTTP-only, ~128 MB RAM, pay-per-result.

### What It Does

For every public Instagram handle in the input, the actor returns one dataset row with:

- Identity: username, user_id, full_name, profile_url, profile_pic_url
- Bio: biography, external website
- Stats: follower_count, following_count, post_count
- Signals: is_verified, is_private, is_business_account, category_name
- Recent posts: up to 12 per profile, each with shortcode, caption, like_count, comment_count, media_type (image, video, carousel), media_url, posted_at, post_url

Private accounts return the profile row without post details. Not-found handles are logged and skipped. If Instagram serves an auth wall, the actor stops and logs an escalation message.

### Input

Accepts bare handles, `@handle`, or full profile URLs. Mix and match freely.

```json
{
  "usernames": [
    "example_handle",
    "@another_example",
    "https://www.instagram.com/third_example/"
  ],
  "maxPostsPerProfile": 12,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
````

#### Input Fields

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `usernames` | string\[] | Yes | - | Instagram handles or profile URLs to scrape |
| `maxPostsPerProfile` | integer | No | `12` | Recent posts per profile (0 to 12). Set to 0 to skip posts and run faster |
| `proxyConfiguration` | object | No | Auto | Apify proxy settings. Datacenter is fine for most runs |

### Output

One row per input handle, pushed to the default dataset.

```json
{
  "username": "example_handle",
  "user_id": "1234567890",
  "full_name": "Example Company",
  "biography": "Example bio for a public Instagram profile.",
  "website": "https://example.com",
  "follower_count": 125000,
  "following_count": 420,
  "post_count": 1830,
  "is_verified": true,
  "is_private": false,
  "is_business_account": true,
  "category_name": "Retail Company",
  "profile_pic_url": "https://scontent.cdninstagram.com/example.jpg",
  "posts": [
    {
      "shortcode": "CxAmpleAbc",
      "caption": "Example post caption.",
      "like_count": 1200,
      "comment_count": 34,
      "media_type": "image",
      "media_url": "https://scontent.cdninstagram.com/example_media.jpg",
      "posted_at": "2026-07-01T12:00:00Z",
      "post_url": "https://www.instagram.com/p/CxAmpleAbc/"
    }
  ],
  "profile_url": "https://www.instagram.com/example_handle/",
  "scraped_at": "2026-07-18T09:00:00Z"
}
```

`profile_url` echoes the input identifier and is safe to use as a merge key when joining back to your CRM or another actor's output.

### Pricing

Pay-per-result via Apify Pay-Per-Event billing:

| Event | Price | Description |
|-------|-------|-------------|
| Actor start | $0.001 | Charged once per run |
| Profile scraped | $0.005 | Charged per profile row returned |

Scraping 1,000 profiles costs about $5. No monthly fees, no minimum spend.

### Use with AI Agents (MCP)

Connect this actor to any MCP-compatible AI client: Claude Desktop, Claude.ai, Cursor, VS Code, LangChain, LlamaIndex, or custom agents.

Apify MCP server URL:

```
https://mcp.apify.com?tools=santamaria-automations/instagram-scraper
```

Example prompt once connected:

> "Use `instagram-scraper` to fetch the profile and last 12 posts for two example handles. Return a table with username, follower count, verification status, and each post's like count and caption."

Clients that support dynamic tool discovery (Claude.ai, VS Code) receive the full input schema automatically via `add-actor`.

### Tips

- Bare handles run fastest. If you pass full URLs the actor strips them down to the handle for you.
- Set `maxPostsPerProfile` to `0` when you only need profile stats. Cuts response size and speeds up big runs.
- Every handle is scraped once per run even if it appears multiple times in the input list.
- Datacenter proxy is fine for most cases. Switch to residential only if you see rate limits at higher volumes.

### FAQ

**What does "public profile" mean?**
Instagram profiles set to public are visible without logging in. This actor can only scrape public accounts. Private accounts return profile stats but no post details.

**What happens if a handle does not exist?**
The actor logs a warning for that handle and continues. Not-found handles are not written to the dataset.

**What if Instagram requires login?**
If Instagram's authentication wall is encountered the actor stops immediately and logs an escalation. This can happen when Instagram temporarily enforces login for unauthenticated requests.

**Are results deduplicated?**
Each handle is scraped once per run regardless of how many times it appears in the input.

### Related Actors

Discovery:

- [Google Maps Scraper](https://apify.com/santamaria-automations/google-maps-scraper) - collect places and companies in bulk
- [Website Email Scraper](https://apify.com/santamaria-automations/website-email-scraper) - pull emails, phones and social handles from company sites

Enrichment:

- [LinkedIn Company Scraper](https://apify.com/santamaria-automations/linkedin-company-scraper) - enrich companies with LinkedIn data
- [AI Icebreaker Generator](https://apify.com/santamaria-automations/ai-icebreaker) - one personalized cold-outreach line per business
- [GBP Completeness Audit](https://apify.com/santamaria-automations/gbp-completeness-audit) - score Google Business Profiles for lead prioritization

### Issues & Feature Requests

If a field is missing or looks off for a given profile, open an issue on the actor's Issues tab and we will take a look.

# Actor input Schema

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

List of public Instagram usernames or profile URLs to scrape. Accepts bare usernames ('example\_handle'), '@example\_handle', or full URLs like 'https://www.instagram.com/example\_handle/'.

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

Maximum number of recent posts to include per profile. Set to 0 to return profile data only (no posts). Default is 12.

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

Apify proxy settings. Datacenter proxies are used by default.

## Actor input object example

```json
{
  "usernames": [
    "example_handle",
    "another_example"
  ],
  "maxPostsPerProfile": 12,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `defaultDataset` (type: `string`):

Dataset containing scraped Instagram profile records with bio, stats, and recent posts.

# 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": [
        "example_handle",
        "another_example"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("santamaria-automations/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 = { "usernames": [
        "example_handle",
        "another_example",
    ] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=santamaria-automations/instagram-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Instagram Scraper - Public Profile & Recent Posts",
        "description": "Scrape public Instagram profiles: bio, follower count, following count, post count, verification status, business category, external website, and up to 12 recent posts per profile with captions and engagement metrics. No login required. Pay-per-result.",
        "version": "1.0",
        "x-build-id": "mM5dSSnuzXlEdL9ts"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/santamaria-automations~instagram-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-santamaria-automations-instagram-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/santamaria-automations~instagram-scraper/runs": {
            "post": {
                "operationId": "runs-sync-santamaria-automations-instagram-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/santamaria-automations~instagram-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-santamaria-automations-instagram-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "usernames"
                ],
                "properties": {
                    "usernames": {
                        "title": "Instagram Usernames",
                        "type": "array",
                        "description": "List of public Instagram usernames or profile URLs to scrape. Accepts bare usernames ('example_handle'), '@example_handle', or full URLs like 'https://www.instagram.com/example_handle/'.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxPostsPerProfile": {
                        "title": "Max Recent Posts per Profile",
                        "minimum": 0,
                        "maximum": 12,
                        "type": "integer",
                        "description": "Maximum number of recent posts to include per profile. Set to 0 to return profile data only (no posts). Default is 12.",
                        "default": 12
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Apify proxy settings. Datacenter proxies are used by default.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
