# Instagram Post Scraper (`muhammad_noman_riaz/instagram-post-super-scraper`) Actor

Caption, likes, comment count, date, images, video URL, hashtags, mentions and top comments from public Instagram profiles and post URLs. No login needed. Date filter and per-profile limit included.

- **URL**: https://apify.com/muhammad_noman_riaz/instagram-post-super-scraper.md
- **Developed by:** [Muhammad Noman Riaz](https://apify.com/muhammad_noman_riaz) (community)
- **Categories:** Social media, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 144 total users, 1 monthly users, 100.0% runs succeeded, 3 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.50 / 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 Post Scraper

Scrape posts from public Instagram profiles, or single posts and reels by URL. No Instagram login is needed: the actor reads the same data Instagram shows to logged-out visitors, through residential proxies.

### What does Instagram Post Scraper do?

Instagram Post Scraper collects posts from public Instagram profiles, and single posts or reels from their URLs, without an Instagram login. For each post it returns the caption, hashtags, mentions, like and comment counts, publish date, post type, image and video URLs, video duration, music info for reels, carousel items, the owner's username and name, and the first comments Instagram shows on the post. You can limit how many posts each profile returns and keep only posts newer than a date such as 2025-01-01 or 30 days. It reads the same data Instagram shows to logged-out visitors through rotating residential proxies, retries on a new IP when a request is blocked, and pushes only complete posts, so you never pay for empty rows. Results export to JSON, CSV or Excel, or come back through the Apify API and MCP server. It suits brand monitoring, competitor research, influencer vetting and content analysis.

### What you get without cookies

For each post:

- `id`, `shortCode`, `url`, `type` (Image, Video or Sidecar), `productType`
- `caption`, `hashtags`, `mentions`, `alt`
- `likesCount`, `commentsCount`, `timestamp`
- `displayUrl`, `images`, `dimensionsHeight`, `dimensionsWidth`
- `videoUrl` and `videoDuration` for videos, `musicInfo` for reels
- `childPosts` for carousels
- `ownerUsername`, `ownerFullName`, `ownerId`
- `latestComments` and `firstComment`: the first comments Instagram shows on the post, with text, author, likes and date

Profiles are paginated 12 posts at a time, so `resultsLimit` works beyond the first page. In local tests a profile returned posts from the second page without cookies.

Limits without cookies:

- `videoViewCount` and `videoPlayCount` are `null`. Instagram does not show view counts on single posts to logged-out visitors. The Instagram Reels Scraper does return play counts.
- Comments come from the first batch Instagram shows, about 15 per post, so `maxComments` above 15 has no extra effect.
- Pinned posts cannot be detected, so `skipPinnedPosts` only works with cookies. Pinned posts show up first and can be older than the rest.
- `isSponsored` is always `false` because the paid partnership flag is not shown to logged-out visitors.
- Private profiles and posts hidden from logged-out visitors (for example age-restricted posts) are skipped and listed in `FAILED_ITEMS`.
- Every post costs one request to load its details, so large limits take longer.

### With your cookies (optional)

If you paste cookies from your own Instagram account, the actor uses Instagram's logged-in feed instead. It marks pinned posts, so `skipPinnedPosts` works. This path was not tested in the current version, so prefer running without cookies unless the logged-out mode is blocked for you.

### Input

| Field | Required | Description |
|-------|----------|-------------|
| `username` | Yes | Usernames, profile URLs, or post and reel URLs |
| `resultsLimit` | No | Max posts per profile, default 200 |
| `onlyPostsNewerThan` | No | A date like `2025-01-01` or a relative value like `7 days` |
| `skipPinnedPosts` | No | Only with cookies |
| `maxComments` | No | Max comments per post, default 10 |
| `cookies` | No | Your own Instagram cookies, see below |
| `proxy` | No | Defaults to Apify residential proxy |
| `maxConcurrency` | No | Inputs scraped in parallel, default 5 |
| `maxRequestRetries` | No | Retries per request on a new IP, default 6 |

```json
{
  "username": ["natgeo", "https://www.instagram.com/p/Defago5DWAD/"],
  "resultsLimit": 50,
  "onlyPostsNewerThan": "30 days",
  "maxComments": 10
}
```

### Output example

```json
{
  "id": "4008038785522425859",
  "type": "Image",
  "shortCode": "Defago5DWAD",
  "caption": "Photographer Michael Seeley (@mseeley20) used a single 426-second exposure...",
  "hashtags": [],
  "mentions": ["mseeley20"],
  "url": "https://www.instagram.com/p/Defago5DWAD/",
  "commentsCount": 612,
  "likesCount": 154385,
  "timestamp": "2026-10-14T12:44:46.000Z",
  "ownerFullName": "National Geographic",
  "ownerUsername": "natgeo",
  "ownerId": "787132",
  "inputUrl": "https://www.instagram.com/p/Defago5DWAD/"
}
```

### Reliability

Every request goes through a fresh residential IP if the previous one is blocked or rate-limited, up to `maxRequestRetries` times. Only complete posts are pushed to the dataset. Inputs that fail or stop early are listed with the reason in the `FAILED_ITEMS` record of the key-value store, and the run's status message shows the totals.

### How to get your Instagram cookies

Cookies are optional. Only add them if you need what the "With your cookies" section above lists.

**Use a secondary Instagram account, not your main one.** Instagram can rate-limit or temporarily lock accounts that make many requests.

#### Option 1: Chrome or Edge developer tools

1. Log in to [instagram.com](https://www.instagram.com) with your secondary account.
2. Press F12 to open developer tools.
3. Open the **Application** tab, then **Cookies**, then `https://www.instagram.com`.
4. Copy the values of `sessionid`, `ds_user_id` and `csrftoken`.
5. Paste them into the cookies field in this format:

```
sessionid=YOUR_SESSIONID; ds_user_id=YOUR_DS_USER_ID; csrftoken=YOUR_CSRFTOKEN
```

#### Option 2: Cookie-Editor extension

1. Install the Cookie-Editor extension for your browser.
2. Log in to instagram.com, open Cookie-Editor and click **Export**, then **Export as JSON**.
3. Paste the whole JSON into the cookies field.

The actor checks the format before it starts and stops with a clear message if `sessionid`, `ds_user_id` or `csrftoken` is missing. Cookie values are never written to the log.

#### Keep them safe and fresh

- Cookies work like a password. Anyone who has them can act as that account. Do not share them or put them in public tasks or shared inputs. The field is stored as a secret on Apify.
- Cookies expire, and logging out of Instagram ends them immediately. If runs start failing with "your cookies may have expired", log in again in your browser and copy fresh cookies.
- Heavy use can get the account rate-limited. If that happens, wait a few hours or use a different secondary account.

### FAQ

#### Do I need an Instagram account or cookies?

No. It works without a login. Cookies from your own secondary account are optional and only add pinned post detection.

#### How many posts can I get from one profile?

Set `resultsLimit`. The actor pages through the profile 12 posts at a time until it reaches the limit, the date filter or the end of the profile.

#### Why is `videoViewCount` empty?

Instagram does not show view counts on single posts to logged-out visitors. Use the [Instagram Reels Scraper](https://apify.com/muhammad_noman_riaz/instagram-reels-super-scraper), which returns play counts from the reels tab.

#### Can it scrape private profiles?

No. Private profiles and posts hidden from logged-out visitors are skipped and listed in `FAILED_ITEMS`, and they are not charged.

#### What am I charged for?

Each post pushed to the dataset is one result. Failed inputs and skipped posts are not charged. See the Pricing tab for the current price.

### Legal

Only public data is collected. You are responsible for using it in line with Instagram's terms and data protection laws such as GDPR.

# Actor input Schema

## `username` (type: `array`):

Public Instagram usernames, profile URLs, or post and reel URLs.

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

How many posts to extract from each profile. Does not apply to post URLs.

## `onlyPostsNewerThan` (type: `string`):

A date like 2025-01-01 or a relative value like "7 days", "2 months" or "1 year".

## `skipPinnedPosts` (type: `boolean`):

Only works with cookies. Instagram does not mark pinned posts for logged-out visitors.

## `maxComments` (type: `integer`):

Comments are taken from the first batch Instagram shows on the post, about 15 without cookies.

## `cookies` (type: `string`):

Not needed for public posts. Paste cookies from a secondary Instagram account to detect pinned posts and use Instagram's logged-in feed. Accepts "sessionid=...; ds_user_id=...; csrftoken=..." or the JSON exported by the Cookie-Editor extension. See "How to get your Instagram cookies" in the README. Treat cookies like a password.

## `proxy` (type: `object`):

Residential proxies work best. Each retry uses a new IP.

## `maxConcurrency` (type: `integer`):

How many inputs to scrape in parallel.

## `maxRequestRetries` (type: `integer`):

How many times a blocked or failed request is retried on a new IP before the input is skipped.

## Actor input object example

```json
{
  "username": [
    "natgeo",
    "https://www.instagram.com/natgeo/",
    "https://www.instagram.com/p/Defago5DWAD/"
  ],
  "resultsLimit": 50,
  "onlyPostsNewerThan": "7 days",
  "skipPinnedPosts": false,
  "maxComments": 10,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "maxConcurrency": 5,
  "maxRequestRetries": 6
}
```

# Actor output Schema

## `posts` (type: `string`):

The dataset containing all scraped Instagram 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 = {
    "username": [
        "natgeo"
    ],
    "resultsLimit": 50,
    "proxy": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammad_noman_riaz/instagram-post-super-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 = {
    "username": ["natgeo"],
    "resultsLimit": 50,
    "proxy": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("muhammad_noman_riaz/instagram-post-super-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 '{
  "username": [
    "natgeo"
  ],
  "resultsLimit": 50,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call muhammad_noman_riaz/instagram-post-super-scraper --silent --output-dataset

```

## MCP server setup

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