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

Read public Instagram post, reel, TV, and legacy profile metadata. Returns available captions, author fields, structured metadata, and media URL references, or explicit access diagnostics when Instagram requires login. Media bytes are not downloaded.

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

## Pricing

from $2.99 / 1,000 posts

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

Read public Instagram post, reel, TV, and profile metadata from page HTML, Open Graph tags, embedded public JSON, JSON-LD, and the public oEmbed endpoint. Save captions or public descriptions, author fields, canonical URLs, media references and dimensions, available engagement counts, and profile links discovered from a username target. Media bytes are never downloaded.

### Get started

1. Open the [Actor Store page](https://apify.com/w3crawler/instagram-post-scraper) and select **Try for free** or open the **Input** tab.
2. Supply media URLs in `post_urls`, `postUrls`, or `startUrls`, and/or profile targets in `username` or `usernames`. At least one target is required.
3. Set `maxItems` and `maxPostsPerUsername` to bound the run. Keep both small for the first run.
4. Start the Actor, open the dataset, and export the records as JSON, CSV, or Excel. Open **Run summary** (`OUTPUT`) to check scheduled, discovered, and failure counts.

### Input

At least one target is required at runtime, although the schema marks every field optional. Unsupported field names and out-of-range values are rejected before requests start.

| Field | Type | Required? | Default | Meaning |
| --- | --- | --- | --- | --- |
| `post_urls` | string array | One of the target fields | Not supplied (prefill: one reel URL) | Public Instagram post, reel, TV, or profile URLs, up to 100 entries. Tracking parameters are removed and duplicates deduplicated. |
| `postUrls` | string array | One of the target fields | Not supplied | Compatibility alias for `post_urls`; both lists are combined. |
| `startUrls` | object array | One of the target fields | Not supplied | Compatibility request-list alias of `{ "url": "..." }` objects, combined with the other URL fields. |
| `username` | string | One of the target fields | Not supplied | One public username; a leading `@` is accepted. |
| `usernames` | string array | One of the target fields | Not supplied | Public usernames, combined with `username`. Each profile is read and bounded recent post discovery is attempted. |
| `maxPostsPerUsername` | integer | Optional | `3` | Maximum recent public post URLs discovered from each profile, 1–100, also bounded by the remaining `maxItems`. |
| `maxItems` | integer | Optional | `100` | Maximum unique requested and discovered targets processed, 1–100. |
| `requestTimeoutSecs` | integer | Optional | `20` | Per-request timeout for public pages and oEmbed, 5–60 seconds. |
| `maxRequestRetries` | integer | Optional | `2` | Additional attempts for transient HTTP failures, 0–3. |
| `requestDelayMs` | integer | Optional | `0` | Delay between target requests, 0–10,000 ms. |
| `proxyConfiguration` | object | Optional | `{"useApifyProxy":false}` | Optional Apify Proxy settings: `useApifyProxy`, `apifyProxyGroups`, and `apifyProxyCountry`. Direct access is the default. |

Example input using the prefill and defaults:

```json
{
  "post_urls": [
    "https://www.instagram.com/instagram/reel/Dc30nJeRKKz/"
  ],
  "maxPostsPerUsername": 3,
  "maxItems": 100,
  "requestTimeoutSecs": 20,
  "maxRequestRetries": 2,
  "requestDelayMs": 0,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

Add `username` or `usernames` to discover posts from profile pages. URL aliases are merged, normalized, and deduplicated before `maxItems` is applied.

### Output

The dataset contains one row per saved media or profile record. Optional values are omitted when Instagram does not expose them, and source failures produce log diagnostics instead of placeholder rows. Media and profile pages expose different field sets.

| Field | Type | Availability | Meaning |
| --- | --- | --- | --- |
| `url` | string | Always | Normalized target URL; added by the dataset sanitizer. |
| `searchUrl` | string | Always | Compatibility alias equal to `sourceUrl`. |
| `id` | string | Always | Stable deterministic identifier derived from the normalized target URL. |
| `recordType` | string enum | Always | `instagram-post` or `instagram-profile-metadata`. |
| `targetType` | string enum | Always | `media` or `profile`. |
| `targetUrl` | string | Always | Normalized requested or discovered target URL. |
| `postUrl` | string | For media targets | Post, reel, or TV URL. |
| `profileUrl` | string | For profile targets | Normalized profile URL. |
| `sourceUrl` | string | Always | Public Instagram page requested for extraction. |
| `discoveredFromProfile` | string | When discovered from a profile | Profile URL that exposed the post link. |
| `source` | string | Always | `instagram-public-page` or `instagram-public-page-and-oembed`. |
| `canonicalUrl` | string | Always | Canonical URL from Open Graph or oEmbed, with the target URL as fallback. |
| `pageTitle` | string | When published | Public HTML or Open Graph title. |
| `caption` | string | When published | Caption or public description. For many pages this includes Instagram's social-description prefix with a like/comment summary and date, not only the creator's caption. |
| `title` | string | When published | Public title or page title. |
| `author` | string | When published | Public author or creator name. |
| `authorUsername` | string | When published | Public author username. |
| `authorUrl` | string | When published | Public author profile URL. |
| `authorId` | string or number | When published | Public author identifier from oEmbed or embedded data. |
| `imageUrl` | string | When published | Primary public image URL. |
| `mediaUrl` | string | When published | Primary public video URL. |
| `mediaType` | string enum | When a recognizable media node is exposed | `image`, `video`, or `carousel`. Can be absent even when an image URL is present. |
| `width` | integer | When published | Media width in pixels. |
| `height` | integer | When published | Media height in pixels. |
| `duration` | string | When published | Source duration representation. |
| `durationSeconds` | number | When published | Normalized media duration in seconds. |
| `uploadDate` | string | When embedded data publishes it | Publication date/time. The like/comment prefix in `caption` is not parsed for a date. |
| `likeCount` | integer | When embedded data publishes a numeric count | Like count. Counts appearing only in the caption prefix are not parsed into this field. |
| `commentCount` | integer | When embedded data publishes a numeric count | Comment count. Counts appearing only in the caption prefix are not parsed. |
| `videoViewCount` | integer | When published | Video view or play count. |
| `carouselItemCount` | integer | When published | Number of carousel children. |
| `embedHtml` | string | When published | Public oEmbed HTML snippet. |
| `oembedProvider` | string | When published | oEmbed provider name. |
| `structuredData` | object array | When published | Up to 10 public JSON-LD objects from the page. |
| `mediaReferences` | object array | When published | Deduplicated media references with `url`, `kind`, `width`, `height`, `durationSeconds`, and `source`, capped at 30. |
| `downloadAvailable` | boolean | Always | Whether a public media URL was observed. Nothing is downloaded or stored. |
| `transcriptAvailable` | boolean | Always | Whether a public transcript was observed. Current extraction reports `false`. |
| `metadata` | object | When published | Small page subset: `openGraphType` and `contentLanguage`. |
| `scrapedAt` | string | Always | Time the row was emitted, in ISO UTC. |

Example of a real saved row from the 2026-10-25 run. It contains the full saved image URL and its single media reference; no values are invented.

```json
{
  "id": "instagram:df697121c65cd31bbffda568",
  "recordType": "instagram-post",
  "targetType": "media",
  "targetUrl": "https://www.instagram.com/instagram/reel/Dc30nJeRKKz/",
  "postUrl": "https://www.instagram.com/instagram/reel/Dc30nJeRKKz/",
  "sourceUrl": "https://www.instagram.com/instagram/reel/Dc30nJeRKKz/",
  "source": "instagram-public-page",
  "canonicalUrl": "https://www.instagram.com/instagram/reel/Dc30nJeRKKz/",
  "pageTitle": "Instagram on Instagram: \"that’s his spa now 🚰 #InTheMoment Video by @misterbeanito\"",
  "caption": "966K likes, 22K comments - instagram on September 4, 2026: \"that’s his spa now 🚰 #InTheMoment Video by @misterbeanito\".",
  "title": "Instagram on Instagram: \"that’s his spa now 🚰 #InTheMoment Video by @misterbeanito\"",
  "author": "Instagram",
  "authorUsername": "instagram",
  "authorUrl": "https://www.instagram.com/instagram/",
  "imageUrl": "https://scontent-iad3-1.cdninstagram.com/v/t51.71878-15/795341832_1575427477361093_319242826385620795_n.jpg?stp=cmp1_dst-jpg_e35_s640x640_tt6&_nc_cat=108&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=GwEZWrttYssQ7kNvwHrf9BE&_nc_oc=AdqDKyv5H6uTBfcn1rLKf4rBUqIEGmVbhd_uPVHbJBcsX8aJ1a5IpqpoYiDmYxbJC9M&_nc_zt=23&_nc_ht=scontent-iad3-1.cdninstagram.com&_nc_gid=a-xlcFcF_nQnpXEg9f0vXg&_nc_ss=70689&oh=00_AQPKLJJPXNqquQ_XpwYdivvQiAO9u7Ckb8LwMAbAGHIO7Q&oe=6AE4502C",
  "mediaReferences": [
    {
      "url": "https://scontent-iad3-1.cdninstagram.com/v/t51.71878-15/795341832_1575427477361093_319242826385620795_n.jpg?stp=cmp1_dst-jpg_e35_s640x640_tt6&_nc_cat=108&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=GwEZWrttYssQ7kNvwHrf9BE&_nc_oc=AdqDKyv5H6uTBfcn1rLKf4rBUqIEGmVbhd_uPVHbJBcsX8aJ1a5IpqpoYiDmYxbJC9M&_nc_zt=23&_nc_ht=scontent-iad3-1.cdninstagram.com&_nc_gid=a-xlcFcF_nQnpXEg9f0vXg&_nc_ss=70689&oh=00_AQPKLJJPXNqquQ_XpwYdivvQiAO9u7Ckb8LwMAbAGHIO7Q&oe=6AE4502C",
      "kind": "image",
      "source": "open_graph"
    }
  ],
  "downloadAvailable": true,
  "transcriptAvailable": false,
  "metadata": {
    "openGraphType": "article"
  },
  "scrapedAt": "2026-10-25T20:47:50.405Z",
  "url": "https://www.instagram.com/instagram/reel/Dc30nJeRKKz/",
  "searchUrl": "https://www.instagram.com/instagram/reel/Dc30nJeRKKz/"
}
```

### Run summary

**Run summary** is stored separately from the dataset in the run's key-value store under `OUTPUT`.

| Field | Meaning |
| --- | --- |
| `status` | Actor process outcome: `SUCCEEDED` or `FAILED`. |
| `runStatus` | Canonical run status; matches `status`. |
| `dataStatus` | Completeness of saved rows: `COMPLETE`, `PARTIAL`, `NO_RESULTS`, or `FAILED`. |
| `requestedTargetCount` | Unique normalized targets supplied, before the `maxItems` cap. |
| `scheduledTargetCount` | Targets queued after applying `maxItems`. |
| `emittedCount` | Normal records written to the dataset. |
| `normalCount` | Normal records written; matches `emittedCount`. |
| `diagnosticCount` | Source diagnostics logged; diagnostics are not dataset rows. |
| `datasetWriteFailureCount` | Records that could not be written to the dataset. |
| `failureCount` | Diagnostics other than `NO_PUBLIC_METADATA`, plus dataset write failures. |
| `uniqueTargetCount` | Distinct target URLs seen in results, including failed targets. |
| `discoveredPostCount` | Saved records that were discovered from a profile page. |
| `oembedRequests` | oEmbed endpoint attempts. A media target can try up to two endpoints. |
| `blockedCount` | Pages treated as blocked or challenge responses. |
| `maxItems` | Target cap used for the run. |
| `optionalFailureCount` | Optional summary-write failures. |
| `completedAt` | Time the summary was written, in ISO UTC. |

| Status | Data status | Meaning |
| --- | --- | --- |
| `SUCCEEDED` | `COMPLETE` | Records were saved without diagnostics. |
| `SUCCEEDED` | `PARTIAL` | Records were saved, but at least one diagnostic or dataset write failure occurred. |
| `SUCCEEDED` | `NO_RESULTS` | The run completed cleanly with no usable public metadata and no counted failures. |
| `FAILED` | `FAILED` | No record was saved and at least one counted failure occurred. |

Example `OUTPUT` from the 2026-10-25 run:

```json
{
  "status": "SUCCEEDED",
  "runStatus": "SUCCEEDED",
  "dataStatus": "COMPLETE",
  "requestedTargetCount": 1,
  "scheduledTargetCount": 1,
  "emittedCount": 1,
  "normalCount": 1,
  "diagnosticCount": 0,
  "datasetWriteFailureCount": 0,
  "failureCount": 0,
  "uniqueTargetCount": 1,
  "discoveredPostCount": 0,
  "oembedRequests": 2,
  "blockedCount": 0,
  "maxItems": 1,
  "optionalFailureCount": 0,
  "completedAt": "2026-10-25T20:47:50.487Z"
}
```

### Coverage and limitations

The Actor reads only public page HTML, embedded public JSON, Open Graph metadata, JSON-LD, and Instagram's public oEmbed endpoints. It does not log in, use cookies or private APIs, solve challenges, bypass rate limits, download media bytes, fetch transcripts, or collect comments. `transcriptAvailable` currently reports `false`, and `downloadAvailable` only means a public media URL was observed; it does not grant reuse rights. Media and CDN URLs are time-limited.

Username targets read one public profile page and discover the recent post shortcodes that page exposes. `maxPostsPerUsername` caps discovery per profile, and the remaining `maxItems` budget caps the shared queue. This is not a complete profile catalog. The profile record contains the fields available for that page; it does not include follower, following, bio, or verified fields in this dataset.

`caption` may be Instagram's public social description, including a like/comment prefix and date; the Actor does not parse that prefix into `likeCount`, `commentCount`, or `uploadDate`. Those fields appear only when embedded data exposes numeric values. `mediaType`, dimensions, and duration can be absent when the page exposes only a still image, even for a reel URL. A missing field means the public response did not expose it.

`maxItems` limits queued targets and saved rows; log diagnostics do not create rows. `NO_PUBLIC_METADATA`, HTTP errors, blocked/challenge responses, and request failures are reported through logs and `OUTPUT`, which can leave the run `PARTIAL` or `FAILED`. Apify Proxy is optional; direct requests are the default.

### Usage and support

Cost depends on the number of targets, profile discovery, oEmbed attempts, page size, retries, and proxy use. Start with a single URL or profile and a low `maxItems`, inspect the dataset and `OUTPUT`, then scale. See the Actor's Pricing tab for current account rates.

Use the [Actor Issues page](https://apify.com/w3crawler/instagram-post-scraper/issues) to report a problem. Include the run ID, the input used, and the run summary; do not include tokens, cookies, or private data. This Actor is not affiliated with Instagram or Meta. Use it only for public data and in accordance with Instagram's terms, robots guidance, and applicable law. Public pages can contain personal information; use the output only for lawful purposes.

# Actor input Schema

## `post_urls` (type: `array`):

Public Instagram post, reel, TV, or profile URLs. Tracking parameters are removed and duplicates are deduplicated.

## `postUrls` (type: `array`):

Compatibility alias for post_urls.

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

Compatibility request-list alias for public Instagram post or profile URLs.

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

Public Instagram username; an optional leading @ is accepted.

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

Public Instagram usernames to resolve to profile pages and bounded recent post discovery.

## `maxPostsPerUsername` (type: `integer`):

Maximum recent public post URLs discovered from each requested profile.

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

Maximum number of requested and discovered targets processed in one run.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout for public page and oEmbed calls.

## `maxRequestRetries` (type: `integer`):

Additional attempts for transient HTTP failures.

## `requestDelayMs` (type: `integer`):

Optional delay between target requests.

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

Optional Apify Proxy configuration. Direct access is the default.

## Actor input object example

```json
{
  "post_urls": [
    "https://www.instagram.com/instagram/reel/Dc30nJeRKKz/"
  ],
  "maxPostsPerUsername": 3,
  "maxItems": 100,
  "requestTimeoutSecs": 20,
  "maxRequestRetries": 2,
  "requestDelayMs": 0,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

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

Run status and counters stored by the Actor.

# 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 = {
    "post_urls": [
        "https://www.instagram.com/instagram/reel/Dc30nJeRKKz/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("w3crawler/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 = { "post_urls": ["https://www.instagram.com/instagram/reel/Dc30nJeRKKz/"] }

# Run the Actor and wait for it to finish
run = client.actor("w3crawler/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 '{
  "post_urls": [
    "https://www.instagram.com/instagram/reel/Dc30nJeRKKz/"
  ]
}' |
apify call w3crawler/instagram-post-scraper --silent --output-dataset

```

## MCP server setup

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