# Instagram Profile Scraper (`webscrap18/instagram-profile-scraper`) Actor

Scrape Instagram profiles like a pro 📸
Get 👥 followers, 📝 bio, 🖼️ profile pics, and ✅ verification status in seconds.
Fast. Reliable. Scalable.

- **URL**: https://apify.com/webscrap18/instagram-profile-scraper.md
- **Developed by:** [WebScrap](https://apify.com/webscrap18) (community)
- **Categories:** Automation, Lead generation, Social media
- **Stats:** 21 total users, 1 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 Profile Scraper

A blazing-fast, **credential-free** Apify actor that scrapes public Instagram profiles.\
No login. No cookies. No API keys. Just results.

Note: Use RESIDENTIAL proxies for best results. Otherwise you will get rate limited or blocked by Instagram.

### ✨ Features

- ⚡ **Fast** — typically 1-3 seconds per profile using Instagram's internal REST API
- 🛡️ **Reliable** — 3-tier fallback strategy (REST API → legacy API → HTML parse)
- 🔒 **No auth required** — only scrapes publicly visible data
- 📦 **Rich output** — profile info, posts, IGTV, related profiles, external links
- 💰 **Pay-per-event** — only charged for successful scrapes

### 📥 Input

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `usernames` | `string[]` | ✅ | — | Instagram usernames or profile URLs |
| `maxPosts` | `integer` | No | `12` | Max recent posts per profile (0–50) |
| `maxIgtvVideos` | `integer` | No | `6` | Max IGTV videos per profile (0–50) |
| `proxyConfiguration` | `object` | No | Apify Residential | Proxy settings |

#### Example Input

```json
{
  "usernames": [
    "nasa",
    "natgeo",
    "https://www.instagram.com/spacex"
  ],
  "maxPosts": 12,
  "maxIgtvVideos": 6
}
```

### Output

The actor extracts comprehensive profile data including basic info, statistics, posts, and related profiles.

#### Sample Output

```json
{
  "inputUrl": "https://www.instagram.com/nasa",
  "id": "528817151",
  "username": "nasa",
  "url": "https://www.instagram.com/nasa",
  "fullName": "NASA",
  "biography": "🚀 🌎  Exploring the universe and our home planet. Verification: nasa.gov/socialmedia",
  "about": {
    "accounts_with_shared_followers": null,
    "country": null,
    "date_joined": null,
    "date_joined_as_timestamp": null,
    "date_verified": null,
    "date_verified_as_timestamp": null,
    "former_usernames": 0,
    "id": "528817151",
    "is_verified": true,
    "username": "nasa"
  },
  "followersCount": 98209149,
  "followsCount": 92,
  "postsCount": 4591,
  "highlightReelCount": 7,
  "igtvVideoCount": 171,
  "isBusinessAccount": true,
  "joinedRecently": false,
  "hasChannel": false,
  "businessCategoryName": null,
  "private": false,
  "verified": true,
  "externalUrl": "https://www.nasa.gov/",
  "externalUrlShimmed": "https://l.instagram.com/?u=https%3A%2F%2Fwww.nasa.gov%2F&e=...",
  "externalUrls": [
    {
      "title": "Launches & Landings",
      "lynx_url": "https://l.instagram.com/?u=http%3A%2F%2Fnasa.gov%2Fevents&e=...",
      "url": "http://nasa.gov/events",
      "link_type": "external"
    },
    {
      "title": "NASA+",
      "lynx_url": "https://l.instagram.com/?u=https%3A%2F%2Fplus.nasa.gov%2F&e=...",
      "url": "https://plus.nasa.gov",
      "link_type": "external"
    }
  ],
  "profilePicUrl": "https://instagram.famd21-2.fna.fbcdn.net/v/...",
  "profilePicUrlHD": "https://instagram.famd21-2.fna.fbcdn.net/v/...",
  "relatedProfiles": [
    {
      "id": "953293389",
      "full_name": "International Space Station",
      "is_private": false,
      "is_verified": true,
      "profile_pic_url": "https://...",
      "username": "iss"
    }
  ],
  "latestPosts": [
    {
      "id": "3710009743416087462",
      "type": "Video",
      "shortCode": "DN8mjSFjdOm",
      "caption": "We're going up, up, up, it's our moment! 🎶...",
      "hashtags": ["NASARoman", "Astrophysics", "SpaceTelescope"],
      "mentions": ["NASAGoddard", "NASAUniverse"],
      "url": "https://www.instagram.com/p/DN8mjSFjdOm/",
      "commentsCount": 429,
      "dimensionsHeight": 853,
      "dimensionsWidth": 480,
      "displayUrl": "https://scontent-lga3-3.cdninstagram.com/v/...",
      "images": [],
      "videoUrl": "https://scontent-lga3-2.cdninstagram.com/o1/v/...",
      "alt": null,
      "likesCount": 53833,
      "videoViewCount": 926847,
      "timestamp": "2025-08-29T17:16:11.000Z",
      "childPosts": [],
      "ownerUsername": "nasa",
      "ownerId": "528817151",
      "productType": "clips",
      "taggedUsers": [
        {
          "full_name": "NASA Goddard",
          "id": "3808579",
          "is_verified": true,
          "profile_pic_url": "https://...",
          "username": "nasagoddard"
        }
      ],
      "isCommentsDisabled": false
    }
  ],
  "latestIgtvVideos": [
    {
      "id": "3073651751604454027",
      "type": "Video",
      "shortCode": "CqnzfuxpAKL",
      "title": "",
      "caption": "On April 3, we announced the team of space explorers...",
      "commentsCount": 2378,
      "dimensionsHeight": 1920,
      "dimensionsWidth": 1080,
      "displayUrl": "https://...",
      "likesCount": 330976,
      "videoDuration": 1122.054,
      "videoViewCount": 2430081,
      "videoUrl": "https://...",
      "timestamp": "2023-04-04T17:04:37.000Z",
      "ownerUsername": "nasa",
      "ownerId": "528817151"
    }
  ]
}
```

### Notes

⚠️ **Important**:

- Instagram may rate-limit or block requests if you scrape too aggressively
- **Use Apify Proxy** for production scraping to avoid rate limits (RESIDENTIAL proxy recommended)
- Always respect Instagram's Terms of Service and robots.txt
- Use reasonable delays between requests
- This actor is for educational purposes

# Actor input Schema

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

List of Instagram usernames (e.g. 'nasa') or full profile URLs (e.g. 'https://www.instagram.com/nasa'). You can mix both formats.

## `maxPosts` (type: `integer`):

Maximum number of recent posts to extract per profile. Set to 0 to skip posts entirely.

## `maxIgtvVideos` (type: `integer`):

Maximum number of IGTV videos to extract per profile. Set to 0 to skip.

## `proxyConfiguration` (type: `object`):

Apify proxy configuration. Recommended to use Apify residential proxies for best results.

## Actor input object example

```json
{
  "usernames": [
    "nasa",
    "natgeo",
    "https://www.instagram.com/spacex"
  ],
  "maxPosts": 5,
  "maxIgtvVideos": 2,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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": [
        "nasa"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("webscrap18/instagram-profile-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 = {
    "usernames": ["nasa"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("webscrap18/instagram-profile-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 '{
  "usernames": [
    "nasa"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call webscrap18/instagram-profile-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,webscrap18/instagram-profile-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/1yfNsZmKODXH5EoCL/builds/5af2CaMftwvVdidVB/openapi.json
