# Instagram Followers Count Scraper (`mohamedgb00714/instagram-followers-count-scraper`) Actor

Scrape the number of followers & follows from any Instagram profile. Schedule the scraper to run regularly to monitor how the numbers change. You can also export scraped data, run the scraper via API, monitor runs or integrate with other tools.

- **URL**: https://apify.com/mohamedgb00714/instagram-followers-count-scraper.md
- **Developed by:** [mohamed el hadi msaid](https://apify.com/mohamedgb00714) (community)
- **Categories:** Social media, Developer tools, Automation
- **Stats:** 102 total users, 0 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 Followers Count Scraper

Welcome to the **Instagram Followers Count Scraper**! This project utilizes the power of **Crawlee** and **Puppeteer** to scrape Instagram user data, specifically focusing on follower counts and following counts. This tool is designed for developers and data enthusiasts who want to gather insights from Instagram profiles efficiently.

### Table of Contents

- [Features](#features)
- [Getting Started](#getting-started)
- [Input Schema](#input-schema)
- [How It Works](#how-it-works)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)

### Features

- Scrapes follower and following counts for specified Instagram usernames.
- Utilizes a headless browser to mimic real user behavior, reducing the risk of detection.
- Supports proxy configurations to manage requests effectively.
- Easy to set up and use with customizable input options.

### Getting Started

To get started with the Instagram Followers Count Scraper, follow these steps:

1. **Clone the repository**:
   ```bash
   git clone https://github.com/yourusername/instagram-followers-count-scraper.git
   cd instagram-followers-count-scraper
   ```

2. **Install dependencies**:
   Make sure you have Node.js installed, then run:
   ```bash
   npm install
   ```

3. **Set up your Apify account**:
   Create an account on [Apify](https://apify.com) if you haven't already. You'll need your API token for authentication.

4. **Configure your input**:
   Update the `input_schema.json` file to include the Instagram usernames you want to scrape.

### Input Schema

The input schema defines the structure of the input data for the scraper. It expects an array of Instagram usernames:

```json
{
    "title": "PuppeteerCrawler Template",
    "type": "object",
    "schemaVersion": 1,
    "properties": {
        "instagramUsernames": {
            "title": "Instagram Usernames",
            "type": "array",
            "editor": "stringList",
            "description": "Array of Instagram account usernames.",
            "prefill": ["mohamedgbelhadi"]
        }
    }
}
```

### How It Works

The scraper uses Puppeteer to launch a headless browser that navigates to each specified Instagram profile. It intercepts network requests to gather follower and following counts from the Instagram GraphQL API. The data is then stored in a dataset for easy access and analysis.

### Usage

To run the scraper, use the following command:

```bash
apify run
```

You can also run it directly from the Apify platform by creating a new actor and uploading the project files.

### Contributing

Contributions are welcome! If you have suggestions for improvements or new features, feel free to open an issue or submit a pull request.

### License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

***

Thank you for using the Instagram Followers Count Scraper! We hope it helps you gather valuable insights from Instagram profiles. If you have any questions or need support, please reach out to us on the Apify community forums.

# Actor input Schema

## `instagramUsernames` (type: `array`):

Array of Instagram account usernames.

## Actor input object example

```json
{
  "instagramUsernames": [
    "moeelhady"
  ]
}
```

# 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 = {
    "instagramUsernames": [
        "moeelhady"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mohamedgb00714/instagram-followers-count-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 = { "instagramUsernames": ["moeelhady"] }

# Run the Actor and wait for it to finish
run = client.actor("mohamedgb00714/instagram-followers-count-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 '{
  "instagramUsernames": [
    "moeelhady"
  ]
}' |
apify call mohamedgb00714/instagram-followers-count-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mohamedgb00714/instagram-followers-count-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/YJDdYs3nbTpedTT5n/builds/G8dZNnmbYaaqs8DvG/openapi.json
