# Instagram Public Profile & Post Scraper (`woundless_yellowwood/instagram-public-profile-scraper`) Actor

Public Instagram profile scraper — no login, no API key. Returns username, full name, follower / following / post counts, profile pic, external URL, private-account status, and best-effort recent posts. Private accounts always detected and skipped.

- **URL**: https://apify.com/woundless\_yellowwood/instagram-public-profile-scraper.md
- **Developed by:** [Proyecto Apify](https://apify.com/woundless_yellowwood) (community)
- **Categories:** Social media, Lead generation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

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

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 Public Profile & Post Scraper

Give it any public Instagram username and get back structured profile data — **no login, no API key, no bypassing privacy**.

### What it does

For each username or profile URL in the input, the Actor:

1. Navigates to the public profile page with an anonymous browser (Playwright + Apify residential proxy recommended).
2. Reads profile metadata from Instagram's server-rendered Open Graph tags and DOM: username, full name, follower count, following count, post count, verified flag, profile picture URL, and external website link.
3. Detects whether the account is private — if so, the profile is recorded with `isPrivate: true` and `posts: []`, and scraping stops. Private accounts are **never bypassed**.
4. If the account is public, the Actor attempts to scroll the post grid to extract up to `maxPostsPerProfile` recent posts: post URL, shortcode, caption, like count (when visible), comment count, publish date, media type (photo / video / carousel), and thumbnail URL.
5. Detects Instagram login walls / rate-limit interstitials and skips the profile with a clear `blocked: true` flag rather than crashing the run.
6. Deduplicates posts by shortcode within a single run.

#### Known limitations (Instagram platform behavior, not Actor bugs)

Instagram progressively removed anonymous access to post data during 2024. Anonymous visitors are typically served a "limited preview" page that contains the profile header but **no post grid**. When this happens, `posts` will be an empty array `[]` and `postsScraped: 0` — the profile row is still returned. Post extraction works on the rare anonymous views where Instagram serves the grid; this depends on IP reputation and is not under the Actor's control.

This is documented honestly so you can calibrate expectations: the Actor will reliably return profile-level data (username, full name, follower/following/post counts, profile picture URL, external URL, verified flag, private/public status) for any public account, and will always correctly detect and skip private accounts.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `usernames` | `array<string>` | `["natgeo"]` | List of usernames or profile URLs |
| `maxPostsPerProfile` | `integer` | `12` | Cap on posts per profile (0–100) |
| `includePostDetails` | `boolean` | `true` | If false, only profile-level data is returned |
| `resultsType` | `string` | `profiles+posts` | `profiles` (no posts array) or `profiles+posts` |
| `delayBetweenRequestsSecs` | `integer` | `3` | Randomized delay (50–150 % of value) between profiles |
| `proxyConfiguration` | `object` | `{useApifyProxy:true}` | Standard Apify proxy config |

### Output

One dataset row per profile. Example (truncated):

```json
{
  "username": "natgeo",
  "fullName": "National Geographic",
  "followerCount": 269000000,
  "followingCount": 195,
  "postCount": 32000,
  "isPrivate": false,
  "isVerified": true,
  "profilePictureUrl": "https://scontent...",
  "externalUrl": "https://www.nationalgeographic.com",
  "postsScraped": 12,
  "posts": [ { "url": "...", "shortcode": "...", "caption": "...", "likeCount": 254321, "commentCount": 1820, "publishDate": "2025-05-12T10:00:00.000Z", "mediaType": "carousel", "thumbnailUrl": "..." } ],
  "scrapedAt": "2025-07-27T12:00:00.000Z"
}
````

Private profiles produce:

```json
{ "username": "some.private.account", "isPrivate": true, "posts": [], "postsScraped": 0 }
```

### Proxy configuration

Instagram aggressively detects datacenter traffic. **Residential proxies are effectively required.** Configure via the standard `proxyConfiguration` input field:

```json
{ "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] } }
```

Without a residential proxy the Actor will typically hit Instagram's login wall immediately and report `blocked: true` for the entire run.

### Disclaimer

This Actor only reads **publicly visible, non-authenticated** data from Instagram's public web interface. It does not log in, does not use any Instagram API key or session cookie, does not access private accounts, direct messages, stories, or any content that requires authentication. Private accounts are always detected and skipped. The Actor performs **read-only** extraction: it does not like, follow, comment, or send DMs. It does not bypass Instagram's rate limits or terms of service — when Instagram blocks the run, the Actor reports the block and moves on. Use responsibly and in accordance with Instagram's Terms of Service and applicable law.

### Pricing

Pay-per-result. One profile row = one result. See the Store listing for current per-1,000-results pricing.

# Actor input Schema

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

List of Instagram usernames (e.g. 'natgeo') or full profile URLs (e.g. 'https://www.instagram.com/natgeo/'). Mixed input is supported.

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

Hard cap on how many recent posts to extract per profile. Default 12. Set to 0 to skip post extraction entirely (overrides includePostDetails).

## `includePostDetails` (type: `boolean`):

If true (default), navigate to each post page to collect caption, like count, comment count, publish date, media type and thumbnail URL. If false, only profile-level data is returned and posts are not visited.

## `resultsType` (type: `string`):

Hint for the output shape. 'profiles' returns profile rows only (no posts array). 'profiles+posts' returns profile rows with a nested posts array. Default: profiles+posts.

## `delayBetweenRequestsSecs` (type: `integer`):

Randomized delay between 50% and 150% of this value is applied between profile navigations to avoid detection. Default 3.

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

Apify ProxyConfiguration. Strongly recommended for Instagram — residential or SERP proxies dramatically reduce login-wall rate. If omitted, the actor runs without proxy (will likely hit Instagram's bot wall quickly).

## Actor input object example

```json
{
  "usernames": [
    "natgeo"
  ],
  "maxPostsPerProfile": 12,
  "includePostDetails": true,
  "resultsType": "profiles+posts",
  "delayBetweenRequestsSecs": 3,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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": [
        "natgeo"
    ]
};

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

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

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Instagram Public Profile & Post Scraper",
        "description": "Public Instagram profile scraper — no login, no API key. Returns username, full name, follower / following / post counts, profile pic, external URL, private-account status, and best-effort recent posts. Private accounts always detected and skipped.",
        "version": "0.1",
        "x-build-id": "DdSYJydcHz7Mzyy6b"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/woundless_yellowwood~instagram-public-profile-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-woundless_yellowwood-instagram-public-profile-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/woundless_yellowwood~instagram-public-profile-scraper/runs": {
            "post": {
                "operationId": "runs-sync-woundless_yellowwood-instagram-public-profile-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/woundless_yellowwood~instagram-public-profile-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-woundless_yellowwood-instagram-public-profile-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 or profile URLs",
                        "type": "array",
                        "description": "List of Instagram usernames (e.g. 'natgeo') or full profile URLs (e.g. 'https://www.instagram.com/natgeo/'). Mixed input is supported.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxPostsPerProfile": {
                        "title": "Maximum posts per profile",
                        "minimum": 0,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Hard cap on how many recent posts to extract per profile. Default 12. Set to 0 to skip post extraction entirely (overrides includePostDetails).",
                        "default": 12
                    },
                    "includePostDetails": {
                        "title": "Include per-post details",
                        "type": "boolean",
                        "description": "If true (default), navigate to each post page to collect caption, like count, comment count, publish date, media type and thumbnail URL. If false, only profile-level data is returned and posts are not visited.",
                        "default": true
                    },
                    "resultsType": {
                        "title": "Result shape",
                        "enum": [
                            "profiles",
                            "profiles+posts"
                        ],
                        "type": "string",
                        "description": "Hint for the output shape. 'profiles' returns profile rows only (no posts array). 'profiles+posts' returns profile rows with a nested posts array. Default: profiles+posts.",
                        "default": "profiles+posts"
                    },
                    "delayBetweenRequestsSecs": {
                        "title": "Delay between profiles (seconds)",
                        "minimum": 0,
                        "maximum": 60,
                        "type": "integer",
                        "description": "Randomized delay between 50% and 150% of this value is applied between profile navigations to avoid detection. Default 3.",
                        "default": 3
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Apify ProxyConfiguration. Strongly recommended for Instagram — residential or SERP proxies dramatically reduce login-wall rate. If omitted, the actor runs without proxy (will likely hit Instagram's bot wall quickly).",
                        "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
