# Instagram Posts, Reels & Reposts Scraper (`toolzerhub/instagram-posts-reels-scraper`) Actor

Four ways to read what a public Instagram account has posted: its timeline posts, its reels, posts it is tagged in, and posts it has reposted. Paging is automatic up to Max results, and every mode takes the account's numeric user ID.

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

## Pricing

from $1.70 / 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/actors/running/actors-in-store.md#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 Posts, Reels & Reposts Scraper

Export what a public Instagram account has posted — timeline posts, reels, posts it is tagged in, and posts it has reposted — as one row per post with **like\_count**, **comment\_count**, **taken\_at**, **media\_type** and the post **code**. No login, no cookies.

Every mode takes the account's **numeric user ID**, not the handle.

### Pick a mode

| Mode | Returns |
|---|---|
| Timeline posts | Everything on the grid — images, carousels, and reels that were posted to the grid |
| Reels | The reels tab on its own |
| Tagged posts | Posts by other accounts that tag this one |
| Reposts | Posts this account has reshared |

### Input

| Field | Notes |
|---|---|
| **userIds** | One or more numeric IDs. Get them from the [Profile Actor](https://apify.com/toolzerhub/instagram-profile-scraper) — its `pk` field is what goes here. |
| **Max results** | Per user ID, not per run. Two IDs at 25 gives up to 50 rows. `0` removes the bound. |
| **Resume from** | A continuation value from an earlier run's log. Picks up where that run stopped. |

Paging runs on its own up to Max results — you don't ask for page 2.

### Output

`source_identifier` · `code` · `like_count` · `comment_count` · `taken_at` · `media_type`

`code` is the shortcode at the end of the post URL, so `instagram.com/p/<code>/` rebuilds the link.

### Questions

**Why do I get fewer rows than Max results?**
The account ran out of posts, or Instagram stopped handing out pages. A run ends when Instagram returns an empty page, or hands back the same continuation value twice — both mean there is nothing further to ask for. An account with 4,000 posts will not always give up 4,000 rows.

**Can I pass a username instead of an ID?**
Not to this Actor. These four endpoints take numeric IDs only. Run the Profile Actor's "Get profile by username" mode first — one run converts your whole handle list to IDs, and the ID keeps working after someone renames their account.

**Nothing came back for an account that clearly posts.**
Check whether it's private. Private accounts return their profile but none of their posts. `is_private` on the Profile Actor's row tells you before you spend a run here.

**Reels are showing up in Timeline posts too. Is that double counting?**
Timeline posts is the grid as Instagram serves it, and reels posted to the grid appear there. Use the Reels mode when you want the reels tab alone. Running both and merging will give you overlap — dedupe on `code`.

**How do I continue a run that stopped at the limit?**
Take the value the log prints when it stops and put it in **Resume from** on the next run, with the same user ID. It carries on from that point rather than restarting.

### The rest of the family

[Instagram Post, Comments & Likes Scraper](https://apify.com/toolzerhub/instagram-post-comments-likes-scraper) — one post in depth, with its comments and likers.
[Instagram Profile Scraper](https://apify.com/toolzerhub/instagram-profile-scraper) — the account behind the posts, and where the numeric IDs come from.
[Instagram Scraper - All In One](https://apify.com/toolzerhub/instagram-all-in-one-scraper) — every mode in this family.

### Support

Questions, bugs, or feature requests: **contact@toolzerhub.com**

Browse the rest: [apify.com/toolzerhub](https://apify.com/toolzerhub)

# Actor input Schema

## `scraperType` (type: `string`):

Choose the dataset for this run, then fill in the section for that mode below.

## `userIds` (type: `array`):

One or more numeric Instagram user IDs. Only a numeric ID works for this mode — get one from the Profile actor's "Get profile by username" mode, which returns it for any account.

## `maxItems` (type: `integer`):

The maximum number of records to save per identifier or search term. A value of 0 removes the bound and the run continues until the source has no more to give.

## `cursor` (type: `string`):

A continuation value from an earlier run — the value the run log prints when it stops. The run continues from there instead of the top. Leave it empty to start at the top. Applies only to a single identifier or search term; a multi-account run uses it for the first one only.

## Actor input object example

```json
{
  "scraperType": "userPosts",
  "userIds": [
    "25025320"
  ],
  "maxItems": 25
}
```

# Actor output Schema

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

Every record collected during this run

# 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 = {
    "scraperType": "userPosts",
    "userIds": [
        "25025320"
    ],
    "maxItems": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("toolzerhub/instagram-posts-reels-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 = {
    "scraperType": "userPosts",
    "userIds": ["25025320"],
    "maxItems": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("toolzerhub/instagram-posts-reels-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 '{
  "scraperType": "userPosts",
  "userIds": [
    "25025320"
  ],
  "maxItems": 25
}' |
apify call toolzerhub/instagram-posts-reels-scraper --silent --output-dataset

```

## MCP server setup

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