# ✅ Instagram User Stories Scraper (`datamagnet/instagram-user-stories-scraper`) Actor

Get the latest Instagram stories from one or more accounts in a simple, ready-to-use format. Enter a username, user ID, or profile URL to extract story media and related details exactly as delivered by the source, with embed-safe links available when enabled.

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

## Pricing

from $3.00 / 1,000 results

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/platform/actors/running/actors-in-store#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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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 Scraper

Instagram Stories Scraper helps you quickly collect the latest Instagram stories from one or more accounts in a simple, ready-to-use format. It is ideal for marketers, social media managers, researchers, agencies, and creators who need fresh Instagram story data without manual checking. Use it to extract Instagram story media, review story details, and capture content exactly as it appears from the source. When enabled, it can also prepare story links that are better suited for embedding on websites and dashboards.

### Key Features
- Extract the latest Instagram stories from a username, numeric user ID, or profile URL.
- Collect story media and related story details exactly as delivered by the source.
- Limit results per account so you only receive the amount of data you need.
- Prepare media links that are easier to embed on websites when safe embed mode is turned on.
- Capture rich story metadata such as timestamps, owner details, media type, and story stickers.
- Support both image and video stories, including thumbnails and playback links where available.
- Deliver results in a clean format that is easy to review, export, and reuse in business workflows.

### Use Cases

#### Social Media Monitoring
Brands and agencies use this actor to keep an eye on the latest Instagram stories from competitors, influencers, or partner accounts. The returned fields such as `taken_at_date`, `media_type`, `caption`, `owner.username`, and `video_url` help teams understand what was posted, when it was posted, and whether it was an image or video.

#### Influencer Campaign Tracking
Influencer managers and brand teams can review story content shared by creators during a campaign. Fields like `tagged_users`, `reel_mentions`, `story_music_stickers`, `story_feed_media`, and `has_audio` make it easier to verify brand mentions, music usage, and whether campaign assets were included in the story.

#### Content Archiving
Media teams and researchers often need a reliable way to save story content for later review. This actor returns the story media and related fields exactly as provided, including `image_versions`, `video_versions`, `thumbnail_url`, `expiring_at`, and `taken_at_ts`, which are useful for organizing and preserving story records.

#### Website and Dashboard Embeds
Publishers and internal teams can use the output to display story media in reports, content hubs, or internal dashboards. When safe embed mode is enabled, the media links are better suited for embedding, while fields like `media_format`, `video_duration`, and `original_width` help teams choose the right presentation format.

#### Audience and Creator Research
Analysts studying creator behavior can compare story patterns across accounts. Data such as `is_verified`, `is_private`, `full_name`, `username`, `supports_reel_reactions`, and `can_reply` helps identify account type, engagement options, and how creators present themselves in stories.

#### Editorial and Trend Review
Editors and trend watchers can scan story content to spot recurring themes, collaborations, and media styles. Fields like `sponsor_tags`, `location`, `music_metadata`, `story_highlight_reshare_stickers`, and `creative_config` provide useful context for understanding how stories are produced and shared.

### Input

| Field | Type | Required | Description | Example |
|---|---|---:|---|---|
| `max_results` | integer | No | Limits how many story items are returned for each account. | `100` |
| `url_embed_safe` | boolean | No | Turn this on if you want story image or video links that are better suited for embedding on websites. | `false` |
| `username_or_id_or_url` | string | Yes | Enter the Instagram account as a username, numeric user ID, or profile URL to get the latest stories. | `mrbeast` |

### Output

| Field | Type | Description |
|---|---|---|
| `archive_story_deletion_ts` | integer | When the story is scheduled to be removed from the archive, if available. |
| `boost_unavailable_identifier` | string or null | A label explaining why boosting is unavailable, if provided. |
| `boost_unavailable_reason` | string or null | A short reason why boosting cannot be used. |
| `boost_unavailable_reason_v2` | string or null | A newer version of the boost-unavailable explanation, if available. |
| `can_extend_expiration` | boolean or null | Whether the story’s viewing time can be extended. |
| `can_hype` | boolean | Whether the story can be promoted with hype-style features. |
| `can_mention_back` | boolean | Whether the viewer can mention the creator back. |
| `can_mention_share` | boolean | Whether the story can be shared with mentions. |
| `can_play_spotify_audio` | boolean | Whether Spotify audio can be played from the story. |
| `can_reply` | boolean | Whether replies are allowed on the story. |
| `can_reshare` | boolean | Whether the story can be reshared. |
| `can_reshare_to_story` | boolean | Whether the story can be reshared into another story. |
| `can_save` | boolean | Whether the story can be saved. |
| `can_send_prompt` | boolean | Whether prompts can be sent from the story. |
| `caption` | string or null | Any text caption attached to the story. |
| `caption_is_edited` | boolean | Whether the caption was edited after posting. |
| `coauthor_producers` | array | A list of coauthors or producers connected to the story. |
| `code` | string | A short story code used to identify the item. |
| `creative_config` | string or null | Creative settings or configuration details, if available. |
| `crosspost_metadata` | object | Information about cross-posting and downstream sharing rules. |
| `cutout_sticker_info` | array | Details about cutout stickers used in the story. |
| `deleted_reason` | integer | A code showing why the story was deleted, if applicable. |
| `device_timestamp` | integer | The original device timestamp for the story item. |
| `expiring_at` | integer | The time when the story expires. |
| `fbid` | string | A related platform identifier for the story. |
| `filter_type` | integer | The filter type applied to the story, if any. |
| `fundraiser_tag` | object | Fundraiser-related information attached to the story. |
| `gen_ai_detection_method` | object | Information about how AI-related content detection was handled. |
| `has_audio` | boolean | Whether the story contains audio. |
| `has_high_risk_gen_ai_inform_treatment` | boolean | Whether the story has a high-risk AI-related treatment flag. |
| `has_liked` | boolean | Whether the viewer has liked the story. |
| `has_privately_liked` | boolean | Whether the story has been privately liked. |
| `has_translation` | boolean | Whether a translation is available. |
| `id` | string | The unique story item ID. |
| `ig_media_sharing_disabled` | boolean | Whether sharing this media is disabled. |
| `image_versions` | object | Available image sizes and links for the story media. |
| `integrity_review_decision` | string | The current integrity review status, if provided. |
| `is_arirang_prize` | boolean | Whether the story is marked as an Arirang prize item. |
| `is_dash_eligible` | integer | Whether the media is eligible for DASH playback. |
| `is_first_take` | boolean | Whether this is marked as a first take. |
| `is_from_ayt_clips_inspiration` | boolean | Whether the story came from a clips inspiration source. |
| `is_from_discovery_surface` | boolean | Whether the story came from a discovery surface. |
| `is_open_to_public_submission` | boolean | Whether public submission is allowed. |
| `is_organic_product_tagging_eligible` | boolean | Whether product tagging is allowed organically. |
| `is_paid_partnership` | boolean | Whether the story is part of a paid partnership. |
| `is_photo_mash_story` | boolean | Whether the story is a photo mash. |
| `is_pinned` | boolean | Whether the story is pinned. |
| `is_quicksnap_recap` | boolean | Whether the story is a quicksnap recap. |
| `is_reel_media` | boolean | Whether the story uses reel-style media. |
| `is_reshare_of_text_post_app_media_in_ig` | boolean | Whether the story is a reshared text-post app media item. |
| `is_story_image_with_music` | boolean | Whether the story is an image with music. |
| `is_tagged_media_shared_to_viewer_profile_grid` | boolean | Whether tagged media was shared to the viewer’s profile grid. |
| `is_terminal_video_segment` | boolean | Whether this is the final segment of a video story. |
| `is_video` | boolean | Whether the story is a video. |
| `is_viewer_mentioned` | boolean | Whether the viewer is mentioned in the story. |
| `location` | object or null | Location information attached to the story, if available. |
| `media_attributions_data` | array | Attribution details for media used in the story. |
| `media_format` | string | The media format, such as image or video. |
| `media_name` | string | The media name, usually indicating the story type. |
| `media_overlay_info` | object or null | Overlay details for stickers or layered media. |
| `media_type` | integer | A numeric media type code. |
| `music_metadata` | object or null | Music details attached to the story, if available. |
| `number_of_qualities` | integer | How many quality versions are available for the media. |
| `original_height` | integer | The original height of the media in pixels. |
| `original_media_type` | integer | The original media type code. |
| `original_width` | integer | The original width of the media in pixels. |
| `owner` | object | Details about the account that posted the story. |
| `product_type` | string | The product type for the item, such as story. |
| `query_cache_test_11` | string | Internal source label returned with the item. |
| `reel_mentions` | array | Accounts mentioned in the story. |
| `sharing_friction_info` | object | Information about sharing restrictions. |
| `shop_routing_user_id` | string or null | A shopping-related user ID, if available. |
| `should_show_author_pog_for_tagged_media_shared_to_profile_grid` | boolean | Whether the author badge should be shown for tagged media. |
| `sponsor_tags` | array | Sponsor tags attached to the story. |
| `story_feed_media` | array | Media items attached inside the story, such as clips or stickers. |
| `story_highlight_reshare_stickers` | array | Stickers used when resharing highlights. |
| `story_music_stickers` | array | Music sticker details attached to the story. |
| `supports_reel_reactions` | boolean | Whether reel-style reactions are supported. |
| `tagged_users` | array | Users tagged in the story. |
| `taken_at` | integer | The time the story was posted, in seconds. |
| `taken_at_date` | string | A readable date and time for when the story was posted. |
| `taken_at_ts` | integer | Another timestamp for when the story was posted. |
| `thumbnail_url` | string | A preview image for the story media. |
| `trending_content_info` | array | Information about trending content, if available. |
| `user` | object | Basic details about the posting account. |
| `video_codec` | string | The video codec used for the story. |
| `video_duration` | number | The length of the video in seconds. |
| `video_url` | string | A direct link to the video file, when available. |
| `video_versions` | array | Available video versions with different quality options. |
| `wearable_shared_media_resolutions` | array | Resolution details for wearable-shared media, if available. |
| `wearables_creator_tools_info` | array | Creator tool details for wearable-shared media, if available. |

### Sample Output
```json
{
  "archive_story_deletion_ts": 0,
  "boost_unavailable_identifier": null,
  "boost_unavailable_reason": null,
  "boost_unavailable_reason_v2": null,
  "can_extend_expiration": null,
  "can_hype": false,
  "can_mention_back": false,
  "can_mention_share": false,
  "can_play_spotify_audio": false,
  "can_reply": true,
  "can_reshare": true,
  "can_reshare_to_story": true,
  "can_save": false,
  "can_send_prompt": false,
  "caption": null,
  "caption_is_edited": false,
  "coauthor_producers": [],
  "code": "DasihSrjvdW",
  "creative_config": null,
  "crosspost_metadata": {
    "fb_downstream_use_xpost_metadata": {
      "downstream_use_xpost_deny_reason": "NONE"
    }
  },
  "cutout_sticker_info": [],
  "deleted_reason": 0,
  "device_timestamp": 1783865925370945,
  "expiring_at": 1783952325,
  "fbid": "17885201481436985",
  "filter_type": 0,
  "fundraiser_tag": {
    "has_standalone_fundraiser": false
  },
  "gen_ai_detection_method": {
    "detection_method": "NONE"
  },
  "has_audio": true,
  "has_high_risk_gen_ai_inform_treatment": false,
  "has_liked": false,
  "has_privately_liked": false,
  "has_translation": false,
  "id": "3939675595424593750",
  "ig_media_sharing_disabled": false,
  "image_versions": {
    "items": [
      {
        "height": 1136,
        "is_spatial_image": false,
        "url": "https://scontent-lax3-2.cdninstagram.com/v/t51.71878-15/746823765_1678099530083882_5913288884950836507_n.jpg?...",
        "width": 640
      },
      {
        "height": 639,
        "is_spatial_image": false,
        "url": "https://scontent-lax3-2.cdninstagram.com/v/t51.71878-15/746823765_1678099530083882_5913288884950836507_n.jpg?...",
        "width": 360
      }
    ]
  },
  "integrity_review_decision": "pending",
  "is_arirang_prize": false,
  "is_dash_eligible": 1,
  "is_first_take": false,
  "is_from_ayt_clips_inspiration": false,
  "is_from_discovery_surface": false,
  "is_open_to_public_submission": false,
  "is_organic_product_tagging_eligible": true,
  "is_paid_partnership": false,
  "is_photo_mash_story": false,
  "is_pinned": false,
  "is_quicksnap_recap": false,
  "is_reel_media": true,
  "is_reshare_of_text_post_app_media_in_ig": false,
  "is_story_image_with_music": false,
  "is_tagged_media_shared_to_viewer_profile_grid": false,
  "is_terminal_video_segment": false,
  "is_video": true,
  "is_viewer_mentioned": false,
  "location": null,
  "media_attributions_data": [],
  "media_format": "video",
  "media_name": "story",
  "media_overlay_info": null,
  "media_type": 2,
  "music_metadata": null,
  "number_of_qualities": 8,
  "original_height": 1920,
  "original_media_type": 2,
  "original_width": 1080,
  "owner": {
    "fifa_country_code": "US",
    "full_name": "MrBeast",
    "id": "2278169415",
    "interop_messaging_user_fbid": "116505369742833",
    "is_creator_agent_enabled": false,
    "is_private": false,
    "is_ring_creator": false,
    "is_screenshot_blocking_enabled": false,
    "is_verified": true,
    "profile_pic_id": "1765328607101572916",
    "profile_pic_url": "https://scontent-lax3-2.cdninstagram.com/v/t51.2885-19/31077884_211593632905749_1394765701385814016_n.jpg?...",
    "show_ring_award": false,
    "transparency_product_enabled": false,
    "username": "mrbeast"
  },
  "product_type": "story",
  "query_cache_test_11": "XDTMediaDict",
  "reel_mentions": [
    {
      "custom_text_color": null,
      "display_type": "mention_username",
      "end_time_ms": 86400,
      "height": 0.037266985417493,
      "id": "18167459458445682",
      "is_fb_sticker": 0,
      "is_hidden": 0,
      "is_pinned": 0,
      "is_sticker": 0,
      "rotation": 0,
      "start_time_ms": 0,
      "user": {
        "full_name": "Nolan Hansen",
        "id": "2321286042",
        "is_private": false,
        "is_verified": true,
        "profile_pic_id": "3234680011579911829",
        "profile_pic_url": "https://scontent-lax3-2.cdninstagram.com/v/t51.2885-19/401531028_182013178311805_6253927047467503478_n.jpg?...",
        "username": "nolanhansen"
      },
      "width": 0.41277576861558,
      "x": 0.34116048923144,
      "y": 0.79845393150868,
      "z": 1
    }
  ],
  "sharing_friction_info": {
    "bloks_app_url": null,
    "sharing_friction_payload": null,
    "should_have_sharing_friction": false
  },
  "shop_routing_user_id": null,
  "should_show_author_pog_for_tagged_media_shared_to_profile_grid": false,
  "sponsor_tags": [],
  "story_feed_media": [
    {
      "clips_creation_entry_point": "clips",
      "custom_text_color": null,
      "end_time_ms": 86400,
      "height": 0.5,
      "id": "3939666321432042208",
      "is_fb_sticker": 0,
      "is_hidden": 0,
      "is_pinned": 0,
      "is_sticker": 1,
      "media_code": "DasgaVmhtrg",
      "media_compound_str": "3939666321432042208_2278169415",
      "media_type": "video",
      "product_type": "clips",
      "rotation": 0,
      "start_time_ms": 0,
      "uncapped_height_ratio": 0.8,
      "uncapped_width_ratio": 0.8,
      "width": 0.5,
      "x": 0.5,
      "y": 0.5,
      "z": 0
    }
  ],
  "story_highlight_reshare_stickers": [],
  "story_music_stickers": [
    {
      "custom_text_color": null,
      "end_time_ms": 86400,
      "height": 0,
      "id": "18137535244570319",
      "is_fb_sticker": 0,
      "is_hidden": 0,
      "is_pinned": 0,
      "is_sticker": 1,
      "original_sound_info": {
        "allow_creator_to_rename": true,
        "audio_id": 27469132582772490,
        "duration_in_ms": 50766,
        "hide_remixing": true,
        "ig_artist": {
          "full_name": "MrBeast",
          "id": "2278169415",
          "is_private": false,
          "is_verified": true,
          "profile_pic_id": "1765328607101572916",
          "profile_pic_url": "https://scontent-lax3-2.cdninstagram.com/v/t51.2885-19/31077884_211593632905749_1394765701385814016_n.jpg?...",
          "username": "mrbeast"
        },
        "is_audio_automatically_attributed": false,
        "is_eligible_for_audio_effects": true,
        "is_eligible_for_vinyl_sticker": true,
        "is_explicit": false,
        "is_original_audio_download_eligible": false,
        "is_reuse_disabled": false,
        "original_audio_subtype": "default",
        "original_audio_title": "Original audio",
        "progressive_download_url": "https://scontent-lax3-2.cdninstagram.com/o1/v/t2/f2/m86/AQPpL66x1Ba5TQRLGiNwkvHDd7s72ynWjReBNNSeyd8m0luEJmZII4npCL6upPf6W_nFAd7AG-S_4RKD_CZqzuKoQ3Qi33UjbLU.mp4?...",
        "should_mute_audio": false,
        "time_created": 1783805807
      },
      "rotation": 0,
      "start_time_ms": 0,
      "width": 0,
      "x": 0,
      "y": 0,
      "z": 0
    }
  ],
  "supports_reel_reactions": true,
  "tagged_users": [],
  "taken_at": 1783865925,
  "taken_at_date": "2026-07-12T14:18:45+00:00",
  "taken_at_ts": 1783865925,
  "thumbnail_url": "https://scontent-lax3-2.cdninstagram.com/v/t51.71878-15/746823765_1678099530083882_5913288884950836507_n.jpg?...",
  "trending_content_info": [],
  "user": {
    "fifa_country_code": "US",
    "full_name": "MrBeast",
    "id": "2278169415",
    "interop_messaging_user_fbid": "116505369742833",
    "is_creator_agent_enabled": false,
    "is_private": false,
    "is_ring_creator": false,
    "is_screenshot_blocking_enabled": false,
    "is_verified": true,
    "profile_pic_id": "1765328607101572916",
    "profile_pic_url": "https://scontent-lax3-2.cdninstagram.com/v/t51.2885-19/31077884_211593632905749_1394765701385814016_n.jpg?...",
    "show_ring_award": false,
    "transparency_product_enabled": false,
    "username": "mrbeast"
  },
  "video_codec": "av01.0.05M.08.0.111.01.01.01.0",
  "video_duration": 50.766,
  "video_url": "https://scontent-lax3-2.cdninstagram.com/o1/v/t2/f2/m78/AQPCN-3TSwPtO7pPmSfkD5mPpo46Q6UZc5bg9BQ7gLjlp8iJh8pXDKc__PL58upEmmrp1WvbqI9WComCBUF835zk49_MUs8C6JAqwxM.mp4?...",
  "video_versions": [
    {
      "bandwidth": 1338511,
      "fallback": null,
      "height": 1280,
      "id": "18559387024073416v",
      "type": 101,
      "url": "https://scontent-lax3-2.cdninstagram.com/o1/v/t2/f2/m78/AQPCN-3TSwPtO7pPmSfkD5mPpo46Q6UZc5bg9BQ7gLjlp8iJh8pXDKc__PL58upEmmrp1WvbqI9WComCBUF835zk49_MUs8C6JAqwxM.mp4?...",
      "url_expiration_timestamp_us": null,
      "width": 720
    }
  ],
  "wearable_shared_media_resolutions": [],
  "wearables_creator_tools_info": []
}
````

### How It Works

1. You enter an Instagram username, numeric user ID, or profile URL.
2. You choose whether you want safer embed-style media links.
3. The actor checks the account and fetches its current stories automatically.
4. It returns the story media and related details in a clean, structured format.
5. You review, export, or reuse the results in your reporting, research, or publishing workflow.

### Getting Started

Getting started is simple and does not require coding. Click **Try for free**, paste in the Instagram account you want to check, choose any optional settings, and click **Run**. In a short time, you will get the latest story data ready to review. You can download the results as JSON, CSV, or Excel, depending on how you want to use the data.

### Frequently Asked Questions

#### Do I need technical skills?

No. This actor is designed for business users, marketers, researchers, and creators who want Instagram story data without manual work. You only need to enter an account and run it.

#### How fast does it run?

It is built to fetch the latest stories quickly, and the exact time depends on the number of accounts you provide and the amount of story data available. For a single account, results are usually returned very quickly.

#### What format is the output?

The results are available in easy-to-use formats such as JSON, CSV, and Excel. That makes it simple to review the data in spreadsheets, share it with teammates, or import it into your own tools.

#### Is it legal to use?

You should always use the data in a way that respects applicable laws, platform rules, and privacy expectations. This actor is intended for legitimate business, research, and content workflows, and you are responsible for using the results appropriately.

#### Can I schedule it to run automatically?

Yes. You can set it up to run on a schedule so you can keep checking accounts regularly without doing it manually each time. This is useful for monitoring creators, competitors, or campaign activity over time.

# Actor input Schema

## `username_or_id_or_url` (type: `array`):

Enter an Instagram username, user ID, or profile URL to get the latest stories.

## `max_results` (type: `integer`):

Limit how many story items are returned for each account.

## Actor input object example

```json
{
  "username_or_id_or_url": [
    "mrbeast"
  ],
  "max_results": 100
}
```

# 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_or_id_or_url": [
        "mrbeast"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("datamagnet/instagram-user-stories-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_or_id_or_url": ["mrbeast"] }

# Run the Actor and wait for it to finish
run = client.actor("datamagnet/instagram-user-stories-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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_or_id_or_url": [
    "mrbeast"
  ]
}' |
apify call datamagnet/instagram-user-stories-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=datamagnet/instagram-user-stories-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "✅ Instagram User Stories Scraper",
        "description": "Get the latest Instagram stories from one or more accounts in a simple, ready-to-use format. Enter a username, user ID, or profile URL to extract story media and related details exactly as delivered by the source, with embed-safe links available when enabled.",
        "version": "0.0",
        "x-build-id": "q6f7eJMuKTxffL2kT"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/datamagnet~instagram-user-stories-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-datamagnet-instagram-user-stories-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/datamagnet~instagram-user-stories-scraper/runs": {
            "post": {
                "operationId": "runs-sync-datamagnet-instagram-user-stories-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/datamagnet~instagram-user-stories-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-datamagnet-instagram-user-stories-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "username_or_id_or_url"
                ],
                "properties": {
                    "username_or_id_or_url": {
                        "title": "Instagram account",
                        "type": "array",
                        "description": "Enter an Instagram username, user ID, or profile URL to get the latest stories.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "max_results": {
                        "title": "Maximum results",
                        "type": "integer",
                        "description": "Limit how many story items are returned for each account.",
                        "default": 100
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
