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

Instagram post scraper for public verified brand and media accounts: the latest 6 posts per profile with likes, comments, video views, caption, hashtags, date, image and video links. No login. Monitor mode returns each new post once. Personal accounts are skipped.

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

## Pricing

from $0.96 / 1,000 result items

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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 Post Scraper

Instagram Post Scraper returns the latest posts of verified brand and media accounts on Instagram, one row per post, with likes, comments, video views, the caption, hashtags, the posting date, image and video links and carousel items. You give it account handles or profile links. No Instagram login, cookies or API key are needed.

**Try it:** the prefilled example returns 12 rows in about 25 seconds and costs about $0.015. Results cost $1.20 per 1,000.

### What you get

Real rows from the example dataset (`usernames: ["nasa", "nike"]`):

| ownerUsername | shortcode | type | caption | likeCount | commentCount | videoViewCount | takenAt |
|---|---|---|---|---|---|---|---|
| `nasa` | `DfSi56IFwZK` | `carousel` | "This glowing cloud is a dwarf galaxy, a type of ga..." | `229836` | `593` | `null` | `2026-11-03T18:39:27Z` |
| `nasa` | `DfF3eqGSKKc` | `video` | "More power loading. 🔋 Today, NASA astronaut Anil..." | `14764` | `153` | `243349` | `2026-10-29T20:35:35Z` |
| `nike` | `De-XRdaPg2A` | `video` | "Queen for a third time, @user." | `100617` | `584` | `429521` | `2026-10-26T22:34:25Z` |
| `nike` | `DeySgo5Bn_M` | `image` | "Nike x @user. The stage is set 🏏" | `176784` | `1266` | `null` | `2026-10-22T06:00:29Z` |

Full row: `id`, `url`, `rowType`, `ownerUsername`, `shortcode`, `type` (image, video or carousel), `productType`, `caption`, `mentionCount`, `hashtags`, `likeCount`, `commentCount`, `videoViewCount`, `takenAt`, `displayUrl`, `videoUrl`, `carouselMediaUrls`, `isPinned`, `locationName`, `commentsDisabled`, `query`, `scrapedAt`.

With `includeProfile: true` each account also gets one row with `rowType: "profile"` and its public counters: `followersCount`, `postsCount` and `isVerified`. Instagram no longer shows a logged-out visitor the following count, the business flag or the category, so `followingCount`, `isBusinessAccount` and `category` are `null`.

**Up to 6 posts per account.** Instagram's public profile embed shows a logged-out visitor the latest 6 posts of a profile. Older posts need a login, and this actor never logs in. For a brand that posts daily that covers about the last week; run it on a schedule in monitor mode to build a full history.

### Verified accounts only

The actor reads accounts that Instagram marks as verified (brands, media, public figures). Instagram no longer tells a logged-out visitor whether an account is a business account, so any other handle is treated as a personal account: the actor skips it before reading any post, writes a line in the log and does not charge for it. The run statistics count these as `skippedPersonalProfiles`. Private accounts are skipped the same way.

Rows hold the account's own posts and nothing about other people. Tagged users, collaborators, the bio, bio links, e-mail, phone and address are never returned. In captions every @mention is replaced with `@user` (the original number of mentions is kept in `mentionCount`), and e-mail addresses and phone numbers are removed.

### Related actors

- [TikTok Video Scraper](https://apify.com/datahamster/tiktok-video-scraper) returns views, likes, comments and saves of TikTok videos.
- [Facebook Reels Scraper](https://apify.com/datahamster/facebook-reels-videos) lists the reels of Facebook Pages with views and reactions.
- [YouTube Search Scraper](https://apify.com/datahamster/youtube-search-scraper) finds YouTube videos for a keyword with their view counts.
- [Bluesky Scraper](https://apify.com/datahamster/bluesky-scraper) collects public Bluesky posts with likes and reposts.

### Use cases

- Track what competitors post on Instagram and which posts earn the most likes, comments and views.
- Report a brand's Instagram performance every week without opening the app.
- Collect captions and hashtags of brands in a niche for content research.

### Monitor mode

Save the input as a task, set **Mode** to `monitor` and run it on a schedule (for example every 6 hours). Each run returns only posts whose shortcode it has not reported before, so you get every new post once. In monitor mode `maxItems` is raised to 6 times the number of accounts when that is higher, so every account is checked on every run. Because a profile shows its latest 6 posts, schedule the task often enough that a brand does not publish more than 6 posts between two runs. Profile rows are not produced in monitor mode.

### Input

| Field | Meaning | Default |
|---|---|---|
| `usernames` | Instagram handles (`nasa`, `@nike`) or profile links (`https://www.instagram.com/nasa/`) | `nasa`, `nike` |
| `includeProfile` | Also return one row per account with its follower and post counts | `false` |
| `maxItems` | Stop after this many rows. In monitor mode it is raised to 6 x the number of accounts when that is higher | `20` |
| `mode` | `scrape` or `monitor` | `scrape` |
| `monitorStateId`, `webhookUrl`, `telegramBotToken`, `telegramChatId` | Monitor state key and alert targets | empty |

### Pricing

| Event | Price |
|---|---|
| result | $0.0012 per post ($1.20 per 1,000) |
| monitor-check | $0.005 per monitor run |
| change | $0.0012 per new post reported in monitor mode |

Apify Store discounts: SILVER -10%, GOLD and higher -20% on every event. You pay only for rows that are pushed; a profile row counts as one result. Personal, private and unknown accounts produce no rows and no charge. Proxy traffic is billed by Apify on top when Instagram blocks the free tier and the actor moves to a datacenter or residential proxy.

**Found it useful?** A short review on the Store page helps other people find this actor and tells us what to improve. If something is wrong, open an issue on the actor page.

### How it works

1. Each handle is read from its public profile embed, the same page Instagram serves when a profile is embedded on a website. One request returns the verified flag, the public counters and the latest 6 posts.
2. For video posts the view count and video link come from the post's own public embed, one extra request per video. If Instagram does not serve it, `videoViewCount` and `videoUrl` stay empty and the post is still returned.
3. Accounts that are not verified are dropped before any post is read.
4. If Instagram answers with a login wall or a rate limit, the request is repeated after a pause and then through a datacenter and then a residential proxy. When every account of a run is walled on every proxy, the run stops with a "blocked" reason instead of returning an empty dataset.

### Limits

- **Latest 6 posts per account.** Instagram serves older posts and the rest of the grid only to logged-in users.
- **Collab posts** shown on the requested profile are returned under that profile's handle; the other collaborators are never named.
- **Image and video links are signed and expire** after a few days. Download them soon after the run if you need the files.
- **Like counts can be hidden** by the account owner; `likeCount` is then `null`.
- **No comments text, no tagged people, no followers lists.** Only the account's own posts and public counts.
- Instagram limits how often one IP address may call this endpoint. Large lists of accounts may move to a paid proxy tier, and a run stops with a "rate_limited" reason after 3 accounts in a row are walled on every proxy.

### FAQ

**Do I need an Instagram account?** No. Every request is a logged-out request.

**Why was my handle skipped?** It is not a verified account, it is private, or it does not exist. The run log names the reason for each skipped handle, and none of them is charged.

**Can I get more than 6 posts?** Not without a login. Run the actor in monitor mode on a schedule and it collects each new post as it appears.

### Changelog

- 0.1: first release with the latest 12 posts per business account, optional profile row and monitor mode for new posts.
- 0.2 (2026-11-04): Instagram closed the profile endpoint for logged-out visitors (404 for every account). The actor now reads the public profile embed: the latest 6 posts of verified accounts, video views from each video's embed. A run where every account answers 404 now stops with a "source_changed" reason instead of an empty dataset.

# Actor input Schema

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

Handles of public verified accounts (nasa, @nike) or profile links (https://www.instagram.com/nasa/), one per line. Any other account is treated as personal and skipped without a charge, and so are private accounts.

## `includeProfile` (type: `boolean`):

Also return one row per account with its follower and post counts and verified flag. Not produced in monitor mode.

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

Stop after this many rows (you are charged only for pushed rows). Instagram shows a logged-out visitor at most 6 posts per account. In monitor mode the limit is raised to 6 x the number of accounts when that is higher, so every account is checked.

## `mode` (type: `string`):

scrape = full results; monitor = only new/changed items since the previous run of this task

## `monitorStateId` (type: `string`):

Optional state id when not running as a saved task (monitor mode)

## `webhookUrl` (type: `string`):

POST a change summary here in monitor mode

## `telegramBotToken` (type: `string`):

Optional: bot token for monitor-mode change summaries

## `telegramChatId` (type: `string`):

Optional: chat id that receives monitor-mode summaries

## Actor input object example

```json
{
  "usernames": [
    "nasa",
    "nike"
  ],
  "includeProfile": false,
  "maxItems": 20,
  "mode": "scrape"
}
```

# Actor output Schema

## `results` (type: `string`):

All pushed rows (dataset, JSON)

## `resultsTable` (type: `string`):

Dataset in the Console viewer

## `runSummary` (type: `string`):

RUN_SUMMARY record

# 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": [
        "nasa",
        "nike"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("datahamster/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": [
        "nasa",
        "nike",
    ],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("datahamster/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": [
    "nasa",
    "nike"
  ],
  "maxItems": 20
}' |
apify call datahamster/instagram-post-scraper --silent --output-dataset

```

## MCP server setup

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