# Instagram Story Scraper (`codenest/instagram-story-scraper`) Actor

Download Instagram Stories instantly with our scraper! Extract high-quality images/videos with full metadata. Get secure, downloadable URLs with automatic clean up. 📊 Perfect for marketers, researchers, and developers needing reliable story data. 👌Instagram Story Scraper.

- **URL**: https://apify.com/codenest/instagram-story-scraper.md
- **Developed by:** [CodeNest](https://apify.com/codenest) (community)
- **Categories:** Social media, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 65 total users, 6 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 scraped instagram stories

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 Stories Scraper & Downloader - Anonymous Story Viewer & Media Extractor

**Effortlessly view, scrape, and download public Instagram Stories and Highlights without login! This enterprise-grade Apify Actor downloads high-resolution media (MP4 videos & JPG images) directly to the Apify Key-Value Store, while extracting comprehensive technical audio/video metadata via `ffprobe`.**

***

### ⚡ Highlights & Why Choose This Scraper

- 🔓 **100% Anonymous & No Login Required**: Scrape public stories completely anonymously without needing your own Instagram account or session cookies—zero risk of account bans!
- ⚡ **Dual Engine Redundancy (API A + API B)**: Features a high-speed primary scraper (InDown) paired with an RSA-signed fallback engine (SSSGram API) for unmatched 99.9% uptime and reliability.
- 🎯 **Flexible Input Formats**: Accepts Story URLs, Direct Story Links, Highlights, Profile URLs, or simple handles (e.g., `@nasa` or `nasa`).
- 📥 **Direct Apify Storage Links**: Download original MP4 videos and high-res JPG photos straight from secure Apify Key-Value Store links.
- 🎥 **Technical Media Metadata**: Detailed codec, bitrate, resolution, duration, FPS, sample rates, and color profiles via `ffprobe`.
- 💰 **Ultra-Cost Efficient (512 MB RAM)**: Powered by lightweight TLS-impersonated HTTP requests—no bulky headless Chromium browser required, saving you up to 87.5% on Apify compute units (CU)!
- 🛡️ **Pay-per-Event (PPE) Compliant**: You are only charged for stories that are successfully extracted. If an account has no active stories or is private, you are not charged!

***

### 🚀 Core Features & Capabilities

#### 🎭 Media Extraction & Conversion

- **Dual Format Support**: Automatically detects and extracts JPG images and MP4 videos.
- **High-Quality Preservation**: Preserves original resolution and audio fidelity.
- **Bulk Processing**: Batch process dozens of handles or story URLs in a single run.
- **Highlight Support**: Scrapes Instagram Story Highlights seamlessly.

#### 📊 Deep Technical Metadata

- **Video Specs**: Codec (`h264`, `hevc`), resolution (e.g., `720x1280`), duration, bitrate, frame rate (`fps`), aspect ratio (`9:16`).
- **Audio Specs**: Audio codec (`aac`), sample rate (`44100 Hz`), audio channels (`stereo`), audio bitrate.
- **Image Specs**: Image codec (`mjpeg`), resolution (`width`, `height`), color space (`bt709`, `bt470bg`), and size in bytes.

#### 🛡️ Enterprise Stability & Anti-Bot Protection

- **Residential Proxy Rotation**: Built-in US Residential proxy rotation to prevent rate-limits and IP throttling.
- **Smart CDN Recovery**: Automatically falls back to direct high-speed CDN streaming if proxy connections drop.
- **Instant Status Detection**: Immediately identifies expired stories or private profiles, preventing useless retry delays.

***

### ⚙️ Input Configuration

You can provide full Instagram Story URLs, Profile URLs, Highlights URLs, or simply raw usernames (`@handle` or `handle`).

#### Example Input:

```json
{
  "story_urls": [
    { "url": "https://www.instagram.com/stories/nasa/" },
    { "url": "https://www.instagram.com/stories/siliconvalleygirl/3992278658725746406/?hl=en" },
    { "url": "https://www.instagram.com/stories/highlights/18125485942683117/" },
    { "url": "https://www.instagram.com/natgeo/" },
    { "url": "@kingjames" }
  ],
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"],
    "apifyProxyCountry": "US"
  }
}
```

#### 📋 Input Parameters

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `story_urls` | Array | **Yes** | `[{"url": "https://www.instagram.com/stories/kingjames/"}]` | List of story URLs, highlights, profile URLs, or usernames (`@handle`). |
| `proxy` | Object | No | US Residential Proxy | Apify proxy configuration to bypass geographic restrictions and IP limits. |

***

### 📤 Output Structure

The scraper outputs rich structured JSON records to the default dataset and a consolidated list to the Key-Value Store (`OUTPUT`).

#### Successful Story Extraction Example:

```json
[
  {
    "url": "https://www.instagram.com/stories/nasa/",
    "username": "nasa",
    "success": true,
    "error": null,
    "media_items": [
      {
        "Story No": 1,
        "type": "video",
        "Media URL": "https://api.apify.com/v2/key-value-stores/8yGCeB5ezYkhv94Pk/records/nasa_story_1.mp4?token=apify_actor_run_api_rVgIfHPD2vCrvGHXQwtDOIF0V1JHd94azxGm"
      },
      {
        "Story No": 2,
        "type": "video",
        "Media URL": "https://api.apify.com/v2/key-value-stores/8yGCeB5ezYkhv94Pk/records/nasa_story_2.mp4?token=apify_actor_run_api_rVgIfHPD2vCrvGHXQwtDOIF0V1JHd94azxGm"
      }
    ],
    "total_count": 2,
    "video_count": 2,
    "image_count": 0,
    "image_story_metadata": [],
    "video_story_metadata": [
      {
        "Story No": 1,
        "Media URL": "https://api.apify.com/v2/key-value-stores/8yGCeB5ezYkhv94Pk/records/nasa_story_1.mp4?token=apify_actor_run_api_rVgIfHPD2vCrvGHXQwtDOIF0V1JHd94azxGm",
        "metadata": {
          "filename": "nasa_story_1.mp4",
          "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
          "format_long_name": "QuickTime / MOV",
          "duration": "20.500363",
          "size": "1089719",
          "bit_rate": "353624",
          "video_codec": "h264",
          "width": 720,
          "height": 1280,
          "aspect_ratio": "9:16",
          "fps": "30/1",
          "audio_codec": "aac",
          "audio_sample_rate": "44100",
          "audio_channels": 2
        }
      }
    ]
  }
]
```

#### Expired / Private Story Output Example (Non-Charged):

```json
{
  "url": "https://www.instagram.com/stories/zuck/3992898160762516040/?hl=en",
  "username": "zuck",
  "success": false,
  "error": "Story not found: Account may be private, stories expired (>24h limit), or username does not exist.",
  "media_items": [],
  "total_count": 0,
  "video_count": 0,
  "image_count": 0,
  "image_story_metadata": [],
  "video_story_metadata": []
}
```

***

### 📊 Output Field Reference

| Field | Type | Description |
|---|---|---|
| `url` | String | Target Instagram Story or profile URL processed. |
| `username` | String | Extracted Instagram username / handle. |
| `success` | Boolean | `true` if stories were extracted, `false` if expired, private, or not found. |
| `error` | String / Null | Clear diagnostic message if extraction was unsuccessful. |
| `media_items` | Array | List of extracted media with sequential index, type (`image`/`video`), and download link. |
| `total_count` | Number | Total number of active stories retrieved. |
| `video_count` | Number | Total number of video stories. |
| `image_count` | Number | Total number of image stories. |
| `image_story_metadata` | Array | Technical metadata for images (width, height, format, codec). |
| `video_story_metadata` | Array | Technical metadata for videos (duration, fps, bitrate, codecs, resolution). |

***

### 💡 Frequently Asked Questions (FAQ)

##### Q: Do I need to log in or provide Instagram cookies?

**A:** No! This actor runs 100% anonymously. You do not need to connect your Instagram account or provide session cookies.

##### Q: Can this scraper download stories from private accounts?

**A:** No. Instagram restricts private account stories to approved followers only. This scraper works exclusively on public profiles and public highlights.

##### Q: How long do Instagram Stories stay available?

**A:** Regular Instagram stories expire 24 hours after they are posted. If a story has expired, the scraper will report `success: false` with a clear explanation, and you will not be charged. Highlights remain accessible indefinitely.

##### Q: Can I input usernames like `@nasa` directly?

**A:** Yes! The actor automatically detects and normalizes raw handles (`@nasa` or `nasa`), profile links (`https://www.instagram.com/nasa/`), and full story links.

##### Q: What if a story download fails due to a network glitch?

**A:** The actor features dual-engine redundancy. If API A encounters an issue, it seamlessly hands over to API B. Furthermore, media downloads include intelligent automatic retries and direct CDN fallbacks.

***

### 💼 Business Use Cases

- 📈 **Competitor Intelligence**: Monitor competitor campaigns, product launches, and seasonal promos before they disappear.
- 🎯 **Influencer Marketing**: Archive sponsored stories, verify proof-of-work, and inspect video resolution and duration.
- 🏛️ **Digital Archiving**: Automatically archive brand or client ephemeral content to cloud storage.
- 🤖 **AI & ML Datasets**: Collect vertical mobile video (9:16) and social imagery for model training.

***

### 🔗🛠 Related Actors (Full Content Scraping Suite)

Explore our full scraping suite for social media data extraction:

#### 📸 Instagram Scrapers:

- [Instagram Reels Downloader](https://apify.com/codenest/instagram-reels-downloader)
- [Instagram Reels Thumbnail Downloader](https://apify.com/codenest/instagram-reels-thumbnail-downloader)
- [Instagram Video Downloader](https://apify.com/codenest/instagram-video-downloader)
- [Instagram Reels Scraper & Downloader](https://apify.com/codenest/instagram-reels-downloader-scraper)
- [Instagram Reels Audio Downloader](https://apify.com/codenest/instagram-reels-audio-downloader)
- [Instagram Post Downloader (Image & Video)](https://apify.com/codenest/instagram-post-downloader-image-video)
- [Instagram Reels Thumbnail Scraper & Downloader](https://apify.com/codenest/instagram-reels-thumbnail-scraper-downloader)
- [Instagram Reels Audio Scraper & Downloader](https://apify.com/codenest/instagram-reels-audio-scraper-downloader)
- [Instagram Story Downloader](https://apify.com/codenest/instagram-story-downloader)
- [Instagram Post Scraper](https://apify.com/codenest/instagram-post-scraper)
- [Instagram Reels Scraper Pro](https://apify.com/codenest/instagram-reels-scraper-pro)

#### 🎥 YouTube Scrapers:

- [YouTube Mp3/Audio Downloader](https://apify.com/codenest/youtube-mp3-audio-downloader)
- [YouTube Video Transcript Scraper](https://apify.com/codenest/youtube-video-transcript-scraper)
- [YouTube Shorts Downloader](https://apify.com/codenest/youtube-shorts-downloader)
- [YouTube Shorts Scraper & Downloader](https://apify.com/codenest/youtube-shorts-scraper-downloader)
- [YouTube Video Downloader](https://apify.com/codenest/youtube-video-downloader)
- [YouTube Video, Shorts & MP3/Audio Downloader](https://apify.com/codenest/youtube-video-shorts-mp3-audio-downloader)

#### 📱 Facebook Scrapers:

- [Facebook Video Transcript Scraper](https://apify.com/codenest/facebook-video-transcript-scraper)
- [Facebook Video Downloader Pro](https://apify.com/codenest/facebook-video-downloader-pro)
- [Facebook Reels Audio Downloader](https://apify.com/codenest/facebook-reels-audio-downloader)
- [Facebook Thumbnail Downloader(Reels & Video)](https://apify.com/codenest/facebook-thumbnail-downloader-reels-video)
- [Facebook Reels & Video Downloader](https://apify.com/codenest/facebook-reels-video-downloader)
- [Facebook Reels Scraper & Reels Downloader](https://apify.com/codenest/facebook-reels-scraper-reels-downloader)
- [Facebook Reels Downloader Pro](https://apify.com/codenest/facebook-reels-downloader-pro)
- [Facebook Audio/Mp3 Downloader (Reels & Video)](https://apify.com/codenest/facebook-audio-mp3-downloader-reels-video)
- [Facebook Reels Scraper](https://apify.com/codenest/facebook-reels-scraper)

#### 🐦 Twitter/X.com Specialized Actors:

- [Twitter (X.com) Video Post Scraper](https://apify.com/codenest/twitter-x-com-video-post-scraper)
- [Twitter (X.com) Image Downloader](https://apify.com/codenest/twitter-x-com-image-downloader)
- [Twitter(X.com) Tweets Scraper](https://apify.com/codenest/twitter-x-com-tweets-scraper)
- [Twitter (X.com) mp3/Audio Downloader](https://apify.com/codenest/twitter-x-com-mp3-audio-downloader)

***

### 📧 Need Customization or Support?

Want higher scraping volume, dedicated proxy pools, custom webhooks, or enterprise SLAs?

✉️ Email: <codenest2.0@gmail.com>

# Actor input Schema

## `story_urls` (type: `array`):

A list of public Instagram Stories URLs, Profile URLs, Highlights, or Usernames (e.g., @kingjames, kingjames, https://www.instagram.com/kingjames/, or https://www.instagram.com/stories/kingjames/).

## `proxy` (type: `object`):

Proxy settings for the actor. Default uses US Residential proxies.

## Actor input object example

```json
{
  "story_urls": [
    {
      "url": "https://www.instagram.com/stories/kingjames/"
    }
  ],
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

Tabular overview of scraped Instagram stories with media links, status, and item counts.

## `imageMetadata` (type: `string`):

Detailed view of extracted technical metadata (codecs, bitrates, dimensions) for images and videos.

## `allResults` (type: `string`):

Complete dataset containing full extracted story records and media items.

## `outputRecord` (type: `string`):

Consolidated JSON array of all scraped story results stored in the default Key-Value Store.

# 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 = {
    "story_urls": [
        {
            "url": "https://www.instagram.com/stories/kingjames/"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("codenest/instagram-story-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 = { "story_urls": [{ "url": "https://www.instagram.com/stories/kingjames/" }] }

# Run the Actor and wait for it to finish
run = client.actor("codenest/instagram-story-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 '{
  "story_urls": [
    {
      "url": "https://www.instagram.com/stories/kingjames/"
    }
  ]
}' |
apify call codenest/instagram-story-scraper --silent --output-dataset

```

## MCP server setup

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