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

Scrape public Instagram profile data by username, including follower counts, bio, profile picture, business details, and recent posts.

- **URL**: https://apify.com/cscrape/instagram-profile-scraper.md
- **Developed by:** [CScrape](https://apify.com/cscrape) (community)
- **Categories:** Social media, Automation
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.10 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 public Instagram profile information by providing a list of usernames. The Actor returns structured profile data, follower statistics, bio details, profile pictures, business fields, and recent post metadata.

### What it can extract

- Username and Instagram profile ID
- Full name and biography
- Follower, following, and post counts
- Profile picture URL and HD profile picture URL
- Verification, privacy, business, and professional account flags
- External profile URL
- Business category and business address data when available
- Highlight reel count and channel availability
- Recent posts with captions, hashtags, likes, comments, media type, dimensions, owner data, location name, and post URL

### Input

Provide an array of Instagram usernames:

```json
{
  "usernames": ["instagram", "natgeo"]
}
````

Usernames can be provided with or without the @ prefix.

### Output

The Actor stores results in the default dataset. Each dataset item represents one requested Instagram profile.

If a profile cannot be fetched, the Actor returns a dataset item with the requested username and an error message instead of stopping the whole run.

#### Example output

This is a real output item produced for the `instagram` profile. The `latestPosts` array is shortened to one post for readability.

```json
{
  "username": "instagram",
  "id": "25025320",
  "fbid": "17841400039600391",
  "fullName": "Instagram",
  "biography": "Discover what's new on Instagram 🔎✨",
  "biographyWithEntities": {
    "raw_text": "Discover what's new on Instagram 🔎✨",
    "entities": []
  },
  "externalUrl": "http://help.instagram.com/",
  "profilePicUrlHd": "https://instagram.fbkk14-1.fna.fbcdn.net/v/t51.82787-19/550891366_18667771684001321_1383210656577177067_n.jpg?stp=dst-jpg_s320x320_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMxIn0&_nc_ht=instagram.fbkk14-1.fna.fbcdn.net&_nc_cat=1&_nc_oc=Q6cZ2gEY5B75F4geFAyGxDBwJJh2jE-6_XHITKmG_k02dsbOm17HhTj6HqAzDF-RlJKffF8&_nc_ohc=zQKhYsAesT4Q7kNvwF05OyZ&_nc_gid=NyKSbiH6GMRhPlNUtUF8fg&edm=AOQ1c0wBAAAA&ccb=7-5&oh=00_Af3yBy7Bv6E2Ul32Rh6YuqmTiBjPrgVcr59gcWjam-FFeA&oe=69F66267&_nc_sid=8b3546",
  "businessCategoryName": null,
  "businessAddressJson": null,
  "hasChannel": false,
  "highlightReelCount": 15,
  "isJoinedRecently": false,
  "followersCount": 700838408,
  "followsCount": 251,
  "postsCount": 8417,
  "isPrivate": false,
  "isVerified": true,
  "isBusinessAccount": false,
  "isProfessionalAccount": true,
  "profilePicUrl": "https://instagram.fbkk14-1.fna.fbcdn.net/v/t51.82787-19/550891366_18667771684001321_1383210656577177067_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMxIn0&_nc_ht=instagram.fbkk14-1.fna.fbcdn.net&_nc_cat=1&_nc_oc=Q6cZ2gEY5B75F4geFAyGxDBwJJh2jE-6_XHITKmG_k02dsbOm17HhTj6HqAzDF-RlJKffF8&_nc_ohc=zQKhYsAesT4Q7kNvwF05OyZ&_nc_gid=NyKSbiH6GMRhPlNUtUF8fg&edm=AOQ1c0wBAAAA&ccb=7-5&oh=00_Af1uPJ-yXT9IWxqHq-ky7UETwtpfuO74EQgqVBXVzqcdpg&oe=69F66267&_nc_sid=8b3546",
  "latestPosts": [
    {
      "id": "3884653766514873681",
      "shortCode": "DXpEATUgJVR",
      "caption": "shredding in Peruvian sand ⛷️⁣\n⁣\n#InTheMoment⁣\n ⁣\nVideo by @mahuuuuuski ⁣\nMusic by @djsnake",
      "hashtags": [
        "InTheMoment"
      ],
      "likesCount": 549959,
      "commentsCount": 5454,
      "takenAtTimestamp": 1777306869,
      "isVideo": true,
      "mediaType": "GraphVideo",
      "productType": "clips",
      "dimensionsHeight": 1136,
      "dimensionsWidth": 640,
      "ownerUsername": "instagram",
      "ownerId": "25025320",
      "locationName": null,
      "displayUrl": "https://instagram.fbkk14-1.fna.fbcdn.net/v/t51.82787-15/673880953_18749023180001321_5372971300361207612_n.jpg?stp=dst-jpg_e15_tt6&_nc_ht=instagram.fbkk14-1.fna.fbcdn.net&_nc_cat=1&_nc_oc=Q6cZ2gEY5B75F4geFAyGxDBwJJh2jE-6_XHITKmG_k02dsbOm17HhTj6HqAzDF-RlJKffF8&_nc_ohc=I5ti_-CtC08Q7kNvwG_BFdE&_nc_gid=NyKSbiH6GMRhPlNUtUF8fg&edm=AOQ1c0wBAAAA&ccb=7-5&oh=00_Af37WlZ4OrBjaB2th17DO3znIOVZfMk8LJ6nqyR8yjE29w&oe=69F670D8&_nc_sid=8b3546",
      "thumbnailSrc": "https://instagram.fbkk14-1.fna.fbcdn.net/v/t51.82787-15/673880953_18749023180001321_5372971300361207612_n.jpg?stp=c0.248.640.640a_dst-jpg_e15_tt6&_nc_ht=instagram.fbkk14-1.fna.fbcdn.net&_nc_cat=1&_nc_oc=Q6cZ2gEY5B75F4geFAyGxDBwJJh2jE-6_XHITKmG_k02dsbOm17HhTj6HqAzDF-RlJKffF8&_nc_ohc=I5ti_-CtC08Q7kNvwG_BFdE&_nc_gid=NyKSbiH6GMRhPlNUtUF8fg&edm=AOQ1c0wBAAAA&ccb=7-5&oh=00_Af1QrjB7677RfVac5qU2n_IQc6zPyKJFYXRmZTKY0lJ2Dw&oe=69F670D8&_nc_sid=8b3546",
      "postUrl": "https://www.instagram.com/p/DXpEATUgJVR/"
    }
  ]
}
```

#### Profile fields

| Field | Description |
| --- | --- |
| `username` | Instagram username that was requested or returned by Instagram. |
| `id` | Instagram internal numeric user ID. |
| `fbid` | Facebook-linked identifier returned by Instagram when available. |
| `fullName` | Public display name of the profile. |
| `biography` | Profile bio text. |
| `biographyWithEntities` | Structured biography payload with raw text and detected entities. |
| `externalUrl` | External link from the profile bio. |
| `profilePicUrl` | Standard profile picture URL. |
| `profilePicUrlHd` | High-resolution profile picture URL. |
| `followersCount` | Number of followers. |
| `followsCount` | Number of accounts followed by the profile. |
| `postsCount` | Number of timeline posts. |
| `isPrivate` | Whether the profile is private. |
| `isVerified` | Whether the profile is verified. |
| `isBusinessAccount` | Whether the profile is a business account. |
| `isProfessionalAccount` | Whether the profile is a professional account. |
| `businessCategoryName` | Business category name when available. |
| `businessAddressJson` | Structured business address data returned by Instagram. |
| `hasChannel` | Whether the profile has a broadcast channel. |
| `highlightReelCount` | Number of story highlights on the profile. |
| `isJoinedRecently` | Whether Instagram flags the account as recently joined. |
| `latestPosts` | Array of recent posts returned from the public profile endpoint. |
| `error` | Short error message if the profile could not be fetched. |
| `errorMessage` | Detailed error information for debugging. |

#### Post fields

Each item in `latestPosts` can contain the following fields:

| Field | Description |
| --- | --- |
| `id` | Instagram post ID. |
| `shortCode` | Instagram shortcode used in the post URL. |
| `caption` | Post caption text. |
| `hashtags` | Hashtags parsed from the caption. |
| `likesCount` | Number of likes returned by Instagram. |
| `commentsCount` | Number of comments returned by Instagram. |
| `takenAtTimestamp` | Unix timestamp when the post was created. |
| `isVideo` | Whether the post is a video. |
| `mediaType` | Instagram media typename, for example `GraphImage`, `GraphVideo`, or `GraphSidecar`. |
| `productType` | Instagram product type when available. |
| `dimensionsHeight` | Media height in pixels. |
| `dimensionsWidth` | Media width in pixels. |
| `ownerUsername` | Username of the post owner. |
| `ownerId` | Instagram user ID of the post owner. |
| `locationName` | Location name attached to the post when available. |
| `displayUrl` | Main media display URL. |
| `thumbnailSrc` | Thumbnail image URL. |
| `postUrl` | Public Instagram post URL. |

### Notes

This Actor works with publicly available Instagram profile data. Some fields may be missing depending on the profile type, privacy settings, Instagram availability, or temporary access limits.

# Actor input Schema

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

Instagram usernames to scrape. You can provide them with or without the @ prefix.

## Actor input object example

```json
{
  "usernames": [
    "instagram",
    "natgeo"
  ]
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset items produced by the Actor.

# 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": [
        "instagram",
        "natgeo"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("cscrape/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": [
        "instagram",
        "natgeo",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("cscrape/instagram-profile-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    "instagram",
    "natgeo"
  ]
}' |
apify call cscrape/instagram-profile-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=cscrape/instagram-profile-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Instagram Profile Scraper",
        "description": "Scrape public Instagram profile data by username, including follower counts, bio, profile picture, business details, and recent posts.",
        "version": "0.0",
        "x-build-id": "6Yn3SIazdww5245et"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/cscrape~instagram-profile-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-cscrape-instagram-profile-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/cscrape~instagram-profile-scraper/runs": {
            "post": {
                "operationId": "runs-sync-cscrape-instagram-profile-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/cscrape~instagram-profile-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-cscrape-instagram-profile-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "usernames"
                ],
                "properties": {
                    "usernames": {
                        "title": "Usernames",
                        "type": "array",
                        "description": "Instagram usernames to scrape. You can provide them with or without the @ prefix.",
                        "items": {
                            "type": "string"
                        },
                        "default": [
                            "instagram",
                            "natgeo"
                        ]
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
