# Instagram Profile Posts Scraper (`harpoon/ig-profile-posts-scraper`) Actor

Scrape the posts of public Instagram profiles - captions, media thumbnails, carousels, and shortcodes - without logging in.

- **URL**: https://apify.com/harpoon/ig-profile-posts-scraper.md
- **Developed by:** [Harpoon](https://apify.com/harpoon) (community)
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 posts

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?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### Instagram Profile Posts Scraper — every post from any public profile, as a clean table

Paste one or more public Instagram profile URLs or `@handles` and get their posts back as
structured rows: caption, media type (photo, video, or carousel), thumbnail, carousel size,
shortcode, and permalink, newest first. Choose how many posts to pull per profile and download the
result as JSON, CSV, Excel, or XML. No login, cookies, or API key required.

#### What can Instagram Profile Posts Scraper do?

- Pull the posts of one profile or hundreds in a single run
- Accept profile URLs (`https://www.instagram.com/markruffalo/`), `@handles`, plain handles, or numeric IDs
- Return captions, media type, product type, thumbnails, carousel size, shortcode, and permalink
- Keep the feed order (newest first) and deduplicate repeated profiles automatically
- Export to JSON, CSV, Excel, or XML; run via the API, schedule runs, and connect through MCP

### What data can I extract?

<table>
<tr><th>What you get</th><th>Features</th></tr>
<tr><td>

- **Post identity** — post ID, shortcode, canonical permalink
- **Content** — full caption text, alt/accessibility text
- **Media** — media type (image / video / carousel), product type, thumbnail URL, carousel item count
- **Owner** — username, profile ID, and legacy ID for joining to profile data

</td><td>

- Newest-first feed order, up to your chosen cap per profile
- `max_posts` cap per profile
- One row per post, keyed by shortcode
- Export to JSON, CSV, Excel, XML
- API access, webhooks, scheduling, LLM-ready output for MCP

</td></tr>
</table>

### How to use Instagram Profile Posts Scraper

1. [Create](https://console.apify.com/sign-up) a free Apify account.
2. Open **Instagram Profile Posts Scraper** in Apify Console.
3. Paste one or more public profile URLs or `@handles` into **Instagram profiles**, one per line.
4. Set **Max posts per profile** (default 20).
5. Click **Save & Start**.
6. Download the results in JSON, CSV, Excel, or XML from the **Storage** tab.

### Input

Give it a list of profiles; each one contributes its own posts to the dataset. For each profile the
Actor reads the newest posts first and stops at your cap.

- `profiles` — public profile URLs, `@handles`, plain handles, or numeric IDs.
- `max_posts` — how many recent posts to return per profile (default 20).

**Example input**

```json
{
  "profiles": ["https://www.instagram.com/markruffalo/", "@markruffalo"],
  "max_posts": 40
}
```

See the **Input** tab above for every parameter.

### Output

Results land in a dataset under the **Storage** tab. Three built-in views are included:
**Overview**, **Media**, and **Captions**. Download in JSON, CSV, Excel, or XML, or pull them via
the API.

```json
{
  "id": "3978139377163268513",
  "shortcode": "Dc1MK-6z3Gh",
  "url": "https://www.instagram.com/reel/Dc1MK-6z3Gh/",
  "caption": "The fight is on. Meet Judy on November 13 in #BeingHeumann on @AppleTV. #BeingHuemann",
  "media_type": 2,
  "media_type_name": "video",
  "product_type": "clips",
  "is_video": true,
  "is_carousel": false,
  "carousel_media_count": 0,
  "display_url": "https://scontent-mrs2-2.cdninstagram.com/v/t51.82787-15/791844615_18616681111063829_14811162466_n.jpg",
  "accessibility_caption": "Video by Mark Ruffalo on September 03, 2026. May be an image of poster, magazine and text.",
  "owner_id": "17841401914858621",
  "owner_pk": "1191807828",
  "owner_username": "markruffalo",
  "scraped_at": "2026-09-17T13:33:33Z"
}
```

Field names are lowercase snake\_case, and the input keys match them. The caption above is
abbreviated for readability — the dataset contains the full text.

### What can you do with the data?

#### 1. Monitor a competitor's content

1. Run the Actor over a list of competitor handles.
2. Use the **Overview** view to see media mix and product types per profile.
3. Schedule a weekly run and compare which formats they post most.

#### 2. Build a caption / hashtag corpus

1. Run the Actor with a higher `max_posts`.
2. Open the **Captions** view and export to CSV or JSON.
3. Feed the captions into keyword, sentiment, or topic analysis.

#### 3. Collect thumbnails and media references

1. Run the Actor over the profiles you care about.
2. Use the **Media** view to filter videos and carousels.
3. Pull `display_url` for thumbnails and `url` for the permalinks you need.

### How much does Instagram Profile Posts Scraper cost?

This Actor is billed **per post returned** (pay-per-event) on top of standard Apify platform
usage. A run over 10 profiles at 20 posts each is billed as up to 200 results; profiles with fewer
posts than the cap are billed for what they return.

See the **Pricing** tab for current rates and your plan's discounts.

### FAQ

**Do I need an Instagram account, cookies, or an API key?**
No. The Actor reads publicly available posts, so no login or credentials are required.

**Can it scrape private profiles?**
No. Only public profiles have a readable feed; private or restricted profiles are reported in the
run log and skipped.

**How many posts can I get per profile?**
Up to `max_posts` (default 20). Set it higher for more history; large values take longer and are
billed per post returned.

**Why are there no like, comment, or date fields?**
Instagram does not expose engagement counts or post timestamps to visitors who are not logged in,
so the Actor returns the fields that are publicly available: caption, media type, media URLs,
shortcode, and owner. The alt text (`accessibility_caption`) often mentions the post date.

**Is it legal to scrape Instagram?**
The Actor returns public data only. Review Apify's legal and ethical scraping guidance and the
terms that apply to your use case.

**Can I use it with the API, SDKs, or MCP?**
Yes — see the **API** tab above, or connect through the Apify MCP server.

**A profile is missing from the results.**
That profile is logged with the reason (for example, it does not exist, is private, or was
temporarily throttled). The rest of the run continues; re-run just that profile if needed.

### Notes and limitations

- **No timestamps or engagement.** Instagram does not expose post dates, like counts, comment
  counts, or video file URLs to visitors who are not logged in, so those fields are not produced.
  `accessibility_caption` frequently contains a human-readable date.
- `display_url` is a time-limited image link. Download the files soon after the run if you need to
  keep them.
- `carousel_media_count` is `0` for non-carousel posts; individual carousel child images are not
  exposed in the feed.
- Raising `max_posts` increases the number of requests per profile and the run time.
- Post, reel, or story URLs are rejected as profile input with a clear error for that entry.

### Run locally

```
go run ./cmd/actor
```

Input is read from the Apify key-value store; see `INPUT_SCHEMA.json`.

### Support

Found a bug or have feedback? Open an issue in the **Issues** tab.

# Actor input Schema

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

<b>Public profile URLs or @handles</b>, one per line, whose posts you want. Accepts <code>https://www.instagram.com/markruffalo/</code>, <code>@markruffalo</code>, or <code>markruffalo</code>. Duplicates are removed automatically, and every profile returns its own set of posts.

## `max_posts` (type: `integer`):

How many recent posts to return per profile, newest first. Higher values take longer and increase cost.

## Actor input object example

```json
{
  "profiles": [
    "@markruffalo",
    "https://www.instagram.com/markruffalo/"
  ],
  "max_posts": 20
}
```

# Actor output Schema

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

One row per scraped post. Export as JSON, CSV, Excel, or XML.

# 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/markruffalo/"
    ],
    "max_posts": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("harpoon/ig-profile-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/markruffalo/"],
    "max_posts": 20,
}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,harpoon/ig-profile-posts-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/nvK33fsN7Oud3IEGi/builds/0OEevAEYNgqxts8a7/openapi.json
