# Instagram Profile Scraper (`lisenser/ig-profile-scraper`) Actor

Scrape detailed information from Instagram user profiles quickly and efficiently. Built with retry mechanisms and fail safe.

- **URL**: https://apify.com/lisenser/ig-profile-scraper.md
- **Developed by:** [Lisenser](https://apify.com/lisenser) (community)
- **Categories:** Social media, Lead generation
- **Stats:** 81 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$16.99/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period. You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Instagram Profile Scraper 📸

Extract comprehensive Instagram profile data including posts, bio information, verification status and more. This Apify Actor uses Playwright to navigate Instagram like a real user and captures detailed profile information.

#### 🌟 Key Features

- **Multi-Profile Scraping**: Scrape data from multiple Instagram profiles in a single run
- **Comprehensive Data Extraction**: Collect detailed profile information including bio links, engagement metrics, and post data
- **Built-in Retry Logic**: Robust navigation with configurable retry attempts and timeouts
- **Proxy Support**: Full integration with Apify's proxy service for anonymous scraping
- **Fast and Reliable**: Optimized for speed and resilience against Instagram's anti-bot measures
- **Structured Output**: Type-safe data models with Schema validation

#### 📊 Data Fields Collected

**Profile Information:**

- Username and Full Name
- Biography and Bio Links (with structured link data)
- Profile Picture URL
- Follower Count and Following Count
- Verification Status
- Account Type (Business/Personal/Professional)
- External URLs
- Business Information (category, address)
- Privacy Settings

**Post Data:**

- Post Content and Captions
- Like and Comment Counts
- Post Type (Image/Video/Carousel)
- Hashtags Extraction
- Posted Date/Time
- Media URLs (Image/Video)
- Pinned Status

#### 💡 Use Cases

- **Influencer Marketing Research**: Analyze potential brand partners and their audience engagement
- **Competitive Analysis**: Monitor competitors' content strategy and performance
- **Social Media Monitoring**: Track brand mentions and industry trends
- **Market Research**: Understand audience behavior and content preferences
- **Content Strategy Planning**: Identify successful content patterns and hashtag strategies
- **Lead Generation**: Extract contact information and business details
- **Academic Research**: Study social media behavior and trends

### 🛠 Input Configuration

Customize your scraping job with these input parameters:

#### Required Parameters

- **`usernames`** (Array): List of Instagram usernames to scrape (without @ symbol)

#### Optional Parameters

- **`retriesPerUsername`** (Integer, default: 1): Number of retry attempts for navigation failures per username (0-10)
- **`timeoutPerUsername`** (Integer, default: 60): Navigation timeout in seconds for each username attempt (10-300)
- **`proxyConfiguration`** (Object): Proxy configuration for anonymous scraping using Apify's proxy service (US residential proxies recommended)

#### Input Example

```json
{
    "usernames": [
        "worldstar",
        "rottentomatoes",
        "natgeo"
    ],
    "retriesPerUsername": 2,
    "timeoutPerUsername": 90,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "countryCode": "US"
    }
}
```

### 📤 Output Format

The results are saved to a dataset and can be exported in multiple formats (JSON, CSV, Excel, etc.). Each profile returns a structured object with the following schema:

#### Sample Output

```json
{
    "username": "notjustok",
    "full_name": "Notjustok.com",
    "biography": "#1 #Afrobeats community in the world\n📧 advertising@notjustok.com for promo\n#music #afrobeats \n🌐 @notjustokmusic_ @notjustok_sports @notjustokdistro",
    "followers": 2245622,
    "following": 206,
    "external_url": "https://linkin.bio/notjustok",
    "bio_links": [
        {
            "title": "Link in Bio",
            "url": "https://linkin.bio/notjustok",
            "lynx_url": "https://l.instagram.com/?u=https%3A%2F%2Flinkin.bio%2Fnotjustok",
            "link_type": "external"
        }
    ],
    "fbid": "17841401654749128",
    "business_address": null,
    "business_category_name": "Media/News Company",
    "category_name": "Reel creator",
    "highlights_count": 8,
    "id": "584247158",
    "is_business_account": true,
    "is_joined_recently": false,
    "is_private": false,
    "is_professional_account": true,
    "is_verified": true,
    "recent_posts": [
        {
            "caption": "Iyanya shares a hilarious story about his hit song \"Kukere\" and the comments he got when he played it for some girls before release 😭🤣\n\nFull video of our #NotJustVerses episode with @Iyanya out now on YouTube in link in bio!",
            "comments": 7,
            "content_type": "GraphVideo",
            "posted_at": "2025-08-09T16:20:27.000Z",
            "id": "3695475974552604971",
            "image_url": "https://instagram.fszf2-2.fna.fbcdn.net/v/t51.2885-15/529186808_18518859763055159_6989535520873524600_n.jpg",
            "is_pinned": true,
            "likes": 706,
            "post_hashtags": [
                "NotJustVerses",
                "iyanya", 
                "afrobeats",
                "music",
                "tiktok",
                "dance",
                "funnyvideos",
                "dancer",
                "reels",
                "funny",
                "notjustok"
            ],
            "url": "https://www.instagram.com/p/DNI99HDMtEr",
            "video_url": "https://instagram.fszf2-1.fna.fbcdn.net/o1/v/t2/f2/m86/AQP1O65tFuHHSemH1OQyIY_93we28q4YoHU4_x7kTR5OSh4PdR7YEO6jKSAtpSbSi0VNDqSrGpKa-HgrVYpOEohUIVt1_zv8dHZzm_Q.mp4"
        },
        {
            "caption": "#NewMusicFriday 🎶🔥\nWhich song is kicking off your weekend vibes? 🎧✨\n\nDon't miss out—follow our Spotify playlist now! Link in bio.",
            "comments": 7,
            "content_type": "GraphSidecar",
            "posted_at": "2025-08-08T09:36:18.000Z",
            "id": "3694559025996095625",
            "image_url": "https://instagram.fszf2-2.fna.fbcdn.net/v/t51.2885-15/528683901_18518605810055159_7136402606915958420_n.jpg",
            "is_pinned": true,
            "likes": 814,
            "post_hashtags": [
                "NewMusicFriday",
                "fola",
                "amaarae",
                "victony",
                "wurld",
                "afrobeats",
                "music",
                "Notjustok"
            ],
            "url": "https://www.instagram.com/p/DNFtdwKNeCJ",
            "video_url": null
        }
    ],
    "timestamp": "2025-01-23T10:30:00.000Z",
    "url": "https://www.instagram.com/notjustok/"
}
```

#### Fallback Output (When Scraping Fails)

When the actor encounters issues (private profile, network errors, etc.), it returns a fallback structure with minimal data:

```json
{
    "username": "private_user_123",
    "url": "https://www.instagram.com/private_user_123/",
    "error": "Could not fetch profile"
}
```

**Note**: Fallback data ensures consistent output structure even when scraping fails, making it easier to process results programmatically.

### 🔧 Technical Features

#### Robust Error Handling

- Automatic retry logic for failed requests
- Graceful handling of private/unavailable profiles
- Comprehensive logging for debugging
- Fallback data when full extraction fails

### 📋 Requirements

- Valid Apify account with sufficient compute units
- **Minimum 1GB RAM**: Required for stable browser operation and data processing
- **US Residential Proxies Recommended**: Use US-based residential proxy configuration for best results and to avoid detection
- Optional: Proxy subscription for enhanced anonymity and higher success rates

### 🆘 Troubleshooting

**Profile Not Found**: Ensure usernames are correct and profiles are public
**Navigation Timeouts**: Increase `timeoutPerUsername` for slow connections
**Rate Limiting**: Enable proxy configuration and reduce batch sizes
**Empty Results**: Check if profiles are private or temporarily unavailable

***

**Get started with Instagram Profile Scraper today and unlock valuable insights from Instagram profiles!** 🔍✨

*This actor respects Instagram's terms of service and only scrapes publicly available data.*

# Actor input Schema

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

List of usernames whose Instagram profile you want to scrape

## `retriesPerUsername` (type: `integer`):

Number of retry attempts for navigation failures per username

## `timeoutPerUsername` (type: `integer`):

Navigation timeout in seconds for each username attempt

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

Proxy configuration for the actor

## Actor input object example

```json
{
  "usernames": [
    "worldstar",
    "rottentomatoes"
  ],
  "retriesPerUsername": 1,
  "timeoutPerUsername": 60,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

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

// Run the Actor and wait for it to finish
const run = await client.actor("lisenser/ig-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": [
        "worldstar",
        "rottentomatoes",
    ],
    "proxyConfiguration": { "useApifyProxy": True },
}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lisenser/ig-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/CEImYguDXL3YkgBKs/builds/lgGbD3cbT9VfyBC39/openapi.json
