# Instagram Scraper: Profiles, Posts, Reels & Comments (`pnda/instagram-scraper`) Actor

Scrape public Instagram profiles, posts, reels and comments by URL or username: followers, bio, public business email, likes, comments, views, hashtags, captions. No login, no cookies. Pay per result.

- **URL**: https://apify.com/pnda/instagram-scraper.md
- **Developed by:** [PNDA](https://apify.com/pnda) (community)
- **Categories:** Social media, For creators, Marketing
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.40 / 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?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Instagram Scraper: Profiles, Posts, Reels & Comments

Scrape public Instagram profiles, posts, reels and comments by URL or username: followers, bio, public business email, likes, comments, views, hashtags, captions. No login, no cookies. Pay per result.

### What you can scrape

| Mode | What | Input | Results |
|---|---|---|---|
| `profiles` | Profiles (by URL) | Instagram URLs in `urls` | one per input |
| `profilesByUsername` | Profiles (by username) | keywords / usernames in `queries` | one per input |
| `posts` | Posts of profiles | Instagram URLs in `urls` | several per input |
| `postDetails` | Posts (by post URL) | Instagram URLs in `urls` | one per input |
| `comments` | Comments of posts | Instagram URLs in `urls` | several per input |

Every result is the full public record: all the fields Instagram shows publicly, cleaned and flattened for JSON, CSV or Excel export.

### How to use it

1. Pick a mode in **What to scrape**.
2. Paste URLs, or type keywords / usernames.
3. Set **Max results per URL / keyword** and **Max results in total**, then run.

Input example:

```json
{
  "mode": "profiles",
  "urls": [
    "https://www.instagram.com/nasa/"
  ],
  "maxResults": 100
}
```

### Pricing

Pay per result: **$2.40 per 1,000 results**, plus $0.005 per run.

- Inputs that are private, deleted, not found or that fail are **free**.
- The run never fetches more than your **maximum cost per run** can pay for, so you never get a surprise bill.
- Free Apify plan: up to 20 results per run.

### Why this scraper

- **No login, no cookies, no account at risk.** Public data only.
- **Reliable:** temporary blocks (rate limits, captchas, timeouts) are retried automatically.
- **Predictable cost:** limits are applied before scraping, not after.
- **API ready:** call it from Python, JavaScript, Make, Zapier, n8n or any HTTP client.

### FAQ

**Is it legal?** It collects only data that Instagram shows publicly to any visitor. You are responsible for how you use the data (GDPR, CCPA, Instagram terms).

**What if a URL is private, deleted or not found?** You get no result for it and you are not charged.

**Can I schedule it?** Yes, with Apify schedules, and send results to Google Sheets, Slack or a webhook.

# Actor input Schema

## `mode` (type: `string`):

Choose what to collect from Instagram.

## `urls` (type: `array`):

For: Profiles (by URL), Posts of profiles, Posts (by post URL), Comments of posts. Paste Instagram URLs (one per line).

## `queries` (type: `array`):

For: Profiles (by username). One keyword or username per line (without @).

## `maxResultsPerInput` (type: `integer`):

For modes that return several items per input (posts of a profile, comments of a post, keyword search).

## `maxResults` (type: `integer`):

Hard limit on the number of results (and on the cost) of the run.

## Actor input object example

```json
{
  "mode": "profiles",
  "urls": [
    "https://www.instagram.com/nasa/"
  ],
  "maxResultsPerInput": 20,
  "maxResults": 200
}
```

# Actor output Schema

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

All records (JSON, CSV, Excel).

# 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 = {
    "mode": "profiles",
    "urls": [
        "https://www.instagram.com/nasa/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("pnda/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 = {
    "mode": "profiles",
    "urls": ["https://www.instagram.com/nasa/"],
}

# Run the Actor and wait for it to finish
run = client.actor("pnda/instagram-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 '{
  "mode": "profiles",
  "urls": [
    "https://www.instagram.com/nasa/"
  ]
}' |
apify call pnda/instagram-scraper --silent --output-dataset

```

## MCP server setup

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