# IG Stories Extractor (`myagizm/ig-stories-extractor`) Actor

Extract structured data from Instagram stories: mentions, hashtags, swipe-up links, media type and timing, plus ready counters (mentionsCount, hashtagsCount, hasLink). Optional filter for stories posted in the last N hours.

- **URL**: https://apify.com/myagizm/ig-stories-extractor.md
- **Developed by:** [MYM](https://apify.com/myagizm) (community)
- **Categories:** Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.40 / 1,000 story extracteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## IG Stories Extractor — mentions, hashtags & swipe-up links from Instagram stories

<p align="center">
  <a href="https://apify.com/myagizm/ig-stories-extractor"><img src="https://img.shields.io/badge/Apify-Actor-00b96b?logo=apify&logoColor=white" alt="Apify Actor"></a>
  <img src="https://img.shields.io/badge/No%20Login-needed-blue" alt="No Login">
  <img src="https://img.shields.io/badge/No%20Cookies-needed-blue" alt="No cookies">
  <img src="https://img.shields.io/badge/Export-JSON%20%7C%20CSV%20%7C%20Excel-orange" alt="Export">
  <img src="https://img.shields.io/badge/Pricing-pay%20per%20story-success" alt="Pay per story">
</p>

Turn Instagram stories into **analysis-ready data**. Besides media URLs and timing, every row comes with ready counters — `mentionsCount`, `hashtagsCount`, `linksCount` and a `hasLink` flag — so you can filter for stories with swipe-up links or tagged partners in one click. Optionally keep only stories **posted in the last N hours**; older ones are not returned and not charged.

> Works on public profiles only. No Instagram account, login, cookies, Graph API app or proxy setup needed.

### What makes IG Stories Extractor different

| Field / option | What you get |
|---|---|
| `mentionsCount / hashtagsCount / linksCount` | Ready-made counters |
| `hasLink` | `true` when the story carries a link sticker / swipe-up |
| `postedWithinHours` | Input: keep only stories posted in the last N hours (0 = all) |

### Standard story data

Every row also includes: `id`, `ofUsername`, `ownerVerified`, `type` (image/video), `takenAt`, `expiringAt`, `displayUrl`, `videoUrl`, `videoDuration`, `mentions`, `hashtags`, `links`, `shortcode`, `url`.

### Who uses it

- Influencer marketing teams finding which partners a brand tags
- Affiliate & growth teams collecting swipe-up destinations
- Lead-gen workflows spotting accounts that promote links
- Data teams feeding story metadata into BI dashboards

### How to use it

1. Add one or more public Instagram profiles.
2. Set the maximum number of stories and your filter.
3. Click **Start** and download the results as JSON, CSV, Excel or via the API.

### Input example

```json
{
  "usernames": [
    "natgeo",
    "nike"
  ],
  "resultsLimit": 100,
  "postedWithinHours": 12
}
```

### Output example

```json
[
  {
    "id": "4033187975996262244",
    "ofUsername": "natgeo",
    "owner": "natgeo",
    "ownerVerified": true,
    "type": "image",
    "isVideo": false,
    "productType": "story",
    "takenAt": "2026-11-18T14:51:39Z",
    "expiringAt": "2026-11-19T14:51:39.000Z",
    "takenAtEpoch": 1795013499,
    "displayUrl": "https://scontent.cdninstagram.com/v/t51.82787-15/...n.jpg?...",
    "videoUrl": null,
    "videoDuration": 0,
    "mentions": [
      "explorecanada"
    ],
    "hashtags": [],
    "links": [],
    "mentionsCount": 1,
    "hashtagsCount": 0,
    "linksCount": 0,
    "hasLink": false
  }
]
```

### Pricing

Pay only for stories returned to the dataset — profiles with no active story cost nothing.

| Apify plan | Price per 1,000 stories |
|---|---|
| Free | $40.00 |
| Starter (Bronze) | $3.60 |
| Scale (Silver) | $3.30 |
| Business (Gold) and higher | $2.40 |

Free Apify plans have a small daily limit on results; paid plans are unlimited.

### Tips

- Sort by `hasLink` to see every story that drives traffic off Instagram.
- Set `postedWithinHours` to your schedule interval to only pay for new stories.
- Stories live for 24 hours. A profile with nothing posted in the last day returns no rows (and no charge).

### Use it via API

```bash
curl -X POST "https://api.apify.com/v2/acts/myagizm~ig-stories-extractor/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"usernames": ["natgeo", "nike"], "resultsLimit": 100, "postedWithinHours": 12}'
```

Works with Make, Zapier, n8n, Google Sheets, webhooks and the Apify MCP server for AI agents.

### FAQ

#### Where do mentions come from?

From the story's mention stickers and caption tags as Instagram reports them.

#### What does postedWithinHours do?

Drops stories older than N hours before they reach the dataset, so they are not charged.

#### Do I need an Instagram account or cookies?

No.

#### Why did a profile return no stories?

It has no active story right now, it is private, or the username does not exist. The run log names each such profile.

#### How long do media links work?

Instagram CDN links usually expire within a few days — save files soon after the run.

#### Can I get highlights or story viewers?

No. Only currently active public stories are returned; viewer lists are private to the owner.

### Disclaimer

This actor only reads publicly available data. You are responsible for using it in line with Instagram's terms, copyright and data-protection laws such as GDPR. It is not affiliated with Instagram or Meta.

***

## 中文说明 —— IG 快拍数据提取器

把 Instagram 快拍变成可分析的数据：除媒体链接和时间外，每条附带提及数、话题标签数、链接数和 hasLink 标记。可选只保留最近 N 小时发布的快拍，其余不返回也不计费。

- 无需 Instagram 账号、登录或 Cookie，仅支持公开账号。
- 按返回的快拍计费，没有活跃快拍的账号不收费。
- 结果可导出为 JSON、CSV、Excel，或通过 API 获取。
- 快拍有效期 24 小时；媒体链接通常几天后失效，请尽快保存。

### 输入示例

```json
{
  "usernames": [
    "natgeo",
    "nike"
  ],
  "resultsLimit": 100,
  "postedWithinHours": 12
}
```

# Actor input Schema

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

Public profiles whose active stories you want. Plain usernames, @handles and profile URLs all work.

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

Hard cap on stories returned by this run. A run lasts at most ~10 minutes.

## `postedWithinHours` (type: `integer`):

Leave 0 to keep every active story (stories live up to 24 hours). Filtered stories are not returned and not charged.

## Actor input object example

```json
{
  "usernames": [
    "natgeo",
    "nike"
  ],
  "resultsLimit": 100,
  "postedWithinHours": 0
}
```

# Actor output Schema

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

All returned stories as structured JSON.

# 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": [
        "natgeo",
        "nike"
    ],
    "resultsLimit": 100,
    "postedWithinHours": 0
};

// Run the Actor and wait for it to finish
const run = await client.actor("myagizm/ig-stories-extractor").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": [
        "natgeo",
        "nike",
    ],
    "resultsLimit": 100,
    "postedWithinHours": 0,
}

# Run the Actor and wait for it to finish
run = client.actor("myagizm/ig-stories-extractor").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": [
    "natgeo",
    "nike"
  ],
  "resultsLimit": 100,
  "postedWithinHours": 0
}' |
apify call myagizm/ig-stories-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,myagizm/ig-stories-extractor"
        }
    }
}
```

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/rlCsxb05CCt6OR0IJ/builds/PMSh1gGMgUxI1MTKm/openapi.json
