# Instagram Stories & Highlights Scraper (`khadinakbar/instagram-stories-highlights-scraper`) Actor

Scrape public Instagram story highlights and the live 24-hour story tray for one or more usernames. Returns one record per story item with original media URLs, timestamps, captions, music, mentions and links as structured JSON. No login required for highlights.

- **URL**: https://apify.com/khadinakbar/instagram-stories-highlights-scraper.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** Social media, Automation, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 story item saveds

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Instagram Stories & Highlights Scraper

Capture every story item from public Instagram highlight reels — plus the live 24-hour tray when it is reachable — as structured, exportable rows. Each row carries the original media URL, timestamp, caption, music, mentions, hashtags, and links for one story item. Built for social media managers, brand marketers, journalists, and AI agents that need permanent, analyzable copies of ephemeral story content.

### Best fit for this Actor

Choose this Actor when you have public usernames and need their archived story highlights as a clean dataset for content strategy, campaign archiving, or monitoring. It works as a focused standalone workflow: provide usernames, read the terminal outcome, then export the default dataset. For the permanent feed behind a story item, use the [Instagram Posts Scraper](https://apify.com/khadinakbar/instagram-posts-scraper) next; it returns the lasting feed rather than ephemeral story items.

### What data you receive

Each dataset row represents one story item captured from a highlight reel (`source: "highlight"`) or the live tray (`source: "story"`).

| Field                                                       | Meaning                                             |
| ----------------------------------------------------------- | --------------------------------------------------- |
| `id`, `position`                                            | Story item identity and order inside its reel       |
| `ownerUsername`, `ownerId`                                  | Public profile the story belongs to                 |
| `source`, `highlightId`, `highlightTitle`                   | Where the item came from and its parent reel        |
| `mediaType`, `mediaUrl`, `thumbnailUrl`, `width`, `height`  | Media kind and best available CDN renditions        |
| `takenAt`, `expiresAt`                                      | Publish time; expiry for ephemeral tray items       |
| `caption`, `musicTitle`, `musicArtist`                      | Text and music sticker metadata when present        |
| `mentions`, `hashtags`, `links`                             | Extracted tags, @-mentions, and sticker/caption URLs |
| `provider`, `scrapedAt`                                     | Capture route and freshness timestamp               |

Fields stay null when Instagram exposes no stable public value for that item. The actor records only what it observes.

### Input

Pass public usernames, profile URLs, or numeric user IDs. The actor deduplicates entries, strips `@` prefixes, and applies `maxResults` across the entire run.

```json
{
  "usernames": ["natgeo", "https://www.instagram.com/instagram/"],
  "includeStories": true,
  "includeHighlights": true,
  "expandHighlightItems": true,
  "maxHighlightsPerUser": 10,
  "maxResults": 200
}
```

`maxResults` is a strict 1–2000 cap on saved rows; `maxHighlightsPerUser` bounds provider cost per profile (1–25, default 10). An optional `sessionCookie` (treated as a secret) supplies your own logged-in `sessionid` to make live tray reads reliable; it is never required for highlights.

### Example output

```json
{
  "id": "3551234567890123456",
  "ownerUsername": "instagram",
  "ownerId": "25025320",
  "source": "highlight",
  "highlightId": "18142207969557132",
  "highlightTitle": "creatives",
  "mediaType": "video",
  "mediaUrl": "https://scontent-mia3-3.cdninstagram.com/v/t51...mp4",
  "thumbnailUrl": "https://scontent-mia3-3.cdninstagram.com/v/t51...jpg",
  "width": 1080,
  "height": 1920,
  "takenAt": "2026-01-16T17:17:56.000Z",
  "expiresAt": null,
  "caption": "New drop! #design",
  "musicTitle": "Golden Hour",
  "musicArtist": "JVKE",
  "mentions": ["natgeo"],
  "hashtags": ["design"],
  "links": ["https://example.com/go"],
  "position": 1,
  "provider": "scrapecreators",
  "scrapedAt": "2026-08-17T12:00:00.000Z"
}
```

### Pricing

Pay per event: **$0.0025 per validated story item** plus a **$0.0025 profile scan** and a **$0.00005 Actor start** event. Platform usage is additional because Pay per event + usage is enabled in the live Pricing tab. A story item is billed only after its complete validated row is saved, and a profile scan is billed only after the profile has been scanned successfully. The run status message shows the maximum event-charge estimate before any request fires.

### Reliability and sources

Highlight capture runs through managed public-data providers — ScrapeCreators primary, SociaVault fallback — using owner-managed API keys, with no Instagram login and no user cookies. Live 24-hour tray reads are attempted anonymously through residential proxy, with your optional session cookie improving reliability; when Instagram requires sign-in for the tray, the affected profile is noted in `RUN_SUMMARY` and you are never charged for that tray attempt.

If no route returns useful public data for any profile, the run ends as `UPSTREAM_FAILED` rather than reporting an empty success. Instagram changes response shapes frequently, so release evidence covers multi-profile highlight runs, sign-in-gated trays, invalid inputs, duplicate handling, and cost-cap behavior.

### Workflow story

A typical monitoring week: schedule a daily run with your 10 competitor usernames, `includeHighlights: true`, `expandHighlightItems: true`, and `maxResults: 500`. Deduplicate on `id` downstream, keep the newest `takenAt` items, and diff captions, link stickers, and music across days to see which story content a brand promotes and for how long. Tray captures, when available, add the ephemeral layer with `expiresAt`.

### Terminal outcomes

Every terminal path writes `OUTPUT` and `RUN_SUMMARY` in the default key-value store.

- `COMPLETE`: all accepted profiles scanned cleanly.
- `PARTIAL`: useful rows saved, with sign-in-gated trays, skipped inputs, or cap warnings.
- `VALID_EMPTY`: scanned profiles returned no highlight or tray items.
- `INVALID_INPUT`: no valid username, or an out-of-range cap was supplied.
- `UPSTREAM_FAILED`: no useful output because every route was unavailable for every profile.
- `CONFIG_ERROR`: deployment configuration prevented the advertised work.

The first four outcomes finish successfully; the last two signal that no advertised work was useful, so downstream automations can tell an outage from a quiet profile.

### API example

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client
  .actor("khadinakbar/instagram-stories-highlights-scraper")
  .call({
    usernames: ["natgeo", "instagram"],
    includeHighlights: true,
    expandHighlightItems: true,
    maxResults: 100,
  });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Use with an AI agent through Apify MCP

> Scan these public Instagram profiles and return every story highlight item with its media URL, timestamp, caption, music, mentions, hashtags, and links. Try the live 24-hour tray too, and report which profiles require sign-in rather than retrying them. Read the terminal outcome and the dataset before summarizing, cap the output at 100 items so the cost is clear, and summarize per profile how many highlight reels and items were found.

### Best results and data quality

- Start with `maxHighlightsPerUser: 10` and raise to 25 only for profiles with many reels; each expanded reel is a provider call.
- For pure archival of permanent story content, set `includeStories: false` to skip tray attempts entirely and keep runs fast.
- For live-tray monitoring, provide your own `sessionCookie`; anonymous tray reads are opportunistic by design.
- Deduplicate on `id` when re-scanning the same profiles; Instagram media IDs are stable.

### Builder's note

I built the highlight route first because it is the only story surface that stays analyzable after 24 hours. During the 2026-08 probe window, neither managed provider exposed a live-tray endpoint and anonymous tray requests required sign-in from every IP I tried, so this actor charges only for delivered items and honest scans rather than promising anonymous ephemeral access. The tray stays wired as an opportunistic route for residential proxies, and your own session cookie closes the gap when ephemeral capture is a hard requirement.

### Related actors

- Extend brand research after story items reveal a campaign with the [Instagram Posts Scraper](https://apify.com/khadinakbar/instagram-posts-scraper) for the permanent feed.
- Add reach context when story cross-posts appear as reels with the [Instagram Reels Scraper](https://apify.com/khadinakbar/instagram-reels-scraper).
- Enrich the owner behind the stories with the [Instagram Profile Scraper + Emails & Contacts](https://apify.com/khadinakbar/instagram-profile-scraper).
- Monitor engagement on cross-posted content with the [Instagram Likes Scraper](https://apify.com/khadinakbar/instagram-likes-scraper).
- Discover similar public profiles first with the [Instagram Keyword Search Scraper](https://apify.com/khadinakbar/instagram-keyword-search-scraper), then feed the winners into this actor.

### Responsible use

Use only publicly available story data in a manner consistent with Instagram's terms, privacy expectations, and applicable law. Use the actor for authorized research on public profiles rather than to access private accounts, close-friends content, or story viewer identities.

# Actor input Schema

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

Public Instagram usernames, profile URLs, or numeric user IDs to scan, for example 'instagram', 'https://www.instagram.com/natgeo/', or '25025320'. Entries are deduplicated and @ prefixes are stripped. NOT for private accounts, hashtags, post URLs, or story viewer lists.

## `includeStories` (type: `boolean`):

Attempt to capture the ephemeral 24-hour story tray anonymously. Instagram increasingly requires a login for this route, so tray capture is best-effort and never charged when blocked; provide sessionCookie to improve it. Defaults to true. NOT a guarantee that every tray is readable without login.

## `includeHighlights` (type: `boolean`):

List the permanent story highlight reels shown on each public profile and expand their items via managed data providers, with no login and no cookies. Defaults to true. NOT for private profiles or hidden story archives.

## `expandHighlightItems` (type: `boolean`):

Fetch the individual story items inside each highlight reel so every item becomes a record with its own media URL and timestamp. Defaults to true; when false, only one summary row per highlight album is saved. NOT related to downloading media files.

## `maxHighlightsPerUser` (type: `integer`):

Maximum number of highlight reels expanded per username in one run, for example 10. Accepts 1 to 25; the default is 10, which bounds provider cost while covering most public profiles. NOT a limit on items inside each highlight.

## `maxResults` (type: `integer`):

Maximum number of validated story or highlight item rows saved across the whole run, for example 200. Accepts 1 to 2000; the default is 200, and the actor stops and never charges for more rows than this cap. NOT a per-username limit.

## `sessionCookie` (type: `string`):

Optional 'sessionid' value from your own logged-in Instagram browser session to make live 24-hour story tray reads reliable. Leave empty for provider-backed highlights only; the cookie is treated as a secret and used only for your run. NOT the place for usernames, passwords, or API keys.

## Actor input object example

```json
{
  "usernames": [
    "natgeo",
    "https://www.instagram.com/instagram/"
  ],
  "includeStories": true,
  "includeHighlights": true,
  "expandHighlightItems": true,
  "maxHighlightsPerUser": 10,
  "maxResults": 200,
  "sessionCookie": "37148%3AAbCdEf..."
}
```

# Actor output Schema

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

Validated story and highlight item rows ordered per username.

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

Detailed outcome, counts, source routing, and billing telemetry.

## `output` (type: `string`):

Compact machine-readable terminal outcome.

# 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": [
        "instagram"
    ],
    "includeStories": true,
    "includeHighlights": true,
    "expandHighlightItems": true,
    "maxHighlightsPerUser": 10,
    "maxResults": 200
};

// Run the Actor and wait for it to finish
const run = await client.actor("khadinakbar/instagram-stories-highlights-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": ["instagram"],
    "includeStories": True,
    "includeHighlights": True,
    "expandHighlightItems": True,
    "maxHighlightsPerUser": 10,
    "maxResults": 200,
}

# Run the Actor and wait for it to finish
run = client.actor("khadinakbar/instagram-stories-highlights-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": [
    "instagram"
  ],
  "includeStories": true,
  "includeHighlights": true,
  "expandHighlightItems": true,
  "maxHighlightsPerUser": 10,
  "maxResults": 200
}' |
apify call khadinakbar/instagram-stories-highlights-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,khadinakbar/instagram-stories-highlights-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/5fAuhxk6yhonu1sVK/builds/mgb8yXLvdbw8neAMi/openapi.json
