# Instagram Post Scraper: Posts, Likes & Captions by Profile (`xmolodtsov/instagram-post-scraper`) Actor

Export public Instagram data, no login: posts by profile or post URL, likes, comments counts, captions, locations, images, videos and carousel children.

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

## Pricing

from $0.60 / 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

Export public Instagram posts by profile or post URL, including likes, comment counts, captions, locations and media URLs. Collect **public Instagram data, no login**, and export one row per post as CSV, Excel or JSON.

Use it to compare public brand content, collect campaign posts or send engagement data to a reporting workflow. Images, videos and carousels share the same row format.

![Post scraper avatar](https://api.apify.com/v2/key-value-stores/2DxCOvbMjhvK3S1qP/records/instagram-post-scraper-avatar.png)

### Quick start

1. Enter `nasa`, `@nike`, a profile URL, or a post URL such as `https://www.instagram.com/p/DewuZccPEQA/`.
2. Set **Posts per profile** and the run-wide **Maximum posts per run**.
3. Keep the default Apify datacenter proxy, run and export the dataset.

The prefill requests 10 NASA posts. A post URL requests one row. No Instagram account or account cookies are needed.

```json
{"username":["nasa"],"resultsLimit":10,"maxItems":1000,"proxyConfiguration":{"useApifyProxy":true}}
```

Call the actor from an Apify integration or over HTTP:

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/xmolodtsov~instagram-post-scraper/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"username":["nasa"],"resultsLimit":10}'
```

For deeper jobs, start an asynchronous run and read its default dataset after completion. You can connect runs to n8n, Make, Zapier, webhooks or Apify schedules. Keep your token in the integration credential store.

### Input

| Field | Default | Meaning |
|---|---|---|
| `username` | Required | 1–100 handles, profile URLs or `/p/`, `/reel/`, `/tv/` post URLs. Trimmed and deduplicated; handle case is normalized and shortcode case is preserved. Invalid entries are skipped with a warning when valid inputs remain; all-invalid input fails `invalid:`. |
| `resultsLimit` | 30 | Maximum posts saved per profile, 1–10,000. Each post URL contributes at most one row. |
| `onlyPostsNewerThan` | Unset | UTC `YYYY-MM-DD` or relative `N days`. Tests each root timestamp and stops after four consecutive older posts. Up to three old pinned posts can appear first. No pinned-skipping guarantee. |
| `maxItems` | 1000 | Run-wide saved-row cap, 1–100,000. Free-plan limits can reduce it. |
| `proxyConfiguration` | Apify DC | Apify RESIDENTIAL is replaced by datacenter. Paid runs may use their own proxy URLs. Free runs use Apify Proxy only. |

Profiles run in input order. Root requests have bounded concurrency within each grid page, and rows are saved as the walk progresses. Results are deduplicated by post ID across inputs and reboots.

### Output

The overview shows URL, owner, type, caption, date, likes, comment count and location. IDs remain strings. Missing scalar values are `null`; absent collections are empty arrays. Hidden likes remain `null`.

This example retains identity and counters from a real NASA proof run. Caption text and personal attribution are redacted or replaced with explicit placeholders; signed media URLs are omitted here for readability.

```json
{
  "id": "4004634989362489982",
  "shortCode": "DeTUk4sDSp-",
  "url": "https://www.instagram.com/p/DeTUk4sDSp-/",
  "type": "Video",
  "productType": "clips",
  "caption": "[Caption redacted for privacy; @example_creator is a placeholder.]",
  "hashtags": [
    "example"
  ],
  "mentions": [
    "example_creator"
  ],
  "timestamp": "2026-10-10T15:15:02.000Z",
  "likesCount": 722728,
  "commentsCount": 7202,
  "videoDuration": 43.766666,
  "dimensionsHeight": 1908,
  "dimensionsWidth": 1074,
  "coauthorProducers": [
    "example_creator"
  ],
  "taggedUsers": [
    "example_creator"
  ],
  "locationName": null,
  "locationId": null,
  "isCommentsDisabled": null,
  "ownerUsername": "nasa",
  "ownerId": "528817151",
  "ownerFullName": "NASA",
  "inputUrl": "nasa",
  "scrapedAt": "2026-10-21T22:59:44.788Z"
}
```

![Real post dataset preview](https://api.apify.com/v2/key-value-stores/2DxCOvbMjhvK3S1qP/records/instagram-post-scraper-output-preview.png)

| Fields | Meaning |
|---|---|
| `id`, `shortCode`, `url` | Exact media identity and canonical `https://www.instagram.com/p/<code>/` URL. |
| `type`, `productType` | `Image`, `Video` or `Sidecar`, plus the source product type. |
| `caption`, `hashtags`, `mentions`, `timestamp` | Caption text, extracted tags and mentions, and ISO publication time. |
| `likesCount`, `commentsCount` | Public counters; comment text is separate and excluded. |
| `displayUrl`, `videoUrl`, `videoDuration` | Image/video playback URLs and source duration in seconds, when present. URLs expire. |
| `images`, `childPosts` | Carousel image URLs and children with `id`, `type`, `displayUrl`, `videoUrl`; empty for other types. |
| `dimensionsHeight`, `dimensionsWidth` | Source media dimensions. |
| `locationName`, `locationId` | Tagged location, when supplied; a null location is valid. |
| `coauthorProducers`, `taggedUsers` | Source-supplied usernames without profile enrichment. |
| `isCommentsDisabled` | Source comments setting when available. |
| `ownerUsername`, `ownerId`, `ownerFullName` | Public media owner; collaborative posts may name another owner. |
| `inputUrl`, `scrapedAt` | Original input and ISO collection time. |

Harmless source errors in location pictures or tagged-user objects do not discard a valid post. A malformed or mismatched post root is reported as an input failure.

### Pricing and free-plan limits

Billing uses the saved dataset-item event, titled **Post**. There are no actor start or add-on fees.

| Apify plan | USD per 1,000 posts |
|---|---:|
| Free | $0.78 |
| Bronze | $0.72 |
| Silver | $0.66 |
| Gold | $0.60 |
| Platinum / Diamond | $0.60 |

Examples: 10 posts cost $0.0078 at the Free rate; 100 cost $0.072 on Bronze; 1,000 cost $0.60 on Gold. Fewer saved rows mean fewer result events.

#### Is it free?

The developer limit on the Apify free plan is **100 results per run and 20 runs per calendar month (UTC)**. Free-tier result events consume available Apify credits at the rate above; the cap does not waive fees. Monthly reservations are atomic across concurrent runs and reset on the 1st. After the monthly limit, a run succeeds with a quota message before any target requests. Paid plans use the requested caps. Free runs use Apify Proxy only.

### Coverage and failure handling

The actor follows the public Posts-tab grid and hydrates each post from its public root. It stops at a clean source end, requested cap, four consecutive older posts, or a bounded failure. It does not download media or accumulate an entire profile in memory.

Unknown/private/unavailable inputs are counted separately when Instagram confirms their status. An individual input failure ends that input and allows later inputs to run. A global grid-query schema change ends the run. Saved rows survive later errors with a successful partial status. Zero rows succeed for confirmed empty outcomes; processing errors fail with `blocked:`, `network:`, `timeout:`, `invalid:`, `quota:` or `outdated:`. Missing/repeated cursors or repeated pages with more available are counted as truncations, never clean ends.

The actor stops starting requests before its platform deadline to flush rows and `STATISTICS`. A result-event ceiling ends successfully with **run budget reached**. Dataset rows seed deduplication and caps after a reboot. Check `STATISTICS` for per-input outcomes, requests, refusal codes, bytes, truncations and elapsed time.

Residential Apify Proxy is not used by this actor: an Apify `RESIDENTIAL` group is replaced by datacenter, with a warning and `STATISTICS.proxyOverride = "RESIDENTIAL->DATACENTER"`. Datacenter measured 0 refusals in the build proof. Paid runs can use their own proxy URLs for another route. A 300-post build proof measured about $0.028/1,000 posts in datacenter platform usage. This is a measured sample, not a price quote or reliability guarantee. Every retry uses fresh public guest tokens and a fresh proxy session. The guest-visible inventory and ordering can change, and counters or media URLs may differ from the app. Relative dates are evaluated at run start. No promise covers every post ever published.

### What's not included

Video views/plays, pinned flags, latest comments, downloads, private profiles, account access or contact enrichment are excluded. For video engagement fields use our [Instagram Reel Scraper](https://apify.com/xmolodtsov/instagram-reel-scraper); for comment text use our [Instagram Comment Scraper](https://apify.com/xmolodtsov/instagram-comment-scraper). These sibling links come from the live developer catalog.

### FAQ

#### Why did I receive fewer posts than requested?

The source may expose fewer posts; duplicates, dates, an unavailable input, the free cap, deadline or run budget can also reduce results. Inspect the input outcomes in `STATISTICS` for a clean end versus truncation.

#### Why are locations, duration or likes null?

The source may not supply them. Hidden likes remain null; null does not mean zero. A field-level source error can also remove an optional value while preserving the post.

#### Is it legal to scrape public Instagram data?

This actor accesses publicly available data without an account. You are responsible for checking your purpose, applicable terms and laws, including GDPR/CCPA obligations where relevant. Public information can still be personal data: minimize collection, respect deletion requests and avoid unwanted contact.

#### Where can I get help?

Use the Apify Issues tab with the run ID, input shape and affected public profile or post. Never include credentials. Logs and `STATISTICS` distinguish refusals, transport faults and pagination changes.

### More scrapers from this developer

**TikTok:** [TikTok Search Scraper](https://apify.com/xmolodtsov/tiktok-search-scraper): Videos and creators for any keyword, pay per result · [TikTok Profile Scraper (Pay Per Result)](https://apify.com/xmolodtsov/tiktok-profile-scraper): Profiles, followers and latest posts by username · [TikTok Comments Scraper](https://apify.com/xmolodtsov/tiktok-comments-scraper): Comments and full reply threads from any video · [TikTok Hashtag Scraper](https://apify.com/xmolodtsov/tiktok-hashtag-scraper): Videos for any hashtag, with views, likes and music · [TikTok Sound & Music Scraper](https://apify.com/xmolodtsov/tiktok-sound-scraper): Videos that use a sound or song · [TikTok Top Ads Scraper](https://apify.com/xmolodtsov/tiktok-top-ads-scraper): Public Creative Center ad rankings, engagement, media and landing pages

**Social & news:** [Reddit Search Scraper](https://apify.com/xmolodtsov/reddit-scraper): Posts by keyword, subreddit or author · [Google News Scraper](https://apify.com/xmolodtsov/google-news-scraper): Google News results as clean full-text articles · [Threads Replies Scraper](https://apify.com/xmolodtsov/threads-replies-scraper): Public post replies, likes, authors and inline nested replies · [VK Posts Scraper](https://apify.com/xmolodtsov/vk-posts-scraper): Public wall posts, engagement counts, repost context and attachment metadata

**Instagram:** [Instagram Reel Scraper](https://apify.com/xmolodtsov/instagram-reel-scraper): Public profile reels, plays, captions, music and media URLs · [Instagram Comment Scraper](https://apify.com/xmolodtsov/instagram-comment-scraper): Public post and reel comments, likes, timestamps and usernames

**E-commerce:** [Prom.ua Product Search Scraper](https://apify.com/xmolodtsov/prom-ua): Prom.ua product search results, no browser needed · [Amazon Product Search & Bestsellers Scraper](https://apify.com/xmolodtsov/amazon-search-scraper): Search results, Best Sellers and product details from Amazon · [AliExpress Search Scraper](https://apify.com/xmolodtsov/aliexpress-search-scraper): AliExpress products by keyword with prices, orders and shipping · [AliExpress Product Reviews Scraper](https://apify.com/xmolodtsov/aliexpress-reviews-scraper): Public product reviews, ratings, buyer photos and follow-up feedback

**Maps & leads:** [Google Maps Scraper](https://apify.com/xmolodtsov/google-maps-scraper): Places, leads and emails from Google Maps

**Ads:** [Facebook Ad Library Scraper (Meta Ads Library)](https://apify.com/xmolodtsov/facebook-ads-library-scraper): Ads from the Meta Ad Library, with EU reach and payers · [Google Ads Transparency Scraper](https://apify.com/xmolodtsov/google-ads-transparency-scraper): Google ad creatives by advertiser or domain, with regional details

**Video:** [YouTube Transcript Scraper](https://apify.com/xmolodtsov/youtube-transcript-scraper): Transcripts, subtitles and captions from YouTube videos · [YouTube Shorts Scraper](https://apify.com/xmolodtsov/youtube-shorts-scraper): Shorts of any channel with exact views, likes and duration · [YouTube Channel Scraper](https://apify.com/xmolodtsov/youtube-channel-scraper): Every video of a channel, with channel stats · [YouTube Search Scraper](https://apify.com/xmolodtsov/youtube-search-scraper): Search results and videos for any keyword · [YouTube Comments Scraper](https://apify.com/xmolodtsov/youtube-comments-scraper): Comments, replies and likes from any video · [Bilibili Comments Scraper](https://apify.com/xmolodtsov/bilibili-comments-scraper): Public hot comments and reply threads by video or keyword

**Jobs:** [SEEK Job Listings Scraper](https://apify.com/xmolodtsov/seek-jobs-scraper): Public AU/NZ job listings, salaries and redacted descriptions

# Changelog

This Actor's version history is a separate document: https://apify.com/xmolodtsov/instagram-post-scraper/changelog.md

# Actor input Schema

## `username` (type: `array`):

One to 100 handles (optional @), profile URLs, or /p/, /reel/, /tv/ post URLs. Profile handles are lowercased; shortcode case is preserved. Invalid entries are skipped with a warning if valid entries remain.

## `resultsLimit` (type: `integer`):

Maximum posts saved per profile. Profiles are processed in input order, subject to the run-wide maxItems cap and guest-visible source inventory.

## `onlyPostsNewerThan` (type: `string`):

Optional UTC date YYYY-MM-DD or relative N days, for example 30 days. Root timestamps are checked in grid order. Stops after four consecutive older posts because up to three pinned posts may appear first. Pinned-skipping is not available.

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

Run-wide saved result limit across all profiles. Apify free plan: 100 results per run and 20 runs per calendar month (UTC), a developer limit. Paid plans use the requested cap.

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

Residential Apify Proxy is not used by this actor: RESIDENTIAL is replaced by datacenter with a warning and STATISTICS.proxyOverride. Datacenter measured 0 refusals in the build proof. Paid runs may use their own proxy URLs for another route. Free runs use Apify Proxy only.

## Actor input object example

```json
{
  "username": [
    "nasa"
  ],
  "resultsLimit": 10,
  "maxItems": 1000,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One post per row: id (string), shortCode, url, type, productType, caption, hashtags, mentions, timestamp, likesCount, commentsCount, displayUrl, images, childPosts, videoUrl, videoDuration, dimensionsHeight, dimensionsWidth, locationName, locationId, coauthorProducers, taggedUsers, isCommentsDisabled, ownerUsername, ownerId, ownerFullName, inputUrl, scrapedAt. Missing scalars null and missing collections empty arrays.

# 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 = {
    "username": [
        "nasa"
    ],
    "resultsLimit": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("xmolodtsov/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 = {
    "username": ["nasa"],
    "resultsLimit": 10,
}

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

```

## MCP server setup

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