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

🔥 Scrape Instagram user posts, reels, tagged content, or reposts from one or more public profiles.

- **URL**: https://apify.com/api-ninja/instagram-posts-scraper.md
- **Developed by:** [API ninja](https://apify.com/api-ninja) (community)
- **Categories:** Social media, Automation, Developer tools
- **Stats:** 9 total users, 7 monthly users, 92.9% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## 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 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

### What does Instagram User Feed Scraper do?

**Instagram User Feed Scraper** helps you **scrape Instagram user data** from one or more public profiles with a very small input setup. Add profile handles or profile URLs, choose one feed type, and the Actor will process the list one by one and extract **posts**, **reels**, **tagged posts**, or **reposts** from [Instagram](https://www.instagram.com/).

This Actor is built for people who want a focused **Instagram API alternative** for public profile feeds without the extra complexity of a full Instagram scraping suite. It runs on [Apify](https://apify.com/), so you also get scheduling, monitoring, API access, dataset exports, run history, and integrations with tools like Make, Zapier, n8n, and webhooks.

### What can this Instagram scraper do?

This Instagram scraper is intentionally narrow and practical. It focuses only on user-related feeds.

- ✅ Accept Instagram input in multiple forms: `nasa`, `@nasa`, or `https://www.instagram.com/nasa/`
- ✅ Scrape one selected feed type across many profiles
- ✅ Process profiles sequentially, finishing one before starting the next
- ✅ Limit results with `maxResults` or fetch the full available history
- ✅ Return structured output that works well in API workflows and data exports
- ✅ Run on the Apify platform with logs, scheduling, monitoring, and integrations

This Actor does **not** scrape hashtags, locations, audio pages, explore sections, or unrelated Instagram surfaces. That is deliberate. The goal is a clean, dependable scraper for user feeds only.

### Why use Instagram User Feed Scraper?

If you need to extract Instagram data from creator pages, brand accounts, or niche profiles, a focused tool is often better than a feature-heavy one.

Common use cases:

- 📈 Track the latest posts from multiple creators or competitors
- 🎬 Collect reels from brand or influencer profiles
- 🏷️ Audit tagged content for brand mentions or UGC discovery
- 🔁 Export reposts from aggregator accounts
- 🧪 Build lightweight monitoring or enrichment pipelines

Because the input is simple, this Actor is suitable for both no-code users and developers. Non-technical users can run it from the Apify Console, while developers can trigger it through the Apify API and pipe the data into their own applications.

### How to scrape Instagram user feeds

1. Open **Instagram User Feed Scraper** in Apify Console.
2. Add one or more Instagram profiles in the `profiles` field.
3. Choose one feed type: `posts`, `reels`, `tagged`, or `reposts`.
4. Set `maxResults` if you want to limit output, or enable `parseAllResults`.
5. Start the Actor.
6. Wait until it finishes scraping the first profile, then the second, and so on.
7. Open the dataset and export the results.

This step-by-step flow is especially useful if you want to scrape Instagram data repeatedly on a schedule.

### What data can this Instagram Actor extract?

The exact payload can vary by feed type, but these are the main fields most users care about:

| Field                         | Description                                              |
| ----------------------------- | -------------------------------------------------------- |
| `scrapeType`                  | Which feed was scraped: posts, reels, tagged, or reposts |
| `inputProfile`                | Original profile input provided by the user              |
| `username`                    | Normalized Instagram username                            |
| `userId`                      | Resolved Instagram user ID                               |
| `id`                          | Content item ID                                          |
| `code`                        | Instagram shortcode or item code                         |
| `caption`                     | Caption payload                                          |
| `media_type`                  | Instagram media type                                     |
| `product_type`                | Content/product type, often useful for reels             |
| `like_count`                  | Like count when available                                |
| `comment_count`               | Comment count when available                             |
| `display_uri` / `display_url` | Media preview image URL                                  |

### Input

Instagram User Feed Scraper has the following input options. Click on the **Input** tab in Apify Console for full field descriptions.

- `profiles`: List of Instagram handles or profile URLs
- `parseType`: Which user feed to scrape
- `maxResults`: Maximum number of items per profile
- `parseAllResults`: Ignore the limit and continue until the feed is exhausted

Example input:

```json
{
    "profiles": ["https://www.instagram.com/nasa/", "@instagram"],
    "parseType": "posts",
    "maxResults": 20,
    "parseAllResults": false
}
````

### Output

The Actor stores results in the default dataset. Each dataset item keeps the scraped Instagram content plus metadata showing which profile and feed it came from.

Example output:

```json
[
    {
        "id": "1234567890",
        "code": "DExample",
        "media_type": 1,
        "like_count": 15234,
        "comment_count": 241,
        "scrapeType": "posts",
        "inputProfile": "https://www.instagram.com/nasa/",
        "username": "nasa",
        "userId": "528817151"
    }
]
```

You can download the dataset extracted by Instagram User Feed Scraper in various formats such as JSON, HTML, CSV, or Excel.

### How much does it cost to scrape Instagram data?

How much scraping Instagram costs depends mostly on volume.

- Smaller runs with a few profiles and a modest `maxResults` limit are usually inexpensive.
- Larger runs cost more because they require more pagination and more compute time.
- Enabling `parseAllResults` is best when you really need full history, not just recent content.

If you are testing, start with 1-2 profiles and a small limit. That gives you a clear idea of output quality and runtime before scaling up. One of the advantages of using Apify is that you can start small, automate later, and monitor usage over time.

### Tips for better Instagram scraping results

- 💡 Use handles like `@nasa` or `nasa` for quick setup
- 💡 Keep `maxResults` low when validating a new profile list
- 💡 Use `posts` if you want the most broadly useful feed type
- 💡 Use `tagged` when researching mentions, collaborations, or UGC
- 💡 Enable `parseAllResults` only when you need historical depth

### Other Actors

If you work with Instagram data often, it can be useful to pair a user-feed scraper with other specialized Actors from your Apify workspace, such as profile-level scrapers, broader Instagram tools, or downstream enrichment pipelines.

### FAQ, disclaimers, and support

#### Is it legal to scrape Instagram?

This Actor is intended for scraping **publicly accessible Instagram data** only. It does not target private content. You are responsible for making sure your use complies with Instagram's terms and with the laws and regulations that apply to your use case.

#### Is this an official Instagram API?

No. This Actor is a practical **Instagram API alternative** for extracting public user feed data through Apify in a simple, production-friendly format.

#### What does this Actor not do?

This Actor does not scrape hashtags, locations, audio feeds, explore sections, or unrelated Instagram surfaces. It is designed specifically for user posts, reels, tagged content, and reposts.

#### Where can I get help?

If you run into an issue, use the **Issues** tab on the Actor page and include your input example plus the run URL if possible. If you need a custom workflow or an expanded Instagram data solution, this Actor can be extended into a custom build.

# Actor input Schema

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

List of Instagram handles or profile URLs. Examples: nasa, @nasa, https://www.instagram.com/nasa/

## `parseType` (type: `string`):

Choose which feed from the user profile should be scraped.

## `maxResults` (type: `integer`):

Maximum number of items to scrape. Ignored when 'Parse all available results' is enabled.

## `parseAllResults` (type: `boolean`):

If enabled, the scraper keeps paginating until the selected feed is exhausted.

## Actor input object example

```json
{
  "profiles": [
    "https://www.instagram.com/nasa/",
    "@instagram"
  ],
  "parseType": "posts",
  "maxResults": 100,
  "parseAllResults": false
}
```

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

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

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

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Instagram Posts Scraper",
        "description": "🔥 Scrape Instagram user posts, reels, tagged content, or reposts from one or more public profiles.",
        "version": "0.0",
        "x-build-id": "OwGSbJfKSc0HDXpFI"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/api-ninja~instagram-posts-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-api-ninja-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/api-ninja~instagram-posts-scraper/runs": {
            "post": {
                "operationId": "runs-sync-api-ninja-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/api-ninja~instagram-posts-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-api-ninja-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": "📱 Instagram profiles",
                        "type": "array",
                        "description": "List of Instagram handles or profile URLs. Examples: nasa, @nasa, https://www.instagram.com/nasa/",
                        "items": {
                            "type": "string"
                        }
                    },
                    "parseType": {
                        "title": "🧩 What to parse",
                        "enum": [
                            "posts",
                            "reels",
                            "tagged",
                            "reposts"
                        ],
                        "type": "string",
                        "description": "Choose which feed from the user profile should be scraped.",
                        "default": "posts"
                    },
                    "maxResults": {
                        "title": "🔢 Maximum results",
                        "minimum": 20,
                        "type": "integer",
                        "description": "Maximum number of items to scrape. Ignored when 'Parse all available results' is enabled.",
                        "default": 100
                    },
                    "parseAllResults": {
                        "title": "♾️ Parse all available results",
                        "type": "boolean",
                        "description": "If enabled, the scraper keeps paginating until the selected feed is exhausted.",
                        "default": false
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
