# 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)
- **Features:** Limited permissions
- **Stats:** 36 total users, 1 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
- **Direct media links** *(optional)* — with **Include media URLs** on, each post also carries a playable `video_url`, a best-quality `image_url`, and per-item links for carousels
- **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
- Optional `include_media` direct media links, fetched in parallel
- 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. Optional: turn on **Include media URLs** to add direct video/image download links (billed at a higher rate).
6. Click **Save & Start**.
7. 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).
- `include_media` — when true, add direct media links (`video_url`, `image_url`, `carousel_media`)
  to every post. These are fetched in parallel and are time-limited, so download them soon after the
  run. This adds one request per post and is billed as a separate `media-included` event.

**Example input**

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

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",
  "video_url": "https://instagram.fdel1-5.fna.fbcdn.net/o1/v/t2/f2/m86/....mp4?oh=...&oe=...",
  "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. `video_url`, `image_url`, and
`carousel_media` are only present when **Include media URLs** is on.

### 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 and download media

1. Run the Actor over the profiles you care about with **Include media URLs** on.
2. Use the **Media** view to filter videos and carousels and read the direct `video_url` / `image_url` links.
3. Download the files promptly — the links are time-limited — or keep `display_url` for thumbnails and `url` for permalinks.

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

Turning on **Include media URLs** adds a separate **`media-included`** event, charged once per post
whose media was fetched. It is priced separately from the base result event, so media-enabled runs
are billed at a higher rate than metadata-only runs. Leave it off if you only need captions and
thumbnails.

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 media link fails with "DNS address could not be found".**
It shouldn't: media links are rewritten to the generic dual-stack host `scontent.xx.fbcdn.net`, which
resolves on IPv4-only networks. If you still hit it, re-run the Actor for a fresh link and report it.

**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, or comment
  counts to visitors who are not logged in, so those fields are not produced. `accessibility_caption`
  frequently contains a human-readable date.
- **Direct media links are optional and time-limited.** With **Include media URLs** on, `video_url`,
  `audio_url`, and `carousel_media` point at Instagram's CDN and expire within roughly a day or two.
  Download them soon after the run instead of storing the links long-term. Media links are public
  (no cookies needed) while valid.
- **A media link may land on an IPv6-only CDN node.** Instagram picks the CDN host per request, and
  occasionally returns a host that publishes only an IPv6 address. Because the URL signature lives in
  the query (not the host), the Actor rewrites the host of every media link to the generic dual-stack
  host `scontent.xx.fbcdn.net` while keeping the path and signature intact, so `video_url`,
  `audio_url`, and `image_url` open on IPv4-only networks too.
- `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; per-item carousel links are returned in
  `carousel_media` only when **Include media URLs** is on.
- **Include media URLs** adds one request per post; runs take noticeably longer and are billed at a
  higher rate.
- 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.

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

## `include_media` (type: `boolean`):

When enabled, every post also carries direct media links: <code>video_url</code> (playable MP4) for videos, <code>audio_url</code> (the video's audio-only track, handy for transcription), <code>image_url</code> for the best still frame, and a <code>carousel_media</code> list with per-item links for carousels. The links are fetched in parallel and are time-limited, so download them soon after the run. Media links use the generic dual-stack CDN host, so they resolve on IPv4-only networks. This adds one request per post and is billed at a higher rate (one <code>media-included</code> event per post).

## `resume_from_run_id` (type: `string`):

Optional. Continue a run that was aborted or failed: paste its run id and the targets it already finished are skipped, so the new run only scrapes what is left. Leave empty for a normal run. A run's id is shown in the Apify Console run detail, or run scripts/resurrect.mjs --run <run-id>.

## Actor input object example

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

# 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/7XuYlPcgNZvrng5cs/openapi.json
