# Instagram Post & Reel Scraper (photos) (`jordan-byte/instagram-post-scraper`) Actor

Scrape all of an Instagram account's posts, Reels, and carousels in one run. Get captions, likes, comments, media URLs, location tags, and Reel audio/track info. Optional photo & video download. No login required. Fast, reliable, and built to keep working as Instagram changes.

- **URL**: https://apify.com/jordan-byte/instagram-post-scraper.md
- **Developed by:** [Jordan Byte](https://apify.com/jordan-byte) (community)
- **Categories:** Social media, Automation, E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

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

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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 Post Scraper

The **Instagram Post Scraper** for extracting **all** of an account's posts - photos, multi-image/video carousels, and Reels alike - in one run. Get captions, stats, media URLs, location tags, and audio info for Reels, with optional download of the actual media files. No login required to run it.

### What does the Instagram Post Scraper do?

This Instagram photo and video scraper handles every post type an account can have:

- **Scrapes an account's entire post history** - not just the first page. Give it a username and it paginates through as many posts as you ask for.
- **Handles every post type**: single images, multi-item carousels (mixed photo/video), and Reels - each mapped to the right fields for its type.
- **Rich per-post data**: URL, post date, like/comment counts, caption, dimensions, and location tag (when the poster added one).
- **Reel-specific audio metadata**: track title, artist name, and whether it's original audio vs. a licensed track.
- **Carousel scraping**: every image/video inside a multi-item post, each with its own media URL and dimensions.
- **Download Instagram photos and videos** - optionally save every image/video (all of a carousel's items, or a Reel's full video), with direct links added to that post's dataset row.

### Who uses an Instagram Post Scraper like this?

- **Content and social media audits** - pull an account's entire post history with engagement stats in one run.
- **Competitor and influencer research** - see what formats, captions, and posting patterns a competitor or influencer uses.
- **Archiving and backup** - download an account's photos and videos before a campaign wraps up or content gets deleted.
- **Media/content aggregation** - build datasets of Instagram photos, carousels, and Reels for further analysis.

### Input

| Field | Description |
|---|---|
| `usernames` | Instagram accounts to scrape - a bare username (`capcaprice`), an `@handle`, or a full profile URL all work. |
| `maxResults` | Stop collecting once this many posts have been found, per username. Default `20`. |
| `downloadMedia` | If `true`, downloads every post's actual media into the key-value store and adds `mediaStorageUrls` link(s) to its row. Default `false`. |
| `sessionid` / `csrftoken` | Optional. Instagram cookies from a logged-in browser session. Not required to scrape, but can improve reliability if Instagram is rate-limiting anonymous requests hard. |
| `proxyConfiguration` | A residential proxy is strongly recommended - Instagram aggressively rate-limits datacenter IPs. Defaults to Apify Proxy's `RESIDENTIAL` group. |

**Example:**

```json
{
    "usernames": ["https://www.instagram.com/capcaprice"],
    "maxResults": 30,
    "downloadMedia": false
}
```

### Output

Each post becomes one row in the dataset. The shape varies slightly by `type`:

**Image:**

```json
{
    "URL": "https://www.instagram.com/p/DVWIky_knq_/",
    "Id": "DVWIky_knq_",
    "type": "image",
    "postedAt": "2026-08-10T10:00:00.000Z",
    "likeCount": 4200,
    "commentCount": 38,
    "caption": "just a photo",
    "originalWidth": 1080,
    "originalHeight": 1350,
    "displayUrl": "https://scontent.cdninstagram.com/...",
    "videoUrl": null,
    "videoViewCount": null,
    "musicId": null,
    "musicUrl": null,
    "audioDetails": null,
    "location": null,
    "carouselChildren": null,
    "mediaStorageUrls": null,
    "author": { "username": "capcaprice", "fullname": "Caprice Cayetano", "isVerified": true, "isPrivate": false }
}
```

**Carousel** (adds `carouselChildren`, one entry per item):

```json
"carouselChildren": [
    { "type": "image", "displayUrl": "https://...", "videoUrl": null, "width": 1080, "height": 1350 },
    { "type": "video", "displayUrl": "https://...", "videoUrl": "https://....mp4", "width": 1080, "height": 1920 }
]
```

**Reel** (adds video + audio fields, uses a `/reel/` URL):

```json
{
    "URL": "https://www.instagram.com/reel/Dam7uBIyJBd/",
    "type": "reel",
    "videoUrl": "https://scontent.cdninstagram.com/....mp4",
    "videoViewCount": 12388,
    "musicId": "27443835655278093",
    "musicUrl": "https://www.instagram.com/reels/audio/27443835655278093/",
    "audioDetails": { "type": "original_audio", "audioId": "27443835655278093", "trackTitle": "Original audio", "artistName": "capcaprice" }
}
```

Turn on `downloadMedia` and `mediaStorageUrls` becomes an array of direct links to the downloaded files in the key-value store - one for an image, one per carousel item, or one for a Reel's video.

### Tips

- **Only public accounts return data.** Private or nonexistent accounts return no posts.
- **`maxResults` applies per username**, not to the whole run - 3 usernames with `maxResults: 20` can return up to 60 rows.
- **A residential proxy matters more than session cookies** for avoiding rate limits - use both for the most reliable runs.
- **Carousels can mix images and videos** - check each child's own `type` field rather than assuming the whole post is one media type.

### Frequently asked questions

**Do I need to log in to scrape Instagram posts?**
No. This Instagram post scraper works without an Instagram login. Providing a `sessionid`/`csrftoken` is optional and only improves reliability under heavy rate limiting.

**Can I download Instagram photos and videos, not just the links?**
Yes - set `downloadMedia: true` and every post's actual media (all carousel images/videos, or a Reel's full video) is downloaded and linked in its dataset row.

**Does this scrape Instagram carousels (multi-photo posts)?**
Yes - carousel posts return a `carouselChildren` array with every item's own media URL, type, and dimensions.

**Can I get an Instagram account's entire post history?**
Yes - the actor paginates through as many posts as you set in `maxResults`, not just the first page.

**Does it work for Reels too, or only photos?**
Both. Reels are returned with their video URL, view count, and audio/track info alongside regular photo and carousel posts.

# Actor input Schema

## `usernames` (type: `array`):

Instagram accounts to scrape posts from - a bare username ("capcaprice"), an "@handle", or a full profile URL ("https://www.instagram.com/capcaprice") all work. Only public accounts return data.

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

Stop scraping a given account once this many posts have been collected. Paginates through the account's post history as needed to reach this.

## `downloadMedia` (type: `boolean`):

If enabled, downloads each post's actual media (image, every carousel image, or reel video) into the key-value store, and adds storage link(s) to that post's dataset row.

## `sessionid` (type: `string`):

Optional. Scraping works without it, but a logged-in session can improve reliability if Instagram is rate-limiting anonymous requests hard. Log into instagram.com in a browser, open DevTools -> Application/Storage -> Cookies, and copy the value of the `sessionid` cookie. Must come from the same session as `csrftoken` below. Use a throwaway/secondary account, not your main one.

## `csrftoken` (type: `string`):

Optional. Must come from the same logged-in browser session as `sessionid` above - same DevTools Cookies panel, the row named `csrftoken`.

## `proxyConfiguration` (type: `object`):

Required - Instagram aggressively rate-limits and flags datacenter IPs. A residential proxy is strongly recommended.

## Actor input object example

```json
{
  "usernames": [
    "capcaprice"
  ],
  "maxResults": 20,
  "downloadMedia": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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 = {
    "usernames": [
        "capcaprice"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("jordan-byte/instagram-post-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 = { "usernames": ["capcaprice"] }

# Run the Actor and wait for it to finish
run = client.actor("jordan-byte/instagram-post-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 '{
  "usernames": [
    "capcaprice"
  ]
}' |
apify call jordan-byte/instagram-post-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jordan-byte/instagram-post-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/WrUTnkpbbKfbxM9TX/builds/HCePQVG4m2xHvnmXj/openapi.json
