# 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:** 3 total users, 2 monthly users, 85.7% 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 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 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 and profiles that trip Instagram's auth wall are logged and skipped so the rest of the batch keeps running. The actor only fails hard if every attempted profile is blocked.

### 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 | Residential | Apify proxy settings. Residential is the default because Instagram's API blocks most datacenter IPs |

### 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.
- Residential proxy is the default and works reliably. Datacenter IPs are almost always blocked by Instagram's API — override only if you have a specific reason.

### 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?**
Individual profiles that hit Instagram's auth wall are skipped with a warning so the rest of the batch still completes. The actor only fails if every profile in the run is blocked — in that case retry later or switch to a different proxy group.

**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 ('nasa'), '@nasa', or full URLs like 'https://www.instagram.com/nasa/'.

## `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. Residential proxies are used by default because Instagram's API blocks most datacenter IPs.

## Actor input object example

```json
{
  "usernames": [
    "nasa",
    "nike"
  ],
  "maxPostsPerProfile": 12,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

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

// 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": [
        "nasa",
        "nike",
    ] }

# 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": [
    "nasa",
    "nike"
  ]
}' |
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

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