# Instagram Scraper — Profiles, Posts, Reels, Hashtags & Comments (`bliss_nathan/instagram-scraper`) Actor

Extract Instagram user profiles, post captions, reel video links, hashtag feeds, like counts, and public comments.

- **URL**: https://apify.com/bliss\_nathan/instagram-scraper.md
- **Developed by:** [Samuel Blessed Nathaniel](https://apify.com/bliss_nathan) (community)
- **Categories:** 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/actors/running/actors-in-store.md#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.

- **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, Post, Reel & Hashtag Scraper

Fast, reliable, and comprehensive Instagram Scraper for profiles, posts, reels, hashtags, and engagement metrics.

### 🚀 Features

- **Profile Scraping**: Extract follower counts, following counts, post counts, bio, external URLs, verified status, and profile pictures.
- **Posts & Reels Scraping**: Retrieve post shortcodes, captions, likes count, comments count, image URLs, video URLs, and timestamps.
- **Hashtag Feeds**: Scrape total post counts and top/recent media for any hashtag.
- **Dual Engine**: Uses fast HTTP Web APIs for maximum speed and Playwright headless browser fallback for anti-bot resilience.
- **Session Cookie Support**: Pass optional `sessionid` cookie to scrape protected profiles or higher volume limits.

***

### 📥 Input Configuration

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `directUrls` | Array | `["https://www.instagram.com/instagram/"]` | List of Instagram URLs (profile, post, or hashtag). |
| `usernames` | Array | `[]` | List of usernames to scrape (e.g. `["natgeo", "nike"]`). |
| `hashtags` | Array | `[]` | List of hashtags without `#` (e.g. `["travel", "nature"]`). |
| `resultsLimit` | Integer | `10` | Max posts per profile/hashtag. |
| `sessionCookie` | String | `""` | Optional Instagram `sessionid` cookie for session auth. |
| `proxyConfiguration` | Object | `{}` | Apify Proxy configuration. |

#### Example Input JSON

```json
{
  "usernames": ["natgeo", "nike"],
  "hashtags": ["photography"],
  "resultsLimit": 15,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

***

### 📤 Sample Output JSON

```json
{
  "type": "profile",
  "id": "25025320",
  "username": "instagram",
  "fullName": "Instagram",
  "biography": "Discover what's next on Instagram ✨",
  "externalUrl": "https://linktr.ee/instagram",
  "followersCount": 672000000,
  "followsCount": 82,
  "postsCount": 7820,
  "isVerified": true,
  "isPrivate": false,
  "profilePicUrl": "https://instagram.fcc.fbcdn.net/...",
  "posts": [
    {
      "id": "31284910239",
      "shortcode": "C123abc",
      "url": "https://www.instagram.com/p/C123abc/",
      "caption": "Exploring new horizons 🌅 #travel",
      "likesCount": 142300,
      "commentsCount": 1280,
      "displayUrl": "https://scontent.cdninstagram.com/...",
      "isVideo": false,
      "timestamp": "2026-08-15T14:20:00.000Z"
    }
  ]
}
```

***

### 💡 Recommended Store Pricing

- **Pay Per Result**: $2.00 / 1,000 results
- **Monthly Subscription**: $25/month base tier

***

### 🔒 License

Apache-2.0

# Actor input Schema

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

List of direct Instagram URLs (profile, post, reel, or hashtag page).

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

List of Instagram usernames (e.g., 'instagram', 'natgeo').

## `hashtags` (type: `array`):

List of hashtags without # symbol (e.g., 'travel', 'foodie').

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

Maximum items to collect per profile/hashtag.

## `sessionCookie` (type: `string`):

Optional sessionid cookie value from Instagram browser session to bypass login walls.

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

Apify Proxy settings (Residential proxies recommended for Instagram).

## Actor input object example

```json
{
  "directUrls": [
    "https://www.instagram.com/instagram/"
  ],
  "resultsLimit": 10
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "directUrls": [
        "https://www.instagram.com/instagram/"
    ]
};

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

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

```

## MCP server setup

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