Instagram Stories Scraper avatar
Instagram Stories Scraper

Pricing

$23.00/month + usage

Go to Apify Store
Instagram Stories Scraper

Instagram Stories Scraper

A Scraper that downloads Instagram stories from multiple users with comprehensive metadata extraction.

Pricing

$23.00/month + usage

Rating

0.0

(0)

Developer

Deepanshu Sharma

Deepanshu Sharma

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

4 days ago

Last modified

Share

Instagram Story Scraper

A powerful Actor that scrapes Instagram stories from one or multiple users. Each story is downloaded and tracked as a separate record with comprehensive metadata including download status, URLs, and media information.

Features

  • πŸ” Secure Authentication - Uses Instagram session ID for reliable access
  • πŸ“± Multi-User Support - Scrape stories from multiple Instagram accounts in one run
  • πŸ“Š Individual Story Records - Each story gets its own detailed record in the output
  • πŸŽ₯ Media Support - Downloads both photos and videos
  • πŸ“ Rich Metadata - Captures posting time, media type, file size, URLs, and more
  • πŸ”„ Multiple Download Methods - Uses fallback methods to ensure successful downloads
  • βš™οΈ Flexible Configuration - Control story limits, delays, and targeting
  • πŸ“ Organized Storage - Files saved with timestamps and indexed naming

Input Configuration

The actor accepts the following input parameters:

{
"session_id": "YOUR_INSTAGRAM_SESSION_ID",
"usernames": ["username1", "username2", "username3"],
"delay_between_requests": 2,
"story_limit": "all",
"latest_only": false
}

Input Fields

FieldTypeRequiredDescription
session_idStringβœ… YesYour Instagram session ID from browser cookies
usernamesArray/Stringβœ… YesInstagram username(s) to scrape. Can be a single string or array of usernames
usernameStringNoAlternative field for single username (backward compatibility)
delay_between_requestsNumberNoDelay in seconds between requests (default: 2)
story_limitNumber/StringNoNumber of stories to download per user, or "all" (default: "all")
latest_onlyBooleanNoDownload only the latest story from each user (default: false)

Getting Your Session ID

  1. Log into Instagram in your browser
  2. Open Developer Tools (F12)
  3. Go to Application/Storage β†’ Cookies β†’ instagram.com
  4. Find and copy the value of sessionid cookie

⚠️ Important: Keep your session ID secure and don't share it publicly.

Output Format

The actor outputs one record for each story scraped. Each record contains:

{
"username": "cryptodaily",
"user_id": "60586511690",
"scraping_timestamp": "2025-12-14T09:42:27.268488",
"status": "completed",
"story_index": 1,
"story_id": "3786688183573256768",
"media_type": "video",
"posted_date": "2025-12-13",
"posted_time": "12:20:28 UTC",
"posted_datetime": "2025-12-13T12:20:28+00:00",
"download_status": "success",
"filename": "story_1_20251213_122028.mp4",
"file_size": 262808,
"photo_url": null,
"photo_info": {},
"video_url": "https://...",
"video_info": {
"video_url": "https://...",
"thumbnail_url": "https://...",
"duration": 5.014999866485596,
"resolution": null
},
"error_message": null
}

Output Fields

FieldTypeDescription
usernameStringInstagram username
user_idStringInstagram user ID
scraping_timestampStringISO timestamp when scraping occurred
statusStringOverall status: "completed", "error", "processing", "no_stories", "user_not_found"
story_indexNumberIndex of story for this user (1-based)
story_idStringInstagram story ID
media_typeStringType of media: "photo" or "video"
posted_dateStringDate story was posted (YYYY-MM-DD)
posted_timeStringTime story was posted (HH:MM:SS UTC)
posted_datetimeStringISO datetime when story was posted
download_statusStringDownload status: "success", "failed", "no_stories"
filenameStringName of downloaded file
file_sizeNumberSize of downloaded file in bytes
photo_urlStringDirect URL to photo (if photo)
photo_infoObjectAdditional photo metadata (resolution, thumbnail)
video_urlStringDirect URL to video (if video)
video_infoObjectVideo metadata (duration, thumbnail, resolution)
error_messageStringError description if download failed

Usage Examples

Single User - All Stories

{
"session_id": "your_session_id_here",
"usernames": ["cryptodaily"]
}

Multiple Users - Latest Story Only

{
"session_id": "your_session_id_here",
"usernames": ["user1", "user2", "user3"],
"latest_only": true
}

Limited Stories with Custom Delay

{
"session_id": "your_session_id_here",
"usernames": ["techblogger"],
"story_limit": 5,
"delay_between_requests": 3
}

Downloaded Files

Files are organized in the following structure:

downloads/
└── username/
└── stories/
β”œβ”€β”€ story_1_20251213_122028.mp4
β”œβ”€β”€ story_2_20251214_063947.mp4
└── ...

File naming format: story_{index}_{YYYYMMDD_HHMMSS}.{ext}

Rate Limiting

To avoid Instagram rate limits:

  • Default delay of 2 seconds between requests
  • Configurable delay via delay_between_requests
  • Stories are processed sequentially
  • Delay applied between users when scraping multiple accounts

Error Handling

The actor handles various error scenarios:

  • User Not Found: Returns record with status: "user_not_found"
  • No Active Stories: Returns record with status: "no_stories"
  • Private Account: Records error if you don't follow the user
  • Download Failures: Uses multiple fallback methods
  • Authentication Issues: Fails gracefully with clear error messages

Limitations

  • ⏰ Stories are only available for 24 hours on Instagram
  • πŸ”’ Can only scrape stories from public accounts or accounts you follow
  • πŸ“Š Instagram API rate limits apply
  • πŸ” Session ID expires and needs to be refreshed periodically

Support

For issues or questions:

  • Check that your session ID is valid and not expired
  • Ensure usernames are correct (without @ symbol is fine)
  • Review the error messages in the output records
  • Increase delay_between_requests if hitting rate limits

Privacy & Ethics

  • Only scrape content you have permission to access
  • Respect Instagram's Terms of Service
  • Don't use for harassment or unauthorized data collection
  • Keep session IDs secure