# Instagram Scraper (`rainminer/instagram-scraper`) Actor

Scrape public Instagram posts, reels, profiles, hashtags, and place pages from start URLs — captions, engagement, images, and profile stats without login.

- **URL**: https://apify.com/rainminer/instagram-scraper.md
- **Developed by:** [rainminer](https://apify.com/rainminer) (community)
- **Categories:** Social media, Other
- **Features:** Limited permissions
- **Stats:** 3 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 result scrapeds

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](https://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Instagram_logo_2016.svg/220px-Instagram_logo_2016.svg.png)

### What does Instagram Scraper do?

**Instagram Scraper** collects **public** Instagram data from start URLs you provide — **posts**, **reels**, **profiles**, **hashtags**, and **place** pages. No Instagram login or user cookies are required.

Paste direct post/reel links, a profile URL, a hashtag explore page, or a location page, set **max items per start URL**, and export structured JSON (or CSV/Excel via Apify) with captions, engagement counts, images, usernames, and profile stats.

Use it for social listening, competitor monitoring, influencer research, campaign tracking, or feeding Instagram datasets into spreadsheets, BI tools, and apps.

### What can this Instagram Scraper do?

- Scrape **single posts and reels** from `/p/` and `/reel/` URLs
- Scrape **profiles** — follower/following/post counts plus recent posts from the public grid
- Scrape **hashtags** from `/explore/tags/{tag}/` pages
- Scrape **places** from `/explore/locations/{id}/` pages
- Respect **maxItems per start URL** (each input URL has its own limit)
- Optional **Apify Proxy** when Instagram blocks your IP

### What Instagram data can you extract?

| Field | Description |
| --- | --- |
| `type` | `Post`, `Reel`, or `Profile` |
| `url` | Canonical Instagram URL |
| `shortcode` | Post/reel shortcode when applicable |
| `caption` | Public caption or profile bio snippet |
| `imageUrl` | Primary image (post/reel preview or profile picture) |
| `ownerUsername` | Public @ handle |
| `ownerFullName` | Display name when available |
| `ownerProfileUrl` | Profile link |
| `likesCount` / `commentsCount` | Engagement from public metadata (posts/reels) |
| `followersCount` / `followingCount` / `postsCount` | Profile stats (profile rows) |
| `postDate` | Date string from public metadata when shown |
| `hashtags` | Hashtags parsed from caption |
| `startUrl` / `startKind` | Which input URL produced the row |
| `scrapedAt` | ISO timestamp |

### How to scrape Instagram

1. Open the Actor **Input** tab.
2. Add one or more **start URLs** (post, reel, profile, hashtag, or place).
3. Set **maxItems** — maximum rows **per start URL**.
4. Enable **Apify Proxy** (often residential) if you see empty pages or blocks.
5. Run the Actor and download the dataset.

Only **public** pages are supported. Private accounts, stories that require login, and DMs are out of scope.

### Input example

```json
{
  "startUrls": [
    { "url": "https://www.instagram.com/natgeo/" },
    { "url": "https://www.instagram.com/explore/tags/nature/" },
    { "url": "https://www.instagram.com/natgeo/p/DeuOR-CjKE9/" }
  ],
  "maxItems": 5,
  "proxyConfiguration": { "useApifyProxy": false }
}
```

On **profile** start URLs, one **Profile** row is saved first (counts toward `maxItems`), then posts/reels from the public grid up to the same per-URL limit.

### Output example

```json
{
  "type": "Post",
  "url": "https://www.instagram.com/natgeo/p/DeuOR-CjKE9/",
  "shortcode": "DeuOR-CjKE9",
  "caption": "Some of the best reasons to travel in 2027...",
  "imageUrl": "https://scontent.cdninstagram.com/...",
  "ownerUsername": "natgeo",
  "ownerFullName": "National Geographic",
  "ownerProfileUrl": "https://www.instagram.com/natgeo/",
  "likesCount": 16000,
  "commentsCount": 228,
  "postDate": "October 20, 2026",
  "hashtags": ["bestoftheworld"],
  "startUrl": "https://www.instagram.com/natgeo/",
  "startKind": "profile",
  "followersCount": null,
  "followingCount": null,
  "postsCount": null,
  "scrapedAt": "2026-10-30T12:00:00.000Z"
}
```

### How much does scraping cost?

When pay-per-event pricing is enabled, you pay once per **result row** saved to the dataset (post, reel, or profile). Apify platform usage (compute, proxy traffic, storage) applies separately.

Check the **Pricing** tab on this Actor’s Store page for current event rates.

### Tips and limitations

- Instagram changes layouts often — use proxies and reasonable `maxItems` for stable runs.
- Hashtag and place pages may redirect to `/popular/{tag}/`; the Actor follows public grid links on the loaded page.
- Carousel posts expose a primary `imageUrl` from public metadata; full galleries are not expanded in v1.
- Rate limits and empty grids usually mean you need **Apify Proxy** or fewer concurrent runs.

### Integrations

Export dataset items to **Google Sheets**, **Slack**, **Zapier**, **Make**, or your stack via the Apify API and webhooks.

### Privacy and compliance

Scrape only **public** Instagram content you are allowed to use under applicable law and Instagram’s terms. This Actor does not accept login credentials.

### Support

Issues or feature requests: use the Apify Console **Issues** tab for this Actor or contact the developer via the Store listing.

### Image Credit

Image credit: [Instagram](https://www.instagram.com/)

# Actor input Schema

## `startUrls` (type: `array`):

Instagram URLs: posts (/p/), reels (/reel/), profiles (/username/), hashtags (/explore/tags/…), or places (/explore/locations/…).

## `maxItems` (type: `integer`):

Maximum dataset rows per start URL (posts/reels; profile pages also emit one profile row that counts toward this limit).

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

Instagram often blocks datacenter IPs. Apify Proxy (residential) is recommended for cloud runs and stable grids.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.instagram.com/natgeo/"
    },
    {
      "url": "https://www.instagram.com/explore/tags/nature/"
    }
  ],
  "maxItems": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "startUrls": [
        {
            "url": "https://www.instagram.com/natgeo/"
        },
        {
            "url": "https://www.instagram.com/explore/tags/nature/"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rainminer/instagram-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 = { "startUrls": [
        { "url": "https://www.instagram.com/natgeo/" },
        { "url": "https://www.instagram.com/explore/tags/nature/" },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("rainminer/instagram-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 '{
  "startUrls": [
    {
      "url": "https://www.instagram.com/natgeo/"
    },
    {
      "url": "https://www.instagram.com/explore/tags/nature/"
    }
  ]
}' |
apify call rainminer/instagram-scraper --silent --output-dataset

```

## MCP server setup

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