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

Smoke build.

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

## Pricing

from $2.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.

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

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

Turn a list of Instagram usernames or profile links into clean profile rows. Every profile becomes one row with its full name, bio, follower count, following count, number of posts, verified badge, business category, website and bio links, profile picture and the 12 latest posts with their links, captions and, where Instagram shows them, publish time, likes, comments and views.

Use it to vet influencers before a campaign, track follower growth for your own brand and your competitors, enrich a lead list with bios and website links, or build a list of accounts in a niche. Only public profile information is collected and no Instagram account is needed.

### Quick Start

```json
{
  "usernames": [
    "natgeo",
    "nike",
    "https://www.instagram.com/nasa/"
  ],
  "maxItems": 100,
  "includeLatestPosts": true,
  "completeProfiles": true
}
```

Usernames can be written as `natgeo`, `@natgeo` or as a profile link such as `https://www.instagram.com/natgeo/`. Links copied from the app with extra parameters (`?hl=en`, `?igsh=...`) work too.

### Input

| Input | Type | Default | Meaning |
| --- | --- | --- | --- |
| `usernames` | array | required | Instagram usernames or profile links. Duplicates are removed. |
| `maxItems` | integer | `100` | Total cap on profile rows for the run (up to 5,000). |
| `includeLatestPosts` | boolean | `true` | Add the profile's latest posts (up to 12) to each row. Turn it off for smaller rows when you only need the profile figures. |
| `completeProfiles` | boolean | `true` | When a profile's details are slow to load, make one extra attempt to fill in the bio, following count and links before returning a partial row. |

### What it returns

The dataset contains one row per profile:

| Field | Meaning |
| --- | --- |
| `username`, `url`, `userId` | The username (lower case), the profile link and Instagram's numeric account id. |
| `inputUrl` | What you supplied. |
| `fullName`, `biography` | The display name and the bio text. |
| `followersCount`, `followsCount`, `postsCount` | Followers, accounts followed and the total number of posts. |
| `isVerified`, `isPrivate` | Verified badge and private-account flag. Private accounts return their profile figures but no posts. |
| `isBusinessAccount`, `businessCategory` | Whether it is a business or creator account and the category shown on the profile (for example `Government Agencies` or `Sportswear Store`). |
| `businessEmail`, `businessPhone` | Public contact details, when the account shows them. |
| `externalUrl`, `externalUrls` | The main website link and every bio link with its title. |
| `profilePicUrl` | Profile picture link. |
| `latestPosts` | Up to 12 latest posts: `shortCode`, `url`, `type` (`image`, `video` or `carousel`), `caption`, `takenAt`, `likesCount`, `commentsCount`, `videoViewCount`, `displayUrl` and `ownerUsername` (differs from the profile for collaboration posts). |
| `missingFields` | Profile fields Instagram did not show for this profile during the run. Empty for a complete row. |
| `scrapedAt` | Collection time (UTC, ISO 8601). |
| `error` | Always `null` in the dataset. Failures are reported in the run summary instead. |

Fields the profile leaves empty (no bio, no website) are `null` or an empty list, never guessed. A field that is `null` because Instagram did not show it is also named in `missingFields`, so you can tell the two apart.

The run summary (`OUTPUT`) reports `profilesRequested`, `profiles` (rows delivered), `partialProfiles` (rows with a non-empty `missingFields`), `errors` and the list at `profileErrors`.

### Example queries

- **Influencer vetting:** paste the creators you are considering and compare `followersCount`, `postsCount` and the likes and comments on their latest posts.
- **Competitor watch:** schedule a daily run over your brand and your competitors and chart `followersCount` over time.
- **Lead enrichment:** add bios, categories and website links to a list of business accounts, then export to CSV or Excel.
- **Quick profile figures:** set `includeLatestPosts` to `false` when you only need follower and post counts for a long list.

### Output example

```json
{
  "username": "nasa",
  "url": "https://www.instagram.com/nasa/",
  "inputUrl": "https://www.instagram.com/nasa/",
  "userId": "528817151",
  "fullName": "NASA",
  "biography": "Making the seemingly impossible, possible. ✨",
  "followersCount": 104380790,
  "followsCount": 90,
  "postsCount": 4968,
  "isVerified": true,
  "isPrivate": false,
  "isBusinessAccount": true,
  "businessCategory": "Government Agencies",
  "externalUrl": "https://www.nasa.gov/",
  "externalUrls": [
    {
      "title": "NASA.gov Homepage",
      "url": "https://www.nasa.gov"
    },
    {
      "title": "How to Watch NASA Livestreams",
      "url": "http://nasa.gov/ways-to-watch"
    }
  ],
  "businessEmail": null,
  "businessPhone": null,
  "profilePicUrl": "https://scontent-dfw5-1.cdninstagram.com/v/t51.2885-19/29090066_159271188110124_1152068159029641216_n.jpg",
  "latestPosts": [
    {
      "shortCode": "DeTUk4sDSp-",
      "url": "https://www.instagram.com/p/DeTUk4sDSp-/",
      "type": "video",
      "caption": "POV: you're watching the Earth set\n\nWe just released hundreds of new images and hours of new audio from our Artemis II m…",
      "takenAt": "2026-10-10T15:15:02Z",
      "likesCount": 712273,
      "commentsCount": 7097,
      "videoViewCount": 3089092,
      "displayUrl": "https://scontent-dfw5-2.cdninstagram.com/v/t51.82787-15/842191580_18656578867049152_4200499629839780998_n.jpg",
      "ownerUsername": "nasa"
    }
  ],
  "missingFields": [],
  "scrapedAt": "2026-10-19T23:53:20Z",
  "error": null
}
```

### Failed profiles

A profile that cannot be retrieved (for example a mistyped, renamed, deleted or deactivated username, an account Instagram hides from signed-out visitors, or an age-restricted account) is reported in the run summary at `OUTPUT.profileErrors` with its input, username, `code` and `message`. Failed profiles are never dataset rows and are not charged. If no profile at all could be collected, the run ends with an error instead of finishing green with an empty dataset.

### Limits and caveats

- Only what Instagram shows publicly on a profile is returned. Followers lists, stories, highlights and comments are not included.
- `latestPosts` holds up to the 12 latest posts; older posts are not collected. For some profiles only the 6 latest posts carry likes and publish time.
- Instagram does not always show every detail. The business category, account type and contact details are often unavailable, especially in larger runs; when that happens they are listed in `missingFields`. Follower, following and post counts, bio and links are still returned.
- Counts are exact numbers as Instagram reports them at collection time.
- Instagram shows a small share of existing accounts to signed-out visitors as if they did not exist. Those come back as `NOT_FOUND` in `OUTPUT.profileErrors` and are not charged.
- Automated access is subject to Instagram's terms; use this actor only where you have the necessary permissions and a lawful basis, and handle any personal data in line with the privacy laws that apply to you.

### FAQ

**Do I need an Instagram account or cookies?** No. Only public profiles are read.

**What happens with private accounts?** You get the profile figures (name, bio, counts, verified badge), but no posts, as Instagram shows them to anyone.

**Can I mix usernames and links?** Yes. Usernames, `@` handles and profile links can all go in `usernames`; duplicates are returned once.

**How fast is it?** About 5 seconds per profile; 1,000 profiles take roughly 1 to 1.5 hours. The default run timeout is 4 hours, enough for about 2,500 profiles; raise it in the run options for longer lists.

### Price

**$0.0025 per profile** delivered, plus **$0.005 per run start**. The run-start event is charged per GB of memory; the default 512 MB run is one start event. The start is charged even if the run saves no results. Failed profiles are not charged. Platform usage is included in these prices.

# Actor input Schema

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

Instagram usernames (natgeo or @natgeo) or profile links (https://www.instagram.com/natgeo/). Duplicates are removed.

## `maxItems` (type: `integer`):

Total cap on profile rows for the run.

## `includeLatestPosts` (type: `boolean`):

Add the profile's latest posts (up to 12) to each row: link, type, caption and, where Instagram shows them, publish time, likes, comments and views.

## `completeProfiles` (type: `boolean`):

When a profile's details are slow to load, make one extra attempt to fill in the bio, following count and links before returning a partial row. Fields that still could not be collected are listed in missingFields.

## Actor input object example

```json
{
  "usernames": [
    "natgeo",
    "nike",
    "https://www.instagram.com/nasa/"
  ],
  "maxItems": 100,
  "includeLatestPosts": true,
  "completeProfiles": true
}
```

# Actor output Schema

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

No description

## `summary` (type: `string`):

No description

# 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": [
        "natgeo",
        "nike",
        "https://www.instagram.com/nasa/"
    ],
    "maxItems": 100,
    "includeLatestPosts": true,
    "completeProfiles": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("barefoot_grade/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": [
        "natgeo",
        "nike",
        "https://www.instagram.com/nasa/",
    ],
    "maxItems": 100,
    "includeLatestPosts": True,
    "completeProfiles": True,
}

# Run the Actor and wait for it to finish
run = client.actor("barefoot_grade/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": [
    "natgeo",
    "nike",
    "https://www.instagram.com/nasa/"
  ],
  "maxItems": 100,
  "includeLatestPosts": true,
  "completeProfiles": true
}' |
apify call barefoot_grade/instagram-profile-scraper --silent --output-dataset

```

## MCP server setup

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