# Instagram Related Profiles Scraper (`instagram-scraper/instagram-related-profiles`) Actor

Scrape Instagram profile data, profile statistics, and recursive related-profile discovery from public Instagram pages

- **URL**: https://apify.com/instagram-scraper/instagram-related-profiles.md
- **Developed by:** [Instagram Scraper](https://apify.com/instagram-scraper) (community)
- **Categories:** Lead generation, Social media
- **Stats:** 3 total users, 2 monthly users, 95.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.60 / 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/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 Related Profiles Scraper

<img src="https://apify-stats.seadfeng-7bd.workers.dev/instagram-scraper/instagram-related-profiles" height="20" alt="Actor Stats">

A powerful scraper built for **recursive profile discovery and data mining**. Start with a single Instagram username or URL and automatically traverse "related profiles" to map out interconnected networks, discover influencers, and find niche communities.

Focused exclusively on **profiles**, this actor traverses up to your desired `scrapeDepth` and extracts comprehensive profile data—returning normalized profile fields (identity, stats, and account flags), raw metadata, and optional previews like `latest_posts` and `latest_igtv_videos` for every discovered account.

---

### What this actor can do

- Scrape Instagram **profile stats**: followers, following, number of posts
- Get key profile attributes: verified/private/business flags, profile pictures, bio, external links (if available)
- Keep additional raw profile metadata from Instagram, including viewer/account capability flags and business/category fields when available
- Optionally scrape a linked Facebook profile into `fb_profile` when `scrapeFacebookProfile` is enabled
- Return lightweight **latest posts metadata** (caption, engagement, publishing/status flags, and media fields when available) for quick previews
- Return lightweight **latest IGTV videos metadata** (same simplified shape as `latest_posts`, plus `video_duration` when available)
- Return a list of **related profiles** (useful for discovery and recursive expansion)
- Expand related profiles up to a configurable `scrapeDepth`
- Accept both **usernames** and **profile URLs**

### Want to get other details from Instagram?

This actor is optimized for **profiles** (not full post feeds). If you want to scrape other Instagram data, use a dedicated scraper for that specific data type.

Related actors:

| Actor | Description | Stats |
| :--- | :--- | :--- |
| [Instagram Profile Scraper](https://apify.com/instagram-scraper/instagram-profile-scraper) | Scrape Instagram profile data and profile statistics from public Instagram pages | <img src="https://apify-stats.seadfeng-7bd.workers.dev/instagram-scraper/instagram-profile-scraper" height="20" alt="Instagram Profile Scraper Actor Stats"> |
| [Fast Instagram Profile Posts Scraper](https://apify.com/instagram-scraper/fast-instagram-post-scraper) | Scrape post data from Instagram profile pages | <img src="https://apify-stats.seadfeng-7bd.workers.dev/instagram-scraper/fast-instagram-post-scraper" height="20" alt="Fast Instagram Profile Posts Scraper Actor Stats"> |
| [Instagram Profile Posts Scraper](https://apify.com/instagram-scraper/instagram-profile-posts-scraper) | Extract profile post details such as hashtags, counts, media, and shortcode | <img src="https://apify-stats.seadfeng-7bd.workers.dev/instagram-scraper/instagram-profile-posts-scraper" height="20" alt="Instagram Profile Posts Scraper Actor Stats"> |
| [Fast Instagram Profile Reels Scraper](https://apify.com/instagram-scraper/instagram-profile-reels-scraper) | Scrape public Instagram Reels from profile pages | <img src="https://apify-stats.seadfeng-7bd.workers.dev/instagram-scraper/instagram-profile-reels-scraper" height="20" alt="Fast Instagram Profile Reels Scraper Actor Stats"> |
| [Instagram Tagged Posts Scraper](https://apify.com/instagram-scraper/instagram-tagged-posts-scraper) | Scrape posts from the profile `Tagged` tab | <img src="https://apify-stats.seadfeng-7bd.workers.dev/instagram-scraper/instagram-tagged-posts-scraper" height="20" alt="Instagram Tagged Posts Scraper Actor Stats"> |
| [Instagram Hashtags Posts Scraper](https://apify.com/instagram-scraper/instagram-hashtags-scraper) | Scrape public Instagram hashtag pages | <img src="https://apify-stats.seadfeng-7bd.workers.dev/instagram-scraper/instagram-hashtags-scraper" height="20" alt="Instagram Hashtags Posts Scraper Actor Stats"> |

### What data can I scrape from Instagram profiles?

Using this Instagram Related Profiles API, you can extract both normalized fields and additional Instagram profile metadata
(when available on the public profile):

| Category                     | Fields                                                                                                                                                                                                                                                                                       | What you get                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Identity & IDs               | `id`, `fbid`, `eimu_id`, `username`, `full_name`                                                                                                                                                                                                                                             | Basic profile identifiers plus cross-system IDs returned by Instagram.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Profile media & links        | `profile_pic_url`, `profile_pic_url_hd`, `biography`, `contact_email`, `bio_links[]`, `external_url`, `external_url_linkshimmed`, `fb_profile_biolink`                                                                                                                                       | Profile pictures, bio text, extracted contact email, direct links, and Instagram link-wrapper URLs when present.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Facebook enrichment          | `fb_profile`                                                                                                                                                                                                                                                                                 | Optional Facebook profile lookup from one detected profile URL in `external_url`, `bio_links`, `fb_profile_biolink`, `biography`, or `full_name` when `scrapeFacebookProfile` is enabled. The nested payload includes `url`, `status`, `message`, `bio`, `profile_type`, `profile_name`, `page_id`, counts, and other status fields when available.                                                                                                                                                                                                                                                                                                                                                                       |
| Counts & activity            | `followers`, `following`, `post_count`, `igtv_video_count`, `highlight_reel_count`, `pinned_channels_list_count`                                                                                                                                                                             | High-level counts for analysis, monitoring, and profile summaries.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Category & business metadata | `category_name`, `category_enum`, `business_category_name`, `overall_category_name`, `business_contact_method`, `business_email`, `business_phone_number`, `business_address_json`                                                                                                           | Public business/category fields when Instagram exposes them.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Account flags & capabilities | `is_verified`, `is_verified_by_mv4b`, `is_private`, `is_business_account`, `is_professional_account`, `has_clips`, `has_guides`, `has_channel`, `has_ar_effects`, `has_onboarded_to_text_post_app`, `is_embeds_disabled`, `is_joined_recently`, `hide_like_and_view_counts`, `country_block` | Visibility, verification, and feature flags that describe how the account behaves on Instagram.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Viewer relationship flags    | `followed_by_viewer`, `follows_viewer`, `requested_by_viewer`, `has_requested_viewer`, `blocked_by_viewer`, `has_blocked_viewer`, `restricted_by_viewer`                                                                                                                                     | Relationship fields included in the Instagram profile payload.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Safety & transparency        | `is_supervision_enabled`, `is_guardian_of_viewer`, `is_supervised_by_viewer`, `is_supervised_user`, `is_regulated_c18`, `should_show_category`, `should_show_public_contacts`, `show_account_transparency_details`, `show_text_post_app_badge`, `transparency_label`, `transparency_product` | Additional moderation, supervision, and display metadata from Instagram.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Additional raw metadata      | `ai_agent_owner_username`, `ai_agent_type`                                                                                                                                                                                                                                                   | Extra pass-through fields when Instagram includes them.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Latest posts (preview)       | `latest_posts[]`                                                                                                                                                                                                                                                                             | Lightweight metadata for recent posts: `id`, `shortcode`, `url`, `taken_at_timestamp`, human-readable `taken_at`, `is_video`, `display_url`, `dimensions`, `caption`, `hashtags`, `mentions`, `like_count`, `comment_count`, `owner`, `tagged_user`, plus media/status fields like `video_url`, `video_view_count`, `video_duration`, `has_audio`, `clips_music_attribution_info`, `is_published`, `location`, `has_upcoming_event`, `comments_disabled`, `like_and_view_counts_disabled`, `viewer_can_reshare`, `coauthor_producers`, `pinned_for_users`, and `product_type` when available. `url` is built from the media type, using `/p/{shortcode}/` for standard posts and `/reel/{shortcode}/` for reels or clips. |
| Latest IGTV (preview)        | `latest_igtv_videos[]`                                                                                                                                                                                                                                                                       | Lightweight metadata for recent IGTV videos with the same preview fields as `latest_posts[]`, including `url`, `taken_at_timestamp`, and human-readable `taken_at`. `url` uses the reel form: `/reel/{shortcode}/`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Related profiles             | `related_profiles[]`                                                                                                                                                                                                                                                                         | Suggested/related accounts used for recursive expansion: `id`, `username`, `full_name`, `is_private`, `is_verified`, `profile_pic_url`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Traversal metadata           | `depth`, `source_username`                                                                                                                                                                                                                                                                   | `depth` is `0` for the input username and increases by one for each related-profile hop. `source_username` is `null` at the root and otherwise points to the parent username that produced the item.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Scrape metadata              | `crawled_at`, `ig_status`, `message` (not-found items)                                                                                                                                                                                                                                       | Timestamp of the scrape and a simple status indicator. `ig_status` is `ok` when profile data is returned, and `not_found` when the profile does not exist or is restricted. Not-found items also carry a `message` and canonical `url`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |

Notes:

- Field availability depends on what Instagram returns for a given profile (especially for private accounts).
- Some fields are normalized by the actor (`followers`, `following`, `post_count`), while others are passed through from Instagram's profile payload.
- Raw Instagram metadata can change over time, so downstream consumers should treat optional fields as non-guaranteed.
- `contact_email` is extracted from `biography` or `full_name` when an email address is present on a found profile, and is `null` otherwise.
- `fb_profile` is `null` when the toggle is disabled or no Facebook profile URL is found. If Facebook profile parsing still fails after retries, the actor keeps `fb_profile` as `null` instead of throwing. Other lookup failures can still surface as `fb_profile.status = "error"` or `fb_profile.status = "not_found"`. Successful `fb_profile` payloads include `bio` instead of the older `intro` name.
- To keep output small and fast, arrays like `latest_posts`, `latest_igtv_videos`, and `related_profiles` are **truncated**.
- The filter fields only decide whether a profile is written to the dataset. They do not stop related profiles from being fetched.

### Typical use cases

- Influencer discovery and enrichment (profile stats, verification, business account)
- Competitor monitoring (track follower growth over time)
- Lead enrichment for sales/marketing (public business profiles)
- Content research (quick look at latest post captions/engagement)

---

### Input

Configure these fields in the Actor’s **Input** tab in the Apify Console:

#### `instagramUsernames` (required)

A list of Instagram usernames or profile URLs you want to scrape.

Examples:

- `google`
- `https://www.instagram.com/google/`

#### `scrapeFacebookProfile` (optional)

When enabled, the actor looks for one Facebook profile URL in this order: `external_url`, `bio_links`, `fb_profile_biolink`, `biography`, then `full_name`.

The nested `fb_profile` payload includes `url`, `status`, `message`, `bio`, `profile_name`, `page_id`, `followers`, `following`, `is_business_page_active`, `category_name`, and `profile_type` when available.

#### `scrapeDepth` (optional)

Controls how many additional related-profile layers are expanded.

- `0`: store the input profile and its direct related profiles
- `1`: also expand the related profiles of those related profiles
- `10` is the maximum accepted value

#### `maxResults` (optional)

Caps the number of dataset items written by the actor.

- Minimum value: `10`
- Default: no limit
- Set a value only if you want to cap stored dataset items
- It does not stop the crawl chain; already queued related profiles still run

#### Filter fields (optional)

These fields are grouped under a `Filters` section in the Apify Console and are top-level JSON inputs.
In the console they render as `Yes` / `No` dropdowns. In raw JSON, use lowercase `yes` / `no`; leave a field empty or set it to `null` to disable that filter.

```json
{
  "minFollowers": 1000,
  "maxFollowers": 1000000,
  "minPosts": 10,
  "maxPosts": 5000,
  "isVerified": "yes",
  "isPrivate": "no",
  "isBusinessAccount": "yes"
}
````

Leave any field empty or `null` to disable that specific filter.

Profiles that are filtered out still count as processed work and may trigger the
`filtered-out` billing event after the request has been marked handled.

### Quick start (Apify Console)

1. Add one or more values to `instagramUsernames` (either usernames like `nypost` or URLs like `https://www.instagram.com/google/`).
2. Adjust `scrapeDepth`, the filter fields, or `maxResults` only if you need a deeper crawl or tighter result limits.
3. Click **Run** → open the **Dataset** tab to view/export results (JSON, CSV, Excel, etc.).

This makes the actor usable as an **Instagram profile scraping API**, because datasets can be consumed programmatically via Apify’s API.

***

### Example input

```json
{
  "instagramUsernames": ["kevinhart4real"],
  "scrapeFacebookProfile": true,
  "scrapeDepth": 1,
  "maxResults": 100,
  "isVerified": "yes",
  "isPrivate": "no"
}
```

### Example output

Example dataset item when a profile is found. This sample is abridged only for long URLs and array length,
but includes the top-level field set from a real dataset item. Arrays are intentionally **truncated** to keep outputs
small and fast (defaults: `latest_posts` ≤ `12`, `latest_igtv_videos` ≤ `12`, `related_profiles` ≤ `20`).
The nested `fb_profile` block below is illustrative and shows the enrichment shape when a Facebook lookup succeeds.

```json
{
  "id": "1067259270",
  "fbid": "17841401778116675",
  "eimu_id": "101735994563732",
  "username": "google",
  "depth": 0,
  "source_username": null,
  "full_name": "Google",
  "profile_pic_url": "https://.../610021954_..._n.jpg",
  "profile_pic_url_hd": "https://.../610021954_..._hd.jpg",
  "biography": "Here to help\npress@google.com\nfacebook.com/Google",
  "contact_email": "press@google.com",
  "bio_links": [
    {
      "title": "",
      "lynx_url": "https://l.instagram.com/?u=https%3A%2F%2Flinkin.bio%2Fgoogle...",
      "url": "https://linkin.bio/google",
      "link_type": "external"
    }
  ],
  "fb_profile_biolink": null,
  "external_url": "https://linkin.bio/google",
  "external_url_linkshimmed": "https://l.instagram.com/?u=https%3A%2F%2Flinkin.bio%2Fgoogle...",
  "fb_profile": {
    "url": "https://www.facebook.com/Google/",
    "status": "ok",
    "message": null,
    "bio": "Google",
    "profile_name": "Google",
    "page_id": "1234567890",
    "followers": 35000000,
    "following": 0,
    "is_business_page_active": true,
    "category_name": "Internet company",
    "profile_type": "Page"
  },
  "category_name": "Internet company",
  "category_enum": "INTERNET_COMPANY",
  "business_category_name": "None",
  "overall_category_name": null,
  "business_contact_method": "UNKNOWN",
  "business_email": null,
  "business_phone_number": null,
  "business_address_json": null,
  "following": 40,
  "followers": 15826557,
  "post_count": 3183,
  "igtv_video_count": 107,
  "highlight_reel_count": 0,
  "pinned_channels_list_count": 0,
  "is_verified": true,
  "is_verified_by_mv4b": false,
  "is_private": false,
  "is_business_account": true,
  "is_professional_account": true,
  "has_clips": true,
  "has_guides": false,
  "has_channel": false,
  "has_ar_effects": false,
  "has_onboarded_to_text_post_app": true,
  "is_embeds_disabled": false,
  "is_joined_recently": false,
  "hide_like_and_view_counts": false,
  "country_block": false,
  "followed_by_viewer": false,
  "follows_viewer": false,
  "requested_by_viewer": false,
  "has_requested_viewer": false,
  "blocked_by_viewer": false,
  "has_blocked_viewer": false,
  "restricted_by_viewer": null,
  "is_supervision_enabled": false,
  "is_guardian_of_viewer": false,
  "is_supervised_by_viewer": false,
  "is_supervised_user": false,
  "is_regulated_c18": false,
  "should_show_category": true,
  "should_show_public_contacts": false,
  "show_account_transparency_details": true,
  "show_text_post_app_badge": true,
  "transparency_label": null,
  "transparency_product": null,
  "ai_agent_owner_username": null,
  "ai_agent_type": null,
  "latest_posts": [
    {
      "id": "3880173376925319525",
      "shortcode": "DXZJSDWj8Fl",
      "url": "https://www.instagram.com/reel/DXZJSDWj8Fl/",
      "taken_at_timestamp": 1776772804,
      "taken_at": "2026-04-21T12:00:04Z",
      "is_video": true,
      "display_url": "https://.../670922807_..._n.jpg",
      "video_view_count": 310344,
      "video_url": "https://.../video.mp4",
      "has_audio": true,
      "clips_music_attribution_info": {
        "artist_name": "sfgate",
        "song_name": "Original audio",
        "uses_original_audio": true,
        "should_mute_audio": false,
        "should_mute_audio_reason": "",
        "audio_id": "35605659979019192"
      },
      "is_published": true,
      "location": {
        "id": "213385402",
        "name": "New York, New York"
      },
      "has_upcoming_event": false,
      "comments_disabled": false,
      "like_and_view_counts_disabled": false,
      "viewer_can_reshare": true,
      "coauthor_producers": [],
      "pinned_for_users": [],
      "product_type": "clips",
      "dimensions": {
        "height": 1920,
        "width": 1080
      },
      "caption": "Virtually trying on outfits with Google? That's actually groundbreaking. #sponsored",
      "hashtags": ["sponsored", "DevilWearsPrada2"],
      "mentions": ["20thcenturystudios"],
      "like_count": 34790,
      "comment_count": 181,
      "owner": {
        "id": "52132470720",
        "username": "shopwithgoogle"
      },
      "tagged_user": [
        {
          "full_name": "Google",
          "followed_by_viewer": false,
          "id": "1067259270",
          "is_verified": true,
          "profile_pic_url": "https://.../google.jpg",
          "username": "google"
        }
      ]
    }
  ],
  "latest_igtv_videos": [
    {
      "id": "2892596643067882496",
      "shortcode": "CgkkVI8jGwA",
      "url": "https://www.instagram.com/reel/CgkkVI8jGwA/",
      "taken_at_timestamp": 1659044430,
      "taken_at": "2022-07-28T21:40:30Z",
      "is_video": true,
      "display_url": "https://.../296019923_..._n.jpg",
      "dimensions": {
        "height": 995,
        "width": 640
      },
      "caption": "The votes are in! Congratulations to the five #DoodleForGoogle National Finalists...",
      "hashtags": ["DoodleForGoogle"],
      "mentions": [],
      "like_count": 10416,
      "comment_count": 132,
      "video_view_count": 66765,
      "video_duration": 28.733,
      "video_url": "https://.../igtv.mp4",
      "has_audio": true,
      "clips_music_attribution_info": {
        "artist_name": "amd",
        "song_name": "Original audio",
        "uses_original_audio": true,
        "should_mute_audio": false,
        "should_mute_audio_reason": "",
        "audio_id": "35013907618255255"
      },
      "is_published": true,
      "location": {
        "id": "213385402",
        "name": "New York, New York"
      },
      "has_upcoming_event": false,
      "comments_disabled": false,
      "like_and_view_counts_disabled": false,
      "viewer_can_reshare": true,
      "coauthor_producers": [],
      "pinned_for_users": [],
      "product_type": "igtv",
      "owner": {
        "id": "1067259270",
        "username": "google"
      },
      "tagged_user": []
    }
  ],
  "related_profiles": [
    {
      "id": "64421231679",
      "username": "datacentersatmeta",
      "full_name": "Meta Data Centers",
      "is_private": false,
      "is_verified": true,
      "profile_pic_url": "https://.../420640291_..._n.jpg"
    },
    {
      "id": "2491086563",
      "username": "surface",
      "full_name": "Microsoft Surface",
      "is_private": false,
      "is_verified": true,
      "profile_pic_url": "https://.../569809183_..._n.jpg"
    }
  ],
  "ig_status": "ok",
  "crawled_at": "2026-04-21T14:17:37.585Z"
}
```

Example dataset item when a profile is **not found**:

```json
{
  "username": "11",
  "depth": 0,
  "source_username": null,
  "ig_status": "not_found",
  "message": "Profile not found or restricted",
  "url": "https://www.instagram.com/11/",
  "crawled_at": "2026-02-06T08:03:20.522Z"
}
```

Here, `ig_status: "not_found"` means Instagram did not return profile data for that username because the profile does not exist or access to it is restricted.

***

### Tips & troubleshooting

**Don’t overload the actor.** If you need to scrape large lists, split inputs into batches.

***

### Legal & ethical notice

You are responsible for ensuring your use of this actor complies with:

- Instagram’s Terms of Service
- Applicable laws and regulations (privacy, data protection, etc.)

Only scrape data you have the right to access, and avoid collecting personal data without a lawful basis.

***

# Actor input Schema

## `instagramUsernames` (type: `array`):

Insert the username or URL of any profile you want to scrape.

## `scrapeFacebookProfile` (type: `boolean`):

When enabled, the actor looks for one Facebook profile URL in external\_url, bio\_links, fb\_profile\_biolink, biography, or full\_name, then fetches fb\_profile.

## `scrapeDepth` (type: `integer`):

How many additional related-profile layers to expand. 0 means only direct related profiles; 1 includes related profiles of related profiles.

## `maxResults` (type: `integer`):

Maximum number of dataset items to store. Leave empty for the default no-limit behavior.

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

Only store profiles with at least this many followers.

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

Only store profiles with no more than this many followers.

## `minPosts` (type: `integer`):

Only store profiles with at least this many posts.

## `maxPosts` (type: `integer`):

Only store profiles with no more than this many posts.

## `isVerified` (type: `string`):

Select Yes to only store verified profiles, No to only store unverified profiles, or leave empty/null to disable this filter.

## `isPrivate` (type: `string`):

Select Yes to only store private profiles, No to only store public profiles, or leave empty/null to disable this filter.

## `isBusinessAccount` (type: `string`):

Select Yes to only store business profiles, No to only store non-business profiles, or leave empty/null to disable this filter.

## Actor input object example

```json
{
  "instagramUsernames": [
    "noeychotika",
    "kevinhart4real"
  ],
  "scrapeFacebookProfile": false,
  "scrapeDepth": 0
}
```

# Actor output Schema

## `overview` (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 = {
    "instagramUsernames": [
        "noeychotika",
        "kevinhart4real"
    ],
    "scrapeFacebookProfile": false,
    "scrapeDepth": 0
};

// Run the Actor and wait for it to finish
const run = await client.actor("instagram-scraper/instagram-related-profiles").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 = {
    "instagramUsernames": [
        "noeychotika",
        "kevinhart4real",
    ],
    "scrapeFacebookProfile": False,
    "scrapeDepth": 0,
}

# Run the Actor and wait for it to finish
run = client.actor("instagram-scraper/instagram-related-profiles").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 '{
  "instagramUsernames": [
    "noeychotika",
    "kevinhart4real"
  ],
  "scrapeFacebookProfile": false,
  "scrapeDepth": 0
}' |
apify call instagram-scraper/instagram-related-profiles --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Instagram Related Profiles Scraper",
        "description": "Scrape Instagram profile data, profile statistics, and recursive related-profile discovery from public Instagram pages",
        "version": "1.0",
        "x-build-id": "n0QyrA1mEkt0vrf3Q"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/instagram-scraper~instagram-related-profiles/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-instagram-scraper-instagram-related-profiles",
                "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/instagram-scraper~instagram-related-profiles/runs": {
            "post": {
                "operationId": "runs-sync-instagram-scraper-instagram-related-profiles",
                "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/instagram-scraper~instagram-related-profiles/run-sync": {
            "post": {
                "operationId": "run-sync-instagram-scraper-instagram-related-profiles",
                "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": [
                    "instagramUsernames"
                ],
                "properties": {
                    "instagramUsernames": {
                        "title": "Instagram Username",
                        "type": "array",
                        "description": "Insert the username or URL of any profile you want to scrape.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "scrapeFacebookProfile": {
                        "title": "Scrape Facebook Profile",
                        "type": "boolean",
                        "description": "When enabled, the actor looks for one Facebook profile URL in external_url, bio_links, fb_profile_biolink, biography, or full_name, then fetches fb_profile.",
                        "default": false
                    },
                    "scrapeDepth": {
                        "title": "Scrape Depth",
                        "minimum": 0,
                        "maximum": 10,
                        "type": "integer",
                        "description": "How many additional related-profile layers to expand. 0 means only direct related profiles; 1 includes related profiles of related profiles.",
                        "default": 0
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 10,
                        "type": "integer",
                        "description": "Maximum number of dataset items to store. Leave empty for the default no-limit behavior."
                    },
                    "minFollowers": {
                        "title": "Min Followers",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Only store profiles with at least this many followers."
                    },
                    "maxFollowers": {
                        "title": "Max Followers",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Only store profiles with no more than this many followers."
                    },
                    "minPosts": {
                        "title": "Min Posts",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Only store profiles with at least this many posts."
                    },
                    "maxPosts": {
                        "title": "Max Posts",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Only store profiles with no more than this many posts."
                    },
                    "isVerified": {
                        "title": "Is Verified",
                        "enum": [
                            "yes",
                            "no"
                        ],
                        "type": "string",
                        "description": "Select Yes to only store verified profiles, No to only store unverified profiles, or leave empty/null to disable this filter."
                    },
                    "isPrivate": {
                        "title": "Is Private",
                        "enum": [
                            "yes",
                            "no"
                        ],
                        "type": "string",
                        "description": "Select Yes to only store private profiles, No to only store public profiles, or leave empty/null to disable this filter."
                    },
                    "isBusinessAccount": {
                        "title": "Is Business Account",
                        "enum": [
                            "yes",
                            "no"
                        ],
                        "type": "string",
                        "description": "Select Yes to only store business profiles, No to only store non-business profiles, or leave empty/null to disable this filter."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
