# Instagram Related Users Profiles Scraper. Similar Accounts AYML (`karamelo/instagram-related-users-profiles-scraper`) Actor

Discover related Instagram profiles and similar accounts from seed handles or profile URLs, chain discovery across multiple levels, and optionally enrich with follower counts, bio details, and business contact info. Also known as Suggested Accounts, AYML or "Accounts You Might Like" carousels.

- **URL**: https://apify.com/karamelo/instagram-related-users-profiles-scraper.md
- **Developed by:** [karamelo](https://apify.com/karamelo) (community)
- **Features:** Limited permissions
- **Stats:** 3 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 relateds

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?

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

### Overview

Instagram Related Users Profiles Scraper automatically discovers accounts connected or similar to any seed Instagram profile — also known as Suggested Accounts, AYML or "Accounts You Might Like" carousels. Instead of relying on manual keyword searches or broad hashtag exploration, this Actor harnesses Instagram's algorithmic suggestion graph to surface relevant creators, competitors, partner brands, and industry peers with high audience overlap.

Whether you supply a single handle, multiple profile handles, or complete profile URLs, the Actor extracts immediate suggestion sets and can follow related accounts across chained discovery depths of up to five consecutive levels. Discovered accounts can be exported as clean tabular profiles, supplemented with network connection edges for graph visualization, or enriched with complete bio details, follower counts, verified badges, and public contact information.

### Why Use This Actor?

- **Algorithmic Audience Relevance** — Discover accounts that Instagram itself considers closely related to your seed profiles, capturing organic audience clusters and niche communities that keyword searches often miss.
- **Multi-Level Chained Exploration** — Expand discovery across up to 5 consecutive depth levels with configurable branch limits per step, enabling systematic mapping of entire vertical ecosystems.
- **Configurable Worker Concurrency** — Concurrently resolves seed profiles and enriches discovered candidate accounts using configurable worker concurrency (`maxConcurrency`), maximizing throughput while adhering to sticky session proxy boundaries.
- **Flexible Profile Enrichment** — Optionally enrich discovered accounts with follower metrics, biography texts, external website links, and public business details such as business category, contact email, and phone number when available.
- **Connection Graph Export** — Generate structured network edge records (`from`, `to`, and `depth`) alongside account records to facilitate network graph visualization in tools like Gephi, Cytoscape, or Neo4j.
- **Flexible Input Normalization** — Accepts plain handles (such as `natgeo`), handles with `@` prefixes (`@natgeo`), or direct Instagram profile URLs (`https://www.instagram.com/natgeo/`).
- **Precision Filtering Controls** — Filter candidate accounts by verification status (`verifiedOnly`), privacy settings (`skipPrivate`), and minimum or maximum follower thresholds to eliminate irrelevant accounts before saving.
- **Automatic Residential Proxy with Sticky Sessions** — Employs Apify residential proxies automatically with sticky sessions that persist per runner and rotate dynamically on failures or rate limits for maximum stability.
- **Clean Structured Outputs** — Exports comprehensive JSON and CSV records directly to your default Apify dataset, ready for analysis in spreadsheets, BI dashboards, or CRM pipelines.

### Target Audiences and Practical Use Cases

#### 1. Influencer Discovery and Creator Outreach

Marketers, brand managers, and agency talent scouts frequently face the challenge of discovering relevant micro-influencers and niche content creators. By entering several known brand ambassadors or benchmark creators as seeds, the Actor maps related profiles that share an overlapping follower base. Enabling profile enrichment allows outreach teams to capture verified emails and external portfolio links for immediate outreach.

#### 2. Competitive Intelligence and Market Research

Market researchers can input key competitors to discover previously unknown market entrants, subsidiary accounts, regional partner handles, and co-marketing collaborators. Chaining discovery to depth 2 or 3 reveals how industry leaders are interlinked within the broader social ecosystem.

#### 3. Lead Generation and B2B Prospecting

Sales development representatives targeting specific verticals (such as boutique fitness studios, specialty coffee roasters, or indie beauty brands) can seed the Actor with top industry brands. Enabling full profile details extracts publicly listed business emails, telephone numbers, and categories for prospecting and qualification.

#### 4. Audience and Network Graph Analysis

Data scientists, academic researchers, and social network analysts can leverage the connection graph export option to model relationship topologies, identify influential community hubs, and analyze structural clustering within digital subcultures.

### Discovery Modes Explained

The Actor operates in two distinct exploration modes depending on the `chainDepth` parameter:

#### Flat Discovery (`chainDepth: 0`)

In flat mode, the Actor inspects only the immediate suggestions surfaced directly by the provided seed profiles (depth 1). Each seed account is processed independently, and up to `maxItem` matching accounts are collected. This mode is fast, focused, and ideal when you simply need a list of immediate peers for a known set of targets.

#### Chained Multi-Level Discovery (`chainDepth >= 1`)

In chained mode, discovery executes as a breadth-first network traversal. After retrieving the initial suggestions for each seed, the Actor enqueues newly discovered accounts and explores their subsequent suggestions at the next depth level (depth 2, depth 3, etc., up to depth 5). The parameter `maxItemPerLevel` determines how many unique suggestions are branched from each account at each step, preventing exponential runaway while allowing broad niche mapping. The `maxItem` limit acts as a global cap across all seeds and levels.

### Getting Started

#### Quick Start via Apify Console

1. Navigate to the Actor page on the Apify Store.
2. Enter one or more Instagram usernames or profile URLs into the **Username(s) or Profile URLs** field.
3. Choose your desired discovery mode by adjusting **Chain Depth** (leave at `0` for direct suggestions or set to `1` or `2` for network expansion).
4. Decide whether you want full bio and follower statistics by checking **Enrich Profiles**.
5. Click **Start** to run the scraper.
6. Once completed, review the discovered accounts in the **Dataset** tab and export them as JSON, CSV, or Excel.

#### Example 1: Direct Similar Accounts Discovery (Flat Mode)

Find up to 20 immediate suggestions for a single seed account:

```json
{
  "username": ["natgeo"],
  "chainDepth": 0,
  "maxItem": 20,
  "enrichProfile": false,
  "verifiedOnly": false,
  "skipPrivate": true
}
```

#### Example 2: Multi-Level Niche Exploration with Graph Export

Explore two levels outward from a seed account, following up to 5 suggestions per profile, and exporting network connection edges:

```json
{
  "username": ["https://www.instagram.com/nasa/"],
  "chainDepth": 2,
  "maxItemPerLevel": 5,
  "maxItem": 50,
  "enrichProfile": false,
  "exportGraph": true
}
```

#### Example 3: Lead Generation with Profile Enrichment & High Concurrency

Discover similar brand accounts and enrich each with follower counts, bio details, and public contact information using parallel worker concurrency:

```json
{
  "username": ["patagonia"],
  "chainDepth": 1,
  "maxItemPerLevel": 5,
  "maxItem": 25,
  "enrichProfile": true,
  "maxConcurrency": 10,
  "minFollowers": 10000
}
```

### Input Parameters Reference

The Actor accepts the following input parameters:

| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
| `username` | Array of strings | `["natgeo"]` | Yes | List of seed Instagram usernames, `@handles`, or profile URLs. |
| `chainDepth` | Integer | `0` | No | Depth levels to explore outward from seeds (0 for immediate suggestions, up to 5 for multi-step exploration). |
| `maxItemPerLevel` | Integer | `5` | No | Maximum number of related accounts to follow per account at each chain level (range: 1 to 20). |
| `maxItem` | Integer | `100` | No | Maximum total accounts to collect (0 for unlimited; when enrichment is active, defaults to 100). |
| `maxConcurrency` | Integer | `10` | No | Maximum number of concurrent requests for seed resolution and profile enrichment (range: 1 to 50). |
| `enrichProfile` | Boolean | `false` | No | When enabled, fetches complete profile data including follower counts, biographies, and bio links. |
| `verifiedOnly` | Boolean | `false` | No | Retains only accounts carrying the verified blue badge. |
| `skipPrivate` | Boolean | `false` | No | Excludes private accounts from the final results. |
| `minFollowers` | Integer | `0` | No | Minimum follower threshold required to retain an account. Automatically enables profile enrichment. |
| `maxFollowers` | Integer | `0` | No | Maximum follower threshold required to retain an account. Automatically enables profile enrichment. |
| `exportGraph` | Boolean | `false` | No | Emits graph edge records (`_type: 'graph_edge'`, `from`, `to`, `depth`) for connection modeling. |

### Output Data Structure

The Actor pushes records incrementally to the default Apify dataset. Two types of records may appear:

#### 1. Standard Account Discovery Record

When `enrichProfile` is disabled, the record captures core identification and discovery lineage:

```json
{
  "id": "378353537",
  "username": "animalplanet",
  "full_name": "Animal Planet",
  "is_private": false,
  "is_verified": true,
  "profile_pic_url": "https://scontent.cdninstagram.com/pic.jpg",
  "discovered_from": "natgeo",
  "depth": 1,
  "chain_path": ["natgeo"],
  "enriched": false,
  "is_business_account": null,
  "business_category_name": null,
  "business_email": null,
  "business_phone_number": null,
  "business_contact_method": null,
  "business_address_json": null,
  "is_partial": false,
  "partial_reason": null,
  "biography": null,
  "bio_links": null,
  "external_url": null,
  "followers": null,
  "following": null
}
```

#### 2. Enriched Account Record

When `enrichProfile` is enabled, full audience metrics and biography details are attached:

```json
{
  "id": "378353537",
  "username": "animalplanet",
  "full_name": "Animal Planet",
  "is_private": false,
  "is_verified": true,
  "profile_pic_url": "https://scontent.cdninstagram.com/pic.jpg",
  "discovered_from": "natgeo",
  "depth": 1,
  "chain_path": ["natgeo"],
  "enriched": true,
  "biography": "Keeping the childhood joy and wonder of animals alive.",
  "bio_links": [
    {
      "url": "http://puppybowl.com/",
      "title": "",
      "link_type": "external"
    }
  ],
  "external_url": "http://puppybowl.com/",
  "followers": {
    "count": 5389682
  },
  "following": {
    "count": 863
  },
  "is_business_account": true,
  "business_category_name": "Media/News Company",
  "business_email": "contact@animalplanet.com",
  "business_phone_number": null,
  "business_contact_method": "EMAIL",
  "business_address_json": null,
  "is_partial": false,
  "partial_reason": null
}
```

#### 3. Graph Edge Record

When `exportGraph` is set to `true`, the connection topology is emitted as individual edge rows:

```json
{
  "_type": "graph_edge",
  "from": "natgeo",
  "to": "animalplanet",
  "depth": 1
}
```

#### Dataset Fields Description

| Field Name | Type | Description |
|---|---|---|
| `username` | String | Account handle on Instagram. |
| `full_name` | String | Display name shown on the user's profile. |
| `id` | String | Numeric user identifier assigned by Instagram. |
| `is_private` | Boolean | Indicates whether the account privacy is restricted. |
| `is_verified` | Boolean | True if the account possesses the verified blue badge. |
| `profile_pic_url` | String | Direct CDN link to the profile avatar image. |
| `discovered_from` | String | Parent handle from which this account was suggested. |
| `depth` | Integer | Exploration level at which the account was uncovered. |
| `chain_path` | Array of strings | Traversal sequence of accounts leading from seed to this account. |
| `enriched` | Boolean | True if full profile details were fetched. |
| `biography` | String | Biography content published on the profile. |
| `bio_links` | Array of objects | Links listed within the profile biography. |
| `external_url` | String | Primary external website URL from the profile. |
| `followers` | Object | Object containing the total follower `count`. |
| `following` | Object | Object containing the total following `count`. |
| `is_business_account` | Boolean | True if registered as a professional business account. |
| `business_category_name` | String | Public business category selected by the account. |
| `business_email` | String | Public contact email address if published. |
| `business_phone_number` | String | Public telephone contact number if published. |
| `business_contact_method` | String | Surfaced action button type (e.g., `"EMAIL"`, `"CALL"`). |
| `business_address_json` | String | Serialized JSON containing street address and coordinates. |
| `is_partial` | Boolean | Flag indicating if certain upstream business fields were unavailable. |
| `partial_reason` | String | Diagnostic reason code for partial records. |
| `_type` | String | Present on edge records (`"graph_edge"`). |
| `from` | String | Source handle in a network edge connection. |
| `to` | String | Target handle in a network edge connection. |

### Practical Workflow Tutorials

#### Workflow 1: Building a Micro-Influencer Seed List

**Objective:** Identify 50 active, verified or high-credibility accounts similar to an established authority in your niche, filtering out inactive accounts.

1. **Seed Selection:** Identify 1 to 3 benchmark accounts representing your desired niche tone and audience.
2. **Actor Configuration:**
   - `username`: `["seed_creator_handle"]`
   - `chainDepth`: `1`
   - `maxItemPerLevel`: `10`
   - `maxItem`: `50`
   - `enrichProfile`: `true`
   - `minFollowers`: `5000`
   - `maxFollowers`: `150000`
   - `skipPrivate`: `true`
3. **Execution & Analysis:** Run the Actor. Filter the resulting dataset by `followers.count` and sort by engagement relevance. Examine `bio_links` to confirm portfolio or collaboration readiness.
4. **Outcome:** A qualified, outreach-ready spreadsheet of targeted creators with verified follower statistics.

#### Workflow 2: Exporting and Visualizing a Niche Ecosystem Graph

**Objective:** Map out the cluster relationships between 10 major brands and their overlapping peers to detect dominant central influencers.

1. **Seed Selection:** Compile a list of 5 industry competitors or brand handles.
2. **Actor Configuration:**
   - `username`: `["brand1", "brand2", "brand3", "brand4", "brand5"]`
   - `chainDepth`: `2`
   - `maxItemPerLevel`: `4`
   - `maxItem`: `150`
   - `enrichProfile`: `false`
   - `exportGraph`: `true`
3. **Graph Extraction:** Export the dataset in CSV format. Separate rows where `_type == 'graph_edge'` into an edge list file containing `from`, `to`, and `depth`.
4. **Visualization:** Import the edge list into Gephi or network visualization software. Calculate degree centrality to identify accounts that appear as mutual suggestions across multiple competitors.

### Integration with Apify API and SDKs

You can integrate this Actor into existing Node.js, Python, or command-line automation pipelines using the official Apify Client libraries.

#### Node.js Integration Example

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({
    token: process.env.APIFY_TOKEN,
});

const input = {
    username: ['natgeo'],
    chainDepth: 1,
    maxItemPerLevel: 5,
    maxItem: 20,
    enrichProfile: true,
    skipPrivate: true,
};

// Run the actor and wait for completion
const run = await client.actor('karamelo/instagram-related-users-profiles-scraper').call(input);

// Fetch resulting dataset items
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Discovered ${items.length} accounts:`);
for (const item of items) {
    if (item.username) {
        console.log(`- @${item.username}: ${item.full_name} (${item.followers?.count || 0} followers)`);
    }
}
```

#### Python Integration Example

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.getenv('APIFY_TOKEN'))

run_input = {
    'username': ['natgeo'],
    'chainDepth': 0,
    'maxItem': 25,
    'enrichProfile': False,
    'exportGraph': True,
}

run = client.actor('karamelo/instagram-related-users-profiles-scraper').call(run_input=run_input)

dataset_items = client.dataset(run['defaultDatasetId']).list_items().items
print(f"Collected {len(dataset_items)} total records.")
for record in dataset_items:
    if record.get('_type') == 'graph_edge':
        print(f"Edge: {record['from']} -> {record['to']}")
    else:
        print(f"User: @{record.get('username')} - {record.get('full_name')}")
```

#### REST API Example with cURL

```bash
curl --request POST \
  --url "https://api.apify.com/v2/acts/karamelo~instagram-related-users-profiles-scraper/runs?token=$APIFY_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "username": ["natgeo"],
    "chainDepth": 0,
    "maxItem": 15,
    "enrichProfile": false
  }'
```

### Export and Data Pipeline Integrations

The default dataset produced by this Actor can be connected to external tools:

- **Google Sheets & Excel** — Set up an Apify Google Sheets integration or use the permanent dataset CSV URL to automatically sync new results into a live spreadsheet.
- **Airtable & Notion** — Pipe discovered accounts and contact details directly into customer relationship management bases using Apify Webhooks or Make/Zapier automations.
- **Cloud Storage & Data Warehouses** — Push collected JSON payloads into AWS S3, Google Cloud Storage, or Snowflake for longitudinal community tracking and machine learning models.

### Operational Tips and Best Practices

1. **Start with Conservative Limits** — When testing chained discovery (`chainDepth >= 1`), start with a low `maxItemPerLevel` (such as 3 to 5) and a moderate `maxItem` limit (such as 25 to 50). Because chained expansion is multiplicative, higher depths can quickly traverse hundreds of accounts.
2. **Deduplication is Automatic** — Seed accounts are marked as visited before discovery begins so they are never returned as suggestions of themselves or other seeds. Accounts discovered through multiple paths are attributed to the earliest path that reached them and recorded only once.
3. **Use Follower Filters Strategically** — Remember that follower counts are only available when a profile is enriched. If you specify `minFollowers` or `maxFollowers`, profile enrichment will be automatically activated.
4. **Built-in Sticky Residential Proxy** — The Actor automatically leverages Apify US residential proxies with sticky session persistence. If an individual request encounters a temporary network issue or rate limit, the Actor rotates to a fresh residential IP session automatically, ensuring optimal uptime without requiring user proxy configuration.
5. **Batch Profiling Efficiency** — When running high-volume discovery jobs with `enrichProfile: true`, profile requests are paced with polite rate-limiting intervals to avoid sudden platform throttling and maintain consistent progress.

### Limitations and Platform Considerations

- **Algorithmic Dynamic Nature** — The suggested accounts list is curated dynamically by Instagram. Suggestions may vary over time depending on account activity, platform updates, geographic affinity, and algorithmic adjustments.
- **Private Profiles** — Suggestions for private accounts are included unless `skipPrivate` is enabled. However, private accounts do not display extended biographies, post grids, or public contact information.
- **Partial Contact Availability** — Business contact fields (`business_email`, `business_phone_number`, and `business_category_name`) appear only if the account owner has explicitly registered as an Instagram professional account and published those details publicly.
- **Maximum Depth Cap** — To maintain operational reliability and prevent infinite recursive traversals, `chainDepth` is capped at a maximum of 5.
- **No Login Required** — This Actor operates without requiring your personal Instagram credentials or cookies, preserving account security and preventing account suspension risks.

### Troubleshooting Guide

| Symptom | Probable Cause | Recommended Action |
|---|---|---|
| No accounts discovered for a seed | Seed username is misspelled or has no public suggestions available | Verify the handle on Instagram. Some newly created or inactive accounts have no suggested peers. |
| Run finishes with fewer accounts than `maxItem` | Reached the end of available unique suggestions or applied strict filters | Increase `chainDepth` to expand the search radius or relax `verifiedOnly` and follower constraints. |
| Enrichment takes longer than expected | High result count with individual profile lookups | Lower `maxItem` or disable `enrichProfile` if only handle discovery is required. |
| Business emails are null | The discovered accounts are personal profiles or have not published contact info | This is normal behavior. Only business/creator accounts with public contact buttons expose emails. |
| Invalid input error | The `username` input is empty or formatted incorrectly | Ensure at least one valid username or Instagram URL is supplied in the `username` field. |

### Responsible Scraping and Compliance

This Actor extracts only publicly accessible profile information published openly by Instagram users. It does not bypass login screens, access private direct messages, or harvest private personal data. When utilizing scraped contact information (such as business emails or telephone numbers) for sales outreach or marketing campaigns, ensure your communications comply with relevant digital privacy and messaging regulations, including the CAN-SPAM Act, the GDPR, and local commercial electronic messaging laws. Always respect individuals' communication preferences and honor unsubscribe requests promptly.

### Frequently Asked Questions (FAQ)

**What determines which accounts are surfaced as related?**
Instagram's recommendation algorithm determines related profiles based on audience overlap, content similarity, shared followers, and mutual network connections. The Actor retrieves these suggested accounts directly.

**Do I need an Instagram account or login cookies to use this Actor?**
No. The Actor does not require user accounts, passwords, session tokens, or browser cookies. It operates entirely on publicly visible web data.

**Can I scrape related accounts for multiple seeds in a single run?**
Yes. You can supply an array of usernames or profile URLs in the `username` input. In flat mode (`chainDepth: 0`), suggestions are fetched for each seed. In chained mode (`chainDepth >= 1`), the traversal queue begins with all provided seeds.

**How does concurrency work?**
The Actor processes seed account resolution and candidate profile enrichments in parallel using the `maxConcurrency` parameter (default 10, configurable up to 50). Concurrent requests share the active sticky residential proxy session, which automatically rotates if any request encounters a network challenge or rate limit.

**How does deduplication work across multi-level runs?**
The Actor keeps track of every account encountered. Seeds are marked as visited before any requests are made, preventing self-referencing loops. Discovered accounts are recorded once at the earliest depth they appear.

**What are the `graph_edge` records?**
When `exportGraph` is checked, the Actor records directional connections between accounts in addition to profile records. Each edge record contains `{ _type: 'graph_edge', from: 'parent_user', to: 'discovered_user', depth: 1 }`. This format is optimized for importing into network graph visualization tools.

**Why are follower counts missing when `enrichProfile` is off?**
Instagram's suggestion listing surfaces core identification data (username, full name, user ID, profile image, verified badge, and private status). Exact follower counts require fetching the account's individual profile, which is performed only when `enrichProfile` is enabled.

# Actor input Schema

## `username` (type: `array`):

Instagram usernames or profile URLs to discover related accounts from.

## `enrichProfile` (type: `boolean`):

Fetch complete profile details for each discovered account including bio, follower counts, and links.

## `maxItem` (type: `integer`):

Maximum number of accounts to save across the run (0 for unlimited).

## `maxConcurrency` (type: `integer`):

Maximum number of concurrent requests for profile resolution and enrichment.

## `verifiedOnly` (type: `boolean`):

Only keep verified (blue badge) accounts in output results.

## `skipPrivate` (type: `boolean`):

Exclude private accounts from output results.

## `minFollowers` (type: `integer`):

Keep only accounts with at least this many followers. Automatically enables profile enrichment.

## `maxFollowers` (type: `integer`):

Keep only accounts with at most this many followers. Automatically enables profile enrichment.

## `chainDepth` (type: `integer`):

Number of levels to follow outward from seed accounts (0 for immediate suggestions only, up to 5 for multi-step exploration).

## `maxItemPerLevel` (type: `integer`):

Maximum number of related accounts to follow per account at each chain level.

## `exportGraph` (type: `boolean`):

Push graph edge records ({ \_type: 'graph_edge', from, to, depth }) for network visualization.

## Actor input object example

```json
{
  "username": [
    "natgeo"
  ],
  "enrichProfile": false,
  "maxItem": 100,
  "maxConcurrency": 10,
  "verifiedOnly": false,
  "skipPrivate": false,
  "minFollowers": 0,
  "maxFollowers": 0,
  "chainDepth": 0,
  "maxItemPerLevel": 5,
  "exportGraph": false
}
```

# Actor output Schema

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

All discovered accounts, profile records, and graph edges collected during the 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 = {
    "username": [
        "natgeo"
    ]
};

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

# Run the Actor and wait for it to finish
run = client.actor("karamelo/instagram-related-users-profiles-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 '{
  "username": [
    "natgeo"
  ]
}' |
apify call karamelo/instagram-related-users-profiles-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,karamelo/instagram-related-users-profiles-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/2AxZoA5wOAjJbu2rS/builds/kzNgj1onB6W2BbBrb/openapi.json
