# Instagram Post Scraper (`supreme_coder/instagram-post-scraper`) Actor

Scrape instagram posts or reels from user profiles, hashtags, post urls. No cookies or Login required. Costs only $0.3 per 1k

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

## Pricing

from $0.30 / 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 Posts Scraper 📸 — Scrape Instagram Posts, Reels, Hashtags & Search

**Extract Instagram posts, reels, photos, videos and carousels at scale — no login, no password, no cookies required.** This Instagram Posts Scraper turns any public **profile, hashtag, keyword search, or post URL** into clean, structured JSON, CSV or Excel data in seconds. Perfect for marketers, researchers, data analysts and developers who need reliable Instagram data without the headache of building and maintaining a scraper.

> Scrape Instagram by **username**, **#hashtag**, **search keyword**, or a direct **post / reel link** — and get likes, comments, captions, view counts, media URLs, author details and more.

***

### ✨ What this Instagram scraper does

- 🧑‍🚀 **Scrape posts from any public Instagram profile** (e.g. `nasa`) — newest first
- \#️⃣ **Scrape posts by hashtag** (e.g. `#travel`, `#fitness`)
- 🔎 **Scrape posts by search keyword** — just type the words, no URL needed
- 🎯 **Scrape a single post or reel** from its URL
- 🖼️ Handles **photos, videos, reels and carousels (sidecars)** automatically
- 📊 Returns **likes, comments, views, captions, hashtags, mentions, location, tagged users** and direct **media download URLs**
- ⏱️ **Date filtering** — only keep posts newer than a date you choose
- 🔢 **Limit control** — cap how many posts you pull per source
- 🔐 **No Instagram login or cookies needed** — nothing to configure, no account-ban risk for you

***

### 💡 Popular use cases

| Who | What they use it for |
|---|---|
| 📣 **Marketers & agencies** | Track competitors, analyse top-performing content, find trending posts in a niche |
| 🤝 **Influencer marketing** | Discover creators by hashtag, vet engagement (likes/comments/views) before outreach |
| 📈 **Data analysts & researchers** | Build datasets for social-media trend, sentiment and engagement analysis |
| 🛍️ **E-commerce & brands** | Monitor brand mentions, user-generated content and product hashtags |
| 🧲 **Lead generation** | Find and qualify prospects posting about your topic |
| 📰 **Journalists & OSINT** | Collect public posts around an event, place or hashtag |

***

### 🚀 How to use it (step by step)

No coding needed. If you can fill in a form, you can use this scraper.

1. **Click "Try for free" / Start.**
2. **Add your sources.** Paste profile, hashtag or post URLs into **Source URLs**, and/or type plain words into **Search keywords** (add as many as you like).
3. **Set a limit** (optional). Use **Limit per source** to cap how many posts you want from each profile/hashtag/search.
4. **Pick a date** (optional). Use **Scrape until date** to only collect recent posts.
5. **Click "Start".** Watch posts stream into the results table.
6. **Download your data** as **JSON, CSV, Excel, HTML or XML**, or pull it via the API.

That's it — your Instagram data is ready to use. 🎉

***

### ⚙️ Input fields

| Field | Type | Emoji | Description |
|---|---|---|---|
| `urls` | array of text | 🔗 | Instagram **profile** (`/<username>/`), **post/reel** (`/p/<code>/`, `/reel/<code>/`), **hashtag** (`/explore/tags/<tag>/`) or **search** (`/explore/search/keyword/?q=...`) URLs |
| `search` | array of text | 🔎 | **Search keywords** — type a word for a keyword search, or prefix with `#` for a hashtag (e.g. `#nasa`). Add multiple |
| `limitPerSource` | number | 🔢 | Max posts to scrape per profile/hashtag/search (leave empty for as many as possible) |
| `scrapeUntil` | date | 📅 | Only scrape posts **newer** than this date |
| `rawData` | true / false | 🧬 | Advanced: return Instagram's raw post objects instead of the clean output below |

> You can provide **`urls`, `search`, or both**. At least one is required.

#### 📝 Example input

```json
{
  "urls": [
    "https://www.instagram.com/nasa/",
    "https://www.instagram.com/explore/tags/travel/",
    "https://www.instagram.com/p/DS82bloETJ0/"
  ],
  "search": ["apify", "#webscraping"],
  "limitPerSource": 50,
  "scrapeUntil": "2025-01-01"
}
```

***

### 📤 Output

Every post is returned as one clean, ready-to-use record. Export to **JSON, CSV, Excel, HTML or XML**.

#### 📦 Sample output

```json
{
  "id": "3800151575931990644",
  "shortCode": "DS82bloETJ0",
  "url": "https://www.instagram.com/reel/DS82bloETJ0/",
  "type": "video",
  "productType": "clips",
  "isVideo": true,
  "caption": "The official FIFA World Cup ball went to space 🛰️ #space #nasa",
  "hashtags": ["space", "nasa"],
  "mentions": ["fifa"],
  "commentsCount": 1328,
  "likesCount": 27313,
  "viewCount": 1840221,
  "videoDuration": 58.0,
  "timestamp": "2026-01-01T02:14:08.000Z",
  "displayUrl": "https://instagram.fxyz.fbcdn.net/v/....jpg",
  "videoUrl": "https://instagram.fxyz.fbcdn.net/o1/v/....mp4",
  "dimensions": { "width": 720, "height": 1280 },
  "isPinned": false,
  "isPaidPartnership": false,
  "ownerUsername": "nasa",
  "ownerId": "528817151",
  "owner": {
    "id": "528817151",
    "username": "nasa",
    "fullName": "NASA",
    "isPrivate": false,
    "isVerified": true,
    "profilePicUrl": "https://instagram.fxyz.fbcdn.net/v/....jpg"
  },
  "location": { "id": "212999109", "name": "Kennedy Space Center", "slug": null },
  "taggedUsers": [{ "username": "fifa", "fullName": "FIFA", "id": "...", "position": [0.5, 0.5] }],
  "coauthors": [],
  "childPosts": [],
  "inputUrl": "https://www.instagram.com/nasa/"
}
```

#### 🗂️ Output fields

| Field | Emoji | Description |
|---|---|---|
| `id` | 🆔 | Unique Instagram media ID |
| `shortCode` | 🔑 | Post shortcode (the code in the post URL) |
| `url` | 🔗 | Direct link to the post or reel |
| `type` | 🏷️ | `image`, `video` or `sidecar` (carousel) |
| `productType` | 🎬 | `feed`, `clips` (reel), `igtv`, etc. |
| `isVideo` | ▶️ | `true` if the post is a video/reel |
| `caption` | 📝 | Full post caption text |
| `hashtags` | #️⃣ | Hashtags found in the caption |
| `mentions` | 📣 | @-mentions found in the caption |
| `likesCount` | ❤️ | Number of likes |
| `commentsCount` | 💬 | Number of comments |
| `viewCount` | 👁️ | Video/reel views (when available) |
| `videoDuration` | ⏱️ | Video length in seconds |
| `timestamp` | 🕒 | When the post was published (ISO 8601) |
| `displayUrl` | 🖼️ | Highest-resolution image / thumbnail URL |
| `videoUrl` | 🎥 | Direct video file URL (for videos/reels) |
| `dimensions` | 📐 | Media width and height in pixels |
| `isPinned` | 📌 | `true` if pinned to the top of the profile |
| `isPaidPartnership` | 🤝 | `true` for sponsored / paid-partnership posts |
| `ownerUsername` | 👤 | Username of the post author |
| `ownerId` | 🆔 | Numeric ID of the post author |
| `owner` | 🧑 | Author details (name, verified, private, avatar) |
| `location` | 📍 | Tagged location (id, name) |
| `taggedUsers` | 🏷️ | People tagged in the media |
| `coauthors` | 👥 | Collaborators on the post |
| `childPosts` | 🖼️🖼️ | Items inside a carousel (each with its own media URLs) |
| `inputUrl` | 🌐 | The source URL/keyword this post came from |

***

### 🔌 Using the API

Run the scraper programmatically with the [Apify API](https://docs.apify.com/api/v2). Replace `YOUR_TOKEN` with your Apify API token and `USERNAME~instagram-post` with the actor's ID.

#### Run and get results in one call (cURL)

```bash
curl -X POST "https://api.apify.com/v2/acts/USERNAME~instagram-post/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
        "search": ["#nasa"],
        "limitPerSource": 50
      }'
```

#### Start a run (JavaScript / Apify client)

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_TOKEN' });

const run = await client.actor('USERNAME/instagram-post').call({
  urls: ['https://www.instagram.com/nasa/'],
  search: ['#travel'],
  limitPerSource: 100,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Start a run (Python / Apify client)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")

run = client.actor("USERNAME/instagram-post").call(run_input={
    "search": ["apify", "#webscraping"],
    "limitPerSource": 50,
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

📚 More: [Apify API reference](https://docs.apify.com/api/v2) · [API client for JavaScript](https://docs.apify.com/api/client/js/) · [API client for Python](https://docs.apify.com/api/client/python/)

***

### ❓ FAQ

**Do I need an Instagram account, password or cookies?**
No. You only provide the public profiles, hashtags or keywords you want to scrape — authentication is handled for you.

**Is it legal to scrape Instagram?**
This scraper collects **publicly available** data only. You are responsible for how you use the data and for complying with applicable laws (e.g. GDPR), Instagram's Terms, and not collecting personal data without a lawful basis. When in doubt, consult a lawyer.

**How many posts can I scrape?**
As many as you like — use `limitPerSource` to control the volume per source. Very large profiles are paginated automatically.

**Why did my keyword search return "No posts found"?**
Generic multi-word phrases often surface **accounts** rather than posts in Instagram's top results. For post results, prefix your term with `#` (e.g. `#webscraping`) or use a hashtag URL.

**Search results aren't in date order — why?**
Hashtag/keyword search returns Instagram's **top (ranked)** results, not strictly newest-first. Profile scraping *is* chronological, so use `scrapeUntil` there for precise date filtering.

**What export formats are supported?**
JSON, CSV, Excel, HTML, XML, plus direct API/webhook access.

***

### 🔎 Keywords

Instagram scraper, Instagram posts scraper, scrape Instagram, Instagram data extractor, Instagram hashtag scraper, Instagram reels scraper, Instagram profile scraper, Instagram search scraper, export Instagram posts to CSV/JSON/Excel, Instagram API alternative, scrape Instagram without login.

# Actor input Schema

## `urls` (type: `array`):

Supported URLs: Instagram profile URL, post/reel URL, hashtag URL (/explore/tags/<tag>/), or keyword search URL (/explore/search/keyword/?q=<query>)

## `search` (type: `array`):

Search terms to scrape posts for. A plain word does a keyword search; prefix with # for a hashtag search (e.g. "#nasa"). Provide one or more.

## `limitPerSource` (type: `integer`):

Limit number of posts scraped per profile URL, leave empty for unlimited

## `scrapeUntil` (type: `string`):

Only scrape posts newer than the given date. Applies to profile URLs — Instagram ranks keyword and hashtag search results by relevance and does not support sorting them by date, so this option is ignored for search sources.

## `rawData` (type: `boolean`):

Push the scraped data directly to the dataset without any processing and filtering. Useful for retrieving fields not exposed by the default output

## Actor input object example

```json
{
  "urls": [
    "https://www.instagram.com/nasa/",
    "https://www.instagram.com/explore/tags/apify/",
    "https://www.instagram.com/p/DS82bloETJ0/"
  ],
  "search": [
    "apify",
    "#webscraping"
  ],
  "limitPerSource": 12,
  "rawData": false
}
```

# 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 = {
    "urls": [
        "https://www.instagram.com/nasa/",
        "https://www.instagram.com/explore/tags/apify/",
        "https://www.instagram.com/p/DS82bloETJ0/"
    ],
    "search": [
        "apify",
        "#webscraping"
    ],
    "limitPerSource": 12
};

// Run the Actor and wait for it to finish
const run = await client.actor("supreme_coder/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 = {
    "urls": [
        "https://www.instagram.com/nasa/",
        "https://www.instagram.com/explore/tags/apify/",
        "https://www.instagram.com/p/DS82bloETJ0/",
    ],
    "search": [
        "apify",
        "#webscraping",
    ],
    "limitPerSource": 12,
}

# Run the Actor and wait for it to finish
run = client.actor("supreme_coder/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 '{
  "urls": [
    "https://www.instagram.com/nasa/",
    "https://www.instagram.com/explore/tags/apify/",
    "https://www.instagram.com/p/DS82bloETJ0/"
  ],
  "search": [
    "apify",
    "#webscraping"
  ],
  "limitPerSource": 12
}' |
apify call supreme_coder/instagram-post-scraper --silent --output-dataset

```

## MCP server setup

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