Instagram Video Scraper avatar

Instagram Video Scraper

Try for free

Pay $9.99 for 1,000 results

View all Actors
Instagram Video Scraper

Instagram Video Scraper

social_media_scraper/instagram-video-scraper
Try for free

Pay $9.99 for 1,000 results

Scrape data from Instagram video.

Instagram Stats Actor

An Apify actor that fetches statistical data from Instagram posts using the Apify Instagram Scraper. This actor retrieves view counts, play counts, likes, and comments for Instagram posts.

Features

  • Fetches comprehensive statistics for Instagram posts
  • Handles timeouts and retries automatically
  • Provides structured output data
  • Supports both single post URLs and batch processing
  • Includes detailed error handling and logging

Prerequisites

  • Python 3.7 or later
  • Apify SDK
  • Valid Apify API token
  • Instagram Apify API token

Installation

  1. Clone this repository or download the source files
1git clone <repository-url>
2cd instagram-stats-actor
  1. Install required dependencies
pip install apify-client httpx tenacity

Usage

Running as Apify Actor

  1. Input Schema:
1{
2    "url": "https://www.instagram.com/p/example"
3}
  1. Example output:
1{
2    "url": "https://www.instagram.com/p/example",
3    "shortCode": "example",
4    "statistics": {
5        "views": 1000,
6        "plays": 950,
7        "likes": 500,
8        "comments": 50
9    },
10    "success": true
11}

Configuration Options

ParameterTypeDescriptionDefault
timeoutintRequest timeout in seconds30
max_retriesintMaximum number of retry attempts3

Error Handling

The actor implements comprehensive error handling:

  • Timeouts: Automatically retries with exponential backoff
  • API Errors: Detailed error messages in the output
  • Invalid URLs: Validation and meaningful error messages
  • Network Issues: Automatic retry mechanism

Examples

Basic Actor Input

1{
2    "url": "https://www.instagram.com/p/example"
3}

Custom Configuration Input

1{
2    "url": "https://www.instagram.com/p/example",
3    "timeout": 60,
4    "maxRetries": 5
5}

Success Output Example

1{
2    "url": "https://www.instagram.com/p/example",
3    "shortCode": "example",
4    "statistics": {
5        "views": 1000,
6        "plays": 950,
7        "likes": 500,
8        "comments": 50
9    },
10    "success": true
11}

Error Output Example

1{
2    "url": "https://www.instagram.com/p/example",
3    "error": "Request timed out after 30 seconds",
4    "success": false
5}

License

This project is licensed under the MIT License - see the LICENSE file for details.

Developer
Maintained by Community
Actor metrics
  • 4 monthly users
  • 0 stars
  • 100.0% runs succeeded
  • Created in Oct 2024
  • Modified 17 days ago
Categories