# Instagram Post & Reel Scraper (`saketh_balijepalli/instagram-post-reel-scraper`) Actor

Scrapes public Instagram profile posts and reels, or looks up a single post/reel by URL. No login required.

- **URL**: https://apify.com/saketh\_balijepalli/instagram-post-reel-scraper.md
- **Developed by:** [Saketh Balijepalli](https://apify.com/saketh_balijepalli) (community)
- **Categories:** Social media, Automation, Open source
- **Stats:** 2 total users, 1 monthly users, 0.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.

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 Post & Reel Scraper

An Apify Actor that scrapes public Instagram profile posts and reels, or looks up a single post/reel by URL. No Instagram login required.

### Input

Provide **one** of:

- `username` — a public Instagram username to scrape posts and reels from
- `postOrReelUrl` — a direct URL to a single public post or reel to look up

At least one is required; the Actor rejects a run with neither. If both are given, `postOrReelUrl` takes priority and `username` is ignored.

Optionally:

- `proxyConfiguration` — route requests through your own proxy (or Apify Proxy, at your own cost). Left empty, the Actor runs proxy-less by default at no extra cost — see the limitation below.

### Auth model

v1 is **anonymous-only** — no Instagram login, session cookie, or credentials are ever used or requested. This keeps the Actor simple and avoids handling user credentials, at the cost of two limits Instagram imposes on logged-out access:

- Only public profiles and public posts/reels are reachable. A private profile fails the run with a clear "private profile" error message rather than completing with a silent empty Dataset.
- Anonymous pagination has a hard wall: Instagram serves only the first page of a profile's posts/reels to a logged-out request and rejects further pagination with an explicit error. When a profile has more items beyond that first page, the run still completes successfully with whatever was collected, and reports a status message that results may be incomplete — rather than silently truncating or failing the run.

### Output

One Dataset item per scraped post or reel, all sharing this schema:

| Field | Type | Notes |
| --- | --- | --- |
| `shortcode` | `string` | Instagram's short code for the item (from its URL) |
| `ownerUsername` | `string \| null` | Null if Instagram didn't include it in the response |
| `contentType` | `"post" \| "reel"` | |
| `caption` | `string \| null` | |
| `timestamp` | `number` | Unix timestamp (seconds) the item was posted |
| `likeCount` | `number \| null` | |
| `commentCount` | `number \| null` | |
| `mediaType` | `"image" \| "video" \| "carousel"` | |
| `mediaUrl` | `string \| null` | A single representative URL: the video file for videos, or the cover/first image for images and carousels. Individual carousel slide URLs are not included in v1. |

Reel-specific fields (view count, duration) are **not** included in v1 — Instagram doesn't expose them on the anonymous single-item query this Actor uses.

### Pricing

This Actor uses Apify's pay-per-event pricing, charged per successfully scraped item via one of two events:

- `post-scraped` — charged for each post pushed to the Dataset
- `reel-scraped` — charged for each reel pushed to the Dataset

A single-URL lookup charges whichever of these two matches the looked-up item's content type; there is no separate "URL lookup" event. Both events are priced below the lowest current comparable competitor at the time of listing — see the Actor's Store page for current prices.

### Known limitation: no bundled proxy

This Actor never uses a paid proxy by default — all requests run proxy-less unless you supply your own `proxyConfiguration` input (see above), so proxy cost, if any, stays entirely on you. Without a proxy, all runs share this Actor's IP reputation, so a higher block/ban rate from Instagram is possible, especially under heavy or repeated use. Supplying your own proxy reduces that risk.

### Maintenance

This Actor is maintained best-effort: shipped, then revisited occasionally rather than under an ongoing SLA. Instagram's page structure and anonymous-access behavior can change without notice, which may break scraping until the next update.

### Disclaimer

This Actor is provided for lawful and research use only. You are responsible for ensuring your use complies with Instagram's Terms of Service and all applicable laws — this Actor's developer makes no guarantee of ongoing compliance with Instagram's Terms of Service. Use it at your own risk.

# Actor input Schema

## `username` (type: `string`):

Public Instagram username to scrape posts and reels from. Provide this or postOrReelUrl.

## `postOrReelUrl` (type: `string`):

Direct URL to a single public Instagram post or reel to look up. Provide this or username.

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

Optional. Route requests through your own proxy (or Apify Proxy, at your own cost) to reduce the chance of being blocked. Left empty, the Actor runs proxy-less by default at no extra cost.

## Actor input object example

```json
{
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `scrapedItems` (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 = {
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("saketh_balijepalli/instagram-post-reel-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 = { "proxyConfiguration": { "useApifyProxy": False } }

# Run the Actor and wait for it to finish
run = client.actor("saketh_balijepalli/instagram-post-reel-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 '{
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call saketh_balijepalli/instagram-post-reel-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,saketh_balijepalli/instagram-post-reel-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/4GgCwJJzfVPAXaa6v/builds/Tf3kk3gtZacq2X2wl/openapi.json
