# Instagram User Post Scraper API (`futurizerush/instagram-user-post-scraper-api`) Actor

Collect posts from any public Instagram account — including captions, likes, comments, media type, location, tagged users, and more. Requires an Instagram Session ID. (Beta)

- **URL**: https://apify.com/futurizerush/instagram-user-post-scraper-api.md
- **Developed by:** [Rush](https://apify.com/futurizerush) (community)
- **Categories:** Social media, AI, Agents
- **Stats:** 32 total users, 5 monthly users, 7.2% runs succeeded, 2 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 User Post Scraper API

Collect posts from any public Instagram account — including captions, likes, comments, media type, location, tagged users, music, and more. Process multiple accounts in a single run.

### Features

- **Full post data** — captions, hashtags, mentions, media URLs, engagement counts, and rich metadata for every post
- **Profile summary** — a profile row per account with name, bio, follower/following/post counts, and verified/business flags
- **All media types** — images, videos, and carousels, with every carousel slide URL
- **Reels details** — video views, duration, audio flag, and music attribution
- **Multiple accounts** — process several usernames in a single run
- **Progressive results** — posts are saved as they are collected, and the run resumes after a platform restart

### What does Instagram User Post Scraper API do?

This Actor collects all accessible posts from any public [Instagram](https://www.instagram.com) user and returns detailed data for each one. You can process multiple usernames in a single run.

For each user, the Actor first returns a **profile summary row** followed by **individual post rows** — one per post.

#### Data you can extract

For the source user (profile row):

- **Identity** — username, full name, biography, bio link (external URL)
- **Stats** — follower count, following count, total post count
- **Status** — verified badge, private account flag, business/creator account flag, account category
- **Media** — profile picture
- **Links** — profile URL

For each post:

- **Content** — caption, hashtags, mentions
- **Media** — media type (image/video/carousel), media URL, all carousel slide URLs
- **Engagement** — like count, comment count
- **Video** — view count, duration, audio flag
- **Metadata** — post URL, post ID, shortcode, timestamp, position index
- **Creator controls** — like count visibility, comments disabled flag, sharing disabled flag, paid partnership label, reshare count
- **Extras** — location, tagged users, music attribution, coauthors, pinned status, verified badge, sponsor tags, accessibility caption

### How to Use

1. Go to the **Input** tab
2. Add one or more Instagram **usernames** (or full profile URLs)
3. Paste your **Session ID** (see how to get one below)
4. *(Optional)* Set **Max Posts Per User** — leave it at `0` to collect all available posts
5. Click **Start** — results appear in the dataset as they are collected

### How to get your Session ID

This Actor requires an Instagram Session ID for authentication. Here's how to get it:

#### Option 1: Browser Developer Tools

1. Open [instagram.com](https://www.instagram.com) in your browser and log in
2. Press **F12** to open Developer Tools
3. Go to **Application** → **Cookies** → `https://www.instagram.com`
4. Find the cookie named **`sessionid`** and copy its value
5. Paste it into the **Session ID** field in the Actor input

#### Option 2: Cookie Editor Extension

You can also use a browser extension like [Cookie-Editor](https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm?hl=en) to quickly view and copy cookies. Simply install the extension, visit instagram.com, and search for the `sessionid` cookie.

> **Disclaimer:** Cookie-Editor is a third-party extension not affiliated with this Actor. As with any browser extension that accesses cookie data, please review its permissions and use at your own discretion.

#### Important notes

- **Get a fresh Session ID before each run.** Session IDs can expire at any time — often without warning. For best results, copy a fresh Session ID from your browser immediately before starting each run.

- **Use a secondary account.** Automated access may cause Instagram to flag your account or temporarily restrict it. We strongly recommend using a secondary account rather than your primary one.

### Input example

```json
{
    "usernames": [
        "natgeo",
        "nasa"
    ],
    "sessionId": "your-session-id-here",
    "maxPosts": 0
}
```

| Field | Type | Description |
|-------|------|-------------|
| `usernames` | Array | Instagram usernames to scrape (1–10). Accepts `username`, `@username`, or full profile URL |
| `sessionId` | String | Your Instagram login session credential |
| `maxPosts` | Number | Max posts to collect per user (0 = unlimited, default: 0) |

### Output example

Profile row (`item_type: "profile"`):

```json
{
    "item_type": "profile",
    "sourceUsername": "natgeo",
    "username": "natgeo",
    "userId": "787132",
    "fullName": "National Geographic",
    "biography": "...",
    "profileUrl": "https://www.instagram.com/natgeo",
    "profilePicUrl": "https://...",
    "externalUrl": "https://www.nationalgeographic.com",
    "isVerified": true,
    "isPrivate": false,
    "isBusinessAccount": true,
    "category": "Media/News Company",
    "followerCount": 300000000,
    "followingCount": 150,
    "postCount": 15200,
    "scrapedAt": "2026-03-01T12:00:00.000Z"
}
```

Post row (`item_type: "post"`):

```json
{
    "item_type": "post",
    "sourceUsername": "natgeo",
    "username": "natgeo",
    "userId": "787132",
    "postId": "3567890123456789012",
    "shortcode": "ABC123xyz",
    "postUrl": "https://www.instagram.com/p/ABC123xyz/",
    "caption": "The Amazon rainforest...",
    "hashtags": ["#nature", "#wildlife"],
    "mentions": ["@wwf"],
    "mediaType": "image",
    "mediaUrl": "https://...",
    "mediaUrls": null,
    "likeCount": 50000,
    "commentCount": 300,
    "videoViewCount": null,
    "videoDuration": null,
    "hasAudio": null,
    "isPinned": false,
    "isVerified": true,
    "isLikeCountHidden": false,
    "isPaidPartnership": false,
    "isCommentsDisabled": false,
    "isSharingDisabled": false,
    "reshareCount": null,
    "locationName": "Amazon Rainforest",
    "taggedUsers": ["wwf"],
    "sponsorTags": [],
    "musicName": null,
    "coauthors": [],
    "accessibilityCaption": null,
    "timestamp": "2026-03-01T12:00:00.000Z",
    "scrapedAt": "2026-03-01T12:05:00.000Z",
    "index": 1
}
```

### Output schema

Each run produces two row types in the same dataset:

| Field | Type | Profile | Post |
|-------|------|---------|------|
| `item_type` | String | `"profile"` | `"post"` |
| `sourceUsername` | String | ✓ | ✓ |
| `username` | String | ✓ | ✓ |
| `userId` | String | ✓ | ✓ |
| `fullName` | String | ✓ | ✓ |
| `biography` | String | ✓ | ✓ |
| `profileUrl` | String | ✓ | ✓ |
| `profilePicUrl` | String | ✓ | ✓ |
| `externalUrl` | String | ✓ ¹ | ✓ ¹ |
| `isVerified` | Boolean | ✓ | ✓ |
| `isPrivate` | Boolean | ✓ | — |
| `isBusinessAccount` | Boolean | ✓ | ✓ |
| `category` | String | ✓ ¹ | ✓ ¹ |
| `followerCount` | Integer | ✓ | ✓ |
| `followingCount` | Integer | ✓ | ✓ |
| `postCount` | Integer | ✓ ¹ | ✓ ¹ |
| `postId` | String | — | ✓ |
| `shortcode` | String | — | ✓ |
| `postUrl` | String | — | ✓ |
| `caption` | String | — | ✓ |
| `hashtags` | Array | — | ✓ |
| `mentions` | Array | — | ✓ |
| `mediaType` | String | — | ✓ (`image` / `video` / `carousel`) |
| `mediaUrl` | String | — | ✓ |
| `mediaUrls` | Array | — | ✓ ¹ |
| `likeCount` | Integer | — | ✓ |
| `commentCount` | Integer | — | ✓ |
| `videoViewCount` | Integer | — | ✓ ¹ |
| `videoDuration` | Number | — | ✓ ¹ |
| `hasAudio` | Boolean | — | ✓ ¹ |
| `isPinned` | Boolean | — | ✓ |
| `isLikeCountHidden` | Boolean | — | ✓ |
| `isPaidPartnership` | Boolean | — | ✓ |
| `isCommentsDisabled` | Boolean | — | ✓ |
| `isSharingDisabled` | Boolean | — | ✓ |
| `reshareCount` | Integer | — | ✓ ¹ |
| `locationName` | String | — | ✓ ¹ |
| `taggedUsers` | Array | — | ✓ |
| `sponsorTags` | Array | — | ✓ |
| `musicName` | String | — | ✓ ¹ |
| `coauthors` | Array | — | ✓ |
| `accessibilityCaption` | String | — | ✓ ¹ |
| `timestamp` | String | — | ✓ |
| `scrapedAt` | String | ✓ | ✓ |
| `index` | Integer | — | ✓ |

¹ This field is present in every row of the indicated type but may be null when not applicable (e.g., `videoViewCount` is null for image posts; `mediaUrls` is null for single-media posts; `reshareCount` is null for most posts as Instagram does not publicly expose share counts).

### How it works

1. Connects to Instagram using your Session ID
2. Looks up each username and collects their profile information
3. Collects all accessible posts — captions, media, engagement data, and more
4. Continues gathering posts in batches until your limit is reached
5. Saves results as they come in — no need to wait for the full run to finish
6. Automatically resumes from where it left off after a platform restart

### Tips for best results

- **Refresh your Session ID if you see errors.** Session IDs can expire at any time. If authentication fails, obtain a fresh one and retry.
- **Private accounts are automatically handled.** Their profile information will still be collected, but their post list is not accessible. You can identify them by the `isPrivate: true` field.
- **Results are saved progressively.** Posts are saved to the dataset as they are collected, so the data collected so far is preserved and the run can resume after a platform restart.

### Frequently asked questions

**Why is a Session ID required?**

Instagram requires you to be logged in to access post data. The Session ID is how the Actor authenticates on your behalf — without it, posts cannot be retrieved.

**Is it safe to use my Session ID?**

Your Session ID is treated as a secret — it is stored securely by Apify and never exposed in logs or output. That said, we strongly recommend using a secondary Instagram account rather than your primary one as a precaution.

**How many accounts can I scrape?**

You can process up to 10 Instagram accounts per run. Set `maxPosts` to `0` (the default) for unlimited posts per user, or any positive value up to 100,000 to cap the posts collected per account.

**What is the difference between `mediaUrl` and `mediaUrls`?**

`mediaUrl` is the primary media file for all post types. For carousels, it is the URL of the first slide — which may be a video URL if the first slide is a video. `mediaUrls` contains all slide URLs for carousel posts and is null for single-image or single-video posts.

**Can I scrape private accounts?**

No. Private accounts are not accessible. Their profile information will be collected and returned with `isPrivate: true`, but their post list will not be available.

**What happens if authentication fails?**

The Actor will stop and report an authentication error. Obtain a fresh Session ID and try again.

**Can I scrape multiple users at once?**

Yes. The `usernames` field accepts up to 10 usernames per run. Each user is processed in sequence.

### Integrations

Connect Instagram User Post Scraper API with other apps and services using [Apify integrations](https://apify.com/integrations). Export data to Google Sheets, Slack, Zapier, Make, and many more.

### More Actors

Looking for other Instagram data? Explore [more scrapers by futurizerush](https://apify.com/futurizerush?fpr=rush) — comments, profile posts, followers, and hashtags.

### Disclaimer

This Actor is intended for learning, research, and personal use. Please use it responsibly and ethically, and ensure your usage complies with Instagram's Terms of Service.

Instagram may update its platform at any time, which could temporarily affect this Actor's functionality. While we actively maintain compatibility, occasional disruptions are possible.

Using a Session ID involves providing authentication credentials to the Actor. We strongly recommend using a secondary account, as automated access may result in account restrictions or temporary bans. You are solely responsible for how you use this tool and any consequences that may arise from its use.

***

Instagram post scraper, Instagram user posts, Instagram posts extractor, Instagram profile posts API, Instagram content scraper, Instagram media downloader, Instagram post data export, Instagram captions scraper, Instagram engagement data, social media scraper, Apify actor, OpenClaw, Claude Code, Gemini, Codex, Antigravity, ChatGPT

# Actor input Schema

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

Instagram usernames to scrape posts from. Accepts username, @username, or full profile URL (https://www.instagram.com/username). Up to 10 users per run.

## `maxPosts` (type: `integer`):

Maximum number of posts to collect per user. Set to 0 for unlimited — collects all accessible posts. Default is 0.

## `sessionId` (type: `string`):

Your Instagram sessionid cookie value. Required to access post data. ⚠️ Get a fresh Session ID immediately before each run — they expire without warning. To find it: log in to instagram.com → open Developer Tools (F12 or right-click → Inspect) → Application → Cookies → instagram.com → copy the sessionid value. We recommend using a secondary account for safety.

## Actor input object example

```json
{
  "usernames": [
    "natgeo",
    "nasa",
    "instagram"
  ],
  "maxPosts": 0
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `allFields` (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 = {
    "usernames": [
        "natgeo",
        "nasa",
        "instagram"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("futurizerush/instagram-user-post-scraper-api").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",
        "nasa",
        "instagram",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("futurizerush/instagram-user-post-scraper-api").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",
    "nasa",
    "instagram"
  ]
}' |
apify call futurizerush/instagram-user-post-scraper-api --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

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