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

Five ways to read a public Instagram profile: by username, by numeric ID, an extended app-shape record with follower/following counts, a username-to-ID resolver, and former-usernames history. Pick the mode, no Instagram login or cookies required.

- **URL**: https://apify.com/toolzerhub/instagram-profile-scraper.md
- **Developed by:** [ToolzerHub](https://apify.com/toolzerhub) (community)
- **Categories:** Social media, Lead generation, Automation
- **Stats:** 3 total users, 1 monthly users, 70.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $8.50 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## 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

Look up public Instagram accounts by username or by numeric ID and get a structured row back for each one — display name, verified badge, private flag, follower and following counts, and the usernames the account used before. No Instagram login or cookies.

Pass a list and you get a row per account. Every row carries **source\_identifier**, the username or ID it was fetched for, so a run over 200 accounts stays sortable.

### Pick a mode

| Mode | Give it | Use it for |
|---|---|---|
| Get profile by username | **usernames** | The normal lookup. Also the fastest way to get an account's numeric ID. |
| Get profile by user ID | **userIds** | You already have the numeric ID and the handle may have changed. |
| Extended profile | **usernamesOrIds** | Adds **follower\_count** and **following\_count** as their own fields. |
| Username by ID | **userIds** | Resolving old IDs back to current handles, in bulk. |
| Former usernames | **usernamesOrIds** | Every previous handle, each with the date it changed. |

Usernames go in without the @.

### Output

| Field | What it is |
|---|---|
| `source_identifier` | The username or ID this row was fetched for |
| `pk` | Instagram's internal numeric ID, as a string |
| `username` | Handle, without the @ |
| `full_name` | Display name |
| `is_private` | Whether the account is private |
| `is_verified` | Whether it carries the verified badge |
| `follower_count` | Followers — on Extended profile |
| `following_count` | Following — on Extended profile |
| `former_usernames` | Previous handles with change dates; empty if never renamed |

### Questions

**Do private accounts work?**
Yes, for the profile itself. A private account returns its row with `is_private: true` — name, badge, counts and former usernames are all public metadata. What you can't get is its posts or its follower list; those modes return nothing for a private account.

**One username was wrong. Does the whole run fail?**
No. An identifier Instagram has no record for produces no row at all, rather than a blank one, and the run carries on to the next. Compare the rows you got back against the list you sent — a missing `source_identifier` is the answer.

**Which mode gives me the numeric user ID?**
Get profile by username. The `pk` field is that ID. You need it for the Posts & Reels Actor, which takes numeric IDs only.

**Why does follower\_count sometimes not appear?**
Only Extended profile returns it as its own field. The plain username and ID modes report the same number as `edge_followed_by` instead — same figure, different name, because that is how Instagram hands it over on those two endpoints.

**Former usernames came back empty. Is that a failure?**
No. It means the account has never been renamed. Instagram only records a change when one happens.

### The rest of the family

Need what an account posted? [Instagram Posts, Reels & Reposts Scraper](https://apify.com/toolzerhub/instagram-posts-reels-scraper) — it takes the `pk` from here.
Need who follows them? [Instagram Followers, Following & Related Accounts Scraper](https://apify.com/toolzerhub/instagram-followers-following-scraper) — that one takes a username directly.
Want every mode in one place? [Instagram Scraper - All In One](https://apify.com/toolzerhub/instagram-all-in-one-scraper).

### Support

Questions, bugs, or feature requests: **contact@toolzerhub.com**

Browse the rest: [apify.com/toolzerhub](https://apify.com/toolzerhub)

# Actor input Schema

## `scraperType` (type: `string`):

Choose the dataset for this run, then fill in the section for that mode below.

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

One or more Instagram usernames, without the @.

## `userIds` (type: `array`):

One or more numeric Instagram user IDs. Only a numeric ID works for this mode — get one from the Profile actor's "Get profile by username" mode, which returns it for any account.

## `usernamesOrIds` (type: `array`):

One or more Instagram usernames or numeric user IDs, mixed freely — this mode accepts either.

## Actor input object example

```json
{
  "scraperType": "userInfo",
  "usernames": [
    "instagram"
  ],
  "userIds": [
    "25025320"
  ],
  "usernamesOrIds": [
    "instagram"
  ]
}
```

# Actor output Schema

## `dataset` (type: `string`):

Every record collected during this run

# 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 = {
    "scraperType": "userInfo",
    "usernames": [
        "instagram"
    ],
    "userIds": [
        "25025320"
    ],
    "usernamesOrIds": [
        "instagram"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("toolzerhub/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 = {
    "scraperType": "userInfo",
    "usernames": ["instagram"],
    "userIds": ["25025320"],
    "usernamesOrIds": ["instagram"],
}

# Run the Actor and wait for it to finish
run = client.actor("toolzerhub/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 '{
  "scraperType": "userInfo",
  "usernames": [
    "instagram"
  ],
  "userIds": [
    "25025320"
  ],
  "usernamesOrIds": [
    "instagram"
  ]
}' |
apify call toolzerhub/instagram-profile-scraper --silent --output-dataset

```

## MCP server setup

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