# Instagram Public Profile Intelligence API (`soilair/instagram-public-profile-intelligence-api`) Actor

Resolve public Instagram profiles into stable IDs, follower/following counts, profile metadata, and recent posts without requiring Instagram login credentials.

- **URL**: https://apify.com/soilair/instagram-public-profile-intelligence-api.md
- **Developed by:** [Salih Can Kurnaz](https://apify.com/soilair) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 1,000 profile 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?

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 Public Profile Intelligence API

Resolve public Instagram profiles into structured data for analytics, monitoring, research, enrichment, and automation.

The Actor accepts Instagram usernames, `@handles`, or profile URLs and returns one normalized Dataset row per successfully resolved unique public profile.

### What it returns

For each resolved profile, the Actor returns a stable Instagram user ID, normalized username, profile URL, follower and following counts, recent public posts, and available public profile metadata.

Core fields are:

- `instagramUserId`
- `username`
- `profileUrl`
- `followersCount`
- `followingCount`
- `recentPosts`
- `fetchedAt`

Additional metadata is returned when Instagram exposes it:

- full name
- biography
- verification and privacy flags
- business-account flag
- category
- external URL
- profile image URL
- total post count

`postsCount` is optional. It can be `null` because the current resilient public profile route does not consistently expose a total media count.

### Input

```json
{
  "usernames": [
    "nasa",
    "@natgeo",
    "https://www.instagram.com/duolingo/"
  ],
  "maxRecentPosts": 5
}
```

`usernames` accepts plain usernames, `@handles`, and `instagram.com` profile URLs. Values are normalized to lowercase and duplicate profiles are removed while preserving first-seen order.

`maxRecentPosts` controls how many recent posts are returned per profile. The allowed range is 0–12 and the default is 12.

### Output

The default Dataset contains one row per successfully resolved public profile.

Each recent post can include:

- post ID and shortcode
- public post URL
- timestamp
- caption
- likes and comments
- media type
- display image URL
- video URL when available

The run `SUMMARY` record reports normalized inputs, resolution counts, unresolved usernames, and billing information.

### Pricing

This Actor uses pay-per-event pricing.

- **Profile result:** $0.00070 per delivered profile result, equivalent to **$0.70 per 1,000 delivered profiles**
- **Actor start:** $0.00005 per run

A profile-result event is charged only for a successfully resolved row delivered to the Dataset.

You can set `maxTotalChargeUsd` when starting a run to cap pay-per-event spending. The Actor uses Apify's budget-aware charging path and stops producing charged profile results when the remaining run budget is insufficient for another result.

### Coverage and data notes

This Actor works with public Instagram profile surfaces. It does not require you to provide Instagram login credentials.

Instagram can change public web responses, field availability, or access behavior at any time. A successfully resolved profile is therefore a bounded observation of currently accessible public data, not a guarantee that every public profile or every historical post can always be retrieved.

The Actor does not claim complete coverage of Instagram, does not claim access to private profiles, and does not claim that optional metadata will always be available.

Recent-post output reflects the recent public items exposed by the currently working public route at fetch time. It is not a guarantee of complete profile history.

### Example output

```json
{
  "inputUsername": "nasa",
  "instagramUserId": "528817151",
  "username": "nasa",
  "profileUrl": "https://www.instagram.com/nasa/",
  "fullName": "NASA",
  "followersCount": 97000000,
  "followingCount": 80,
  "postsCount": null,
  "postsCountAvailable": false,
  "isVerified": true,
  "isPrivate": false,
  "recentPostsReturned": 5,
  "recentPosts": [
    {
      "shortcode": "EXAMPLE",
      "postUrl": "https://www.instagram.com/p/EXAMPLE/"
    }
  ]
}
```

Values above are illustrative; live counts and posts change over time.

### API usage

You can run the Actor from Apify Console, the Apify API, schedules, integrations, or supported agent workflows. The Dataset can be exported in JSON, CSV, Excel, XML, and other formats supported by Apify.

### Responsible use

Use the Actor only for data you are permitted to collect and process. Respect applicable laws, contractual obligations, privacy requirements, and the rules of the services where you use the resulting data.

# Actor input Schema

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

Instagram usernames, @handles, or profile URLs. Duplicates are normalized and removed while preserving first-seen order.

## `maxRecentPosts` (type: `integer`):

Maximum number of recent posts returned for each resolved public profile.

## Actor input object example

```json
{
  "usernames": [
    "nasa",
    "natgeo"
  ],
  "maxRecentPosts": 12
}
```

# Actor output Schema

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

Input normalization, resolution counts, field coverage, and unresolved profiles.

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

Resolved Instagram public profiles.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("soilair/instagram-public-profile-intelligence-api").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("soilair/instagram-public-profile-intelligence-api").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 '{}' |
apify call soilair/instagram-public-profile-intelligence-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,soilair/instagram-public-profile-intelligence-api"
        }
    }
}
```

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/NXzGsrhHbdZec926S/builds/AlxVU7EravaxfC7mB/openapi.json
