# Instagram Posts Scraper (`easy_scraper/instagram-posts-scraper`) Actor

Scrapes public Instagram profile posts into structured datasets with rich metadata including captions, engagement, media.
Supports multiple profiles, pagination, post-type filtering, date-based extraction.
clean, analysis-ready output for automation, analytics, and lead generation.

- **URL**: https://apify.com/easy\_scraper/instagram-posts-scraper.md
- **Developed by:** [easy scraper](https://apify.com/easy_scraper) (community)
- **Categories:** Social media, Automation, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 post addeds

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.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/platform/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 Posts Scraper 

Apify Actor that collects **public profile timeline posts** from Instagram . Each accepted post becomes one **dataset** row with URLs, caption, owner, engagement metrics, and carousel-friendly fields.

---

### 1. Features

- **Multiple profiles** per run (username, `@handle`, or full profile URL).
- **`maxPosts`** cap per profile (paginates until the limit or the feed ends).
- **`dateFilter`** — optional “newer than” using **absolute** date (`YYYY-MM-DD`) or **relative** text (`7 days`, `2 weeks`, …) via the Apify datepicker.
- **`skipPinnedPosts`** — omit pinned items from results (default: `true`).
- **`postTypeFilter`** — restrict to Instagram `product_type`: `all`, `feed`, `clips`, `carousel_container`.
- **Structured output** — Instagram URL, ISO timestamp, caption fields, owner block, image URLs, optional video URL, hashtags and mentions from caption, tagged users, coauthors, carousel child summary.
- **Pagination** stops early when the feed reaches posts **older than** the date filter (non-pinned, chronological path).

---

### 6. Output fields (dataset)

| Field                           | Type              | Description                                                                 |
| ------------------------------- | ----------------- | --------------------------------------------------------------------------- |
| `scraped_from`                  | string            | Username queued for this profile                                            |
| `instagram_url`                 | string            | Post URL `https://www.instagram.com/p/{shortcode}/`                        |
| `shortcode`                     | string            | Media `code` from Instagram                                               |
| `timestamp`                     | string (ISO 8601) | From `taken_at` / `taken_at_timestamp`                                     |
| `product_type`                  | string            | e.g. `feed`, `clips`, `carousel_container`                               |
| `is_video`                      | boolean           | From `media_type` / `video_versions`                                      |
| `caption_text`                  | string \| null    | Caption body                                                               |
| `like_count`                    | number \| null    | Likes                                                                       |
| `comment_count`                 | number \| null    | Comments                                                                    |
| `view_count`                    | number \| null    | Views when present                                                         |
| `play_count`                    | number \| null    | Plays; may use `ig_play_count` when present                               |
| `owner_username`                | string \| null    | `user.username`                                                            |
| `display_url`                   | string \| null    | Primary image URL                                                          |
| `video_url`                     | string \| null    | First `video_versions` URL                                                 |
| `video_duration`                | number \| null    | Seconds; may be parsed from DASH manifest                                  |
| `id`                            | string \| null    | Compound media id                                                          |
| `pk`                            | string \| null    | Media pk                                                                   |
| `caption_created_at`            | string \| null    | Caption `created_at` as ISO                                                |
| `is_caption_edited`             | boolean           | Caption edited flag                                                        |
| `accessibility_caption`         | string \| null    | Alt text                                                                    |
| `is_comments_disabled`          | boolean           | `comments_disabled === true`                                              |
| `like_and_view_counts_disabled` | boolean           | Likes/views hidden                                                         |
| `owner_id`                      | string \| null    | `owner.id` or `user.id` / `user.pk`                                       |
| `owner_full_name`               | string \| null    | Full name                                                                  |
| `owner_is_verified`             | boolean           | Verified                                                                   |
| `owner_profile_pic_url`         | string \| null    | Avatar URL                                                                 |
| `media_name`                    | string \| null    | Title or Reels audio title when present                                    |
| `image_width`                   | number \| null    | `original_width`                                                           |
| `image_height`                  | number \| null    | `original_height`                                                          |
| `image_urls`                    | string[]          | `image_versions2` candidate URLs                                          |
| `is_pinned_post`                | boolean           | Pinned (only appears when not skipped upstream)                           |
| `is_sponsored`                  | boolean           | `ad_id` present                                                            |
| `is_paid_partnership`           | boolean           | Paid partnership                                                           |
| `tagged_users`                  | string[]          | From `usertags`                                                            |
| `hashtags`                      | string[]          | Parsed from caption                                                        |
| `caption_mentions`              | string[]          | `@mentions` in caption                                                     |
| `coauthors`                     | array             | `{ pk, username, full_name }` objects                                       |
| `child_post_count`              | number \| null    | Carousel length                                                            |
| `child_posts`                   | array             | Per-slide `{ pk, media_type, shortcode, image_url }`                       |
| `first_comment_text`            | string \| null    | Not filled by current query                                               |
| `latest_comment_text`           | string \| null    | Not filled by current query                                               |

---

### 3. How to run (Apify Console)

Use this Actor in the **[Apify Console](https://console.apify.com/actors/OblG239Cju8aWtvFs)**

1. Open the **Input** tab.
2. Under **Target Profiles**, add every Instagram account you want (username, `@name`, or full profile URL). This field is required.
3. Set **Maximum Posts** if you want a limit other than 50 (count is **per profile**).
4. Set **Post Type Filter** if you only want one kind of post: all, normal photos/posts, Reels, or carousels.
5. Leave **Skip pinned posts** on to drop pinned items, or turn it off to include them.
6. Under **Extract posts that are newer than**, either leave it blank (no date limit) or pick **Absolute** (calendar date) / **Relative** (e.g. last 7 days).
7. Click **Start** (or **Save & Start**). Watch **Log** for progress.
8. When the run finishes, open **Output** or **Storage → Dataset** to view, filter, or download your post rows.

**Advanced:** switch the Input view to **JSON** if you want to paste an object by hand; use the same field names as in [§4. Input](#4-input).

---

### 4. Input


```json
{
    "profiles": ["therock", "https://www.instagram.com/nasa/"],
    "maxPosts": 50,
    "postTypeFilter": "all",
    "skipPinnedPosts": true,
    "dateFilter": "2026-01-15"
}
````

Relative date example:

```json
{
    "profiles": ["nasa"],
    "maxPosts": 100,
    "postTypeFilter": "clips",
    "skipPinnedPosts": true,
    "dateFilter": "30 days"
}
```

| `postTypeFilter`       | Meaning                          |
| ---------------------- | -------------------------------- |
| `all`                  | All types that pass other filters |
| `feed`                 | Standard feed / image posts      |
| `clips`                | Reels                            |
| `carousel_container`   | Carousels                        |

***

### 5. Output (example record)

One dataset object per stored post (shape matches `.actor/dataset_schema.json`):

```json
{
    "scraped_from": "therock",
    "id": "3844133065635875205_232192182",
    "pk": "3844133065635875205",
    "shortcode": "DVZGqf2j0mF",
    "instagram_url": "https://www.instagram.com/p/DVZGqf2j0mF/",
    "product_type": "clips",
    "timestamp": "2026-02-19T12:37:02.000Z",
    "is_video": true,
    "video_duration": 261.942871,
    "view_count": null,
    "play_count": null,
    "caption_text": "Example caption…",
    "caption_created_at": "2026-02-19T12:37:04.000Z",
    "is_caption_edited": false,
    "display_url": "https://instagram.fcai19-11.fna.fbcdn.net/…",
    "accessibility_caption": null,
    "like_count": 322961,
    "comment_count": 6675,
    "is_comments_disabled": false,
    "like_and_view_counts_disabled": false,
    "owner_id": "232192182",
    "owner_username": "therock",
    "owner_full_name": "Dwayne Johnson",
    "owner_is_verified": true,
    "owner_profile_pic_url": "https://instagram.fcai19-11.fna.fbcdn.net/…",
    "media_name": "Original audio",
    "image_width": 720,
    "image_height": 1280,
    "image_urls": ["https://…"],
    "video_url": "https://instagram.fcai19-11.fna.fbcdn.net/…",
    "is_pinned_post": false,
    "is_sponsored": false,
    "is_paid_partnership": false,
    "coauthors": [],
    "tagged_users": ["americanblackfilmfestival"],
    "hashtags": ["RememberYourWhyCollection"],
    "caption_mentions": ["projectrock"],
    "child_post_count": null,
    "child_posts": [],
    "first_comment_text": null,
    "latest_comment_text": null
}
```

***

# Actor input Schema

## `profiles` (type: `array`):

List of Instagram profiles to scrape. You can provide usernames (with or without @) or full profile URLs.

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

Total number of posts to scrape per profile.

## `postTypeFilter` (type: `string`):

Limit results to a single Instagram product\_type. "All Posts" keeps every timeline item that passes other filters.

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

When enabled, pinned profile posts are omitted from results.

## `dateFilter` (type: `string`):

Optional. Use the Absolute tab for a calendar date (YYYY-MM-DD), or Relative for a number of days, weeks, months, or years. Leave empty to disable date filtering.

## Actor input object example

```json
{
  "profiles": [
    "therock",
    "@nasa",
    "https://www.instagram.com/leomessi/"
  ],
  "maxPosts": 50,
  "postTypeFilter": "all",
  "skipPinnedPosts": 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 = {
    "profiles": [
        "therock",
        "@nasa",
        "https://www.instagram.com/leomessi/"
    ]
};

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

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

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Instagram Posts Scraper",
        "description": "Scrapes public Instagram profile posts into structured datasets with rich metadata including captions, engagement, media.\nSupports multiple profiles, pagination, post-type filtering, date-based extraction.\nclean, analysis-ready output for automation, analytics, and lead generation.",
        "version": "1.0",
        "x-build-id": "NZvihZsUWqTiWnb5W"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/easy_scraper~instagram-posts-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-easy_scraper-instagram-posts-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/easy_scraper~instagram-posts-scraper/runs": {
            "post": {
                "operationId": "runs-sync-easy_scraper-instagram-posts-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/easy_scraper~instagram-posts-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-easy_scraper-instagram-posts-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": [
                    "profiles"
                ],
                "properties": {
                    "profiles": {
                        "title": "Target Profiles",
                        "type": "array",
                        "description": "List of Instagram profiles to scrape. You can provide usernames (with or without @) or full profile URLs.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxPosts": {
                        "title": "Maximum Posts",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Total number of posts to scrape per profile.",
                        "default": 50
                    },
                    "postTypeFilter": {
                        "title": "Post Type Filter",
                        "enum": [
                            "all",
                            "feed",
                            "clips",
                            "carousel_container"
                        ],
                        "type": "string",
                        "description": "Limit results to a single Instagram product_type. \"All Posts\" keeps every timeline item that passes other filters.",
                        "default": "all"
                    },
                    "skipPinnedPosts": {
                        "title": "Skip pinned posts",
                        "type": "boolean",
                        "description": "When enabled, pinned profile posts are omitted from results.",
                        "default": true
                    },
                    "dateFilter": {
                        "title": "Extract posts that are newer than",
                        "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
                        "type": "string",
                        "description": "Optional. Use the Absolute tab for a calendar date (YYYY-MM-DD), or Relative for a number of days, weeks, months, or years. Leave empty to disable date filtering."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
