# 🚀 Instagram Close Friends Automation (`figue/instagram-close-friends-bot`)

Take full advantage of Instagram’s Close Friends feature to supercharge your story engagement and drive conversions like never before. This powerful bot automates the process of adding users to your Close Friends list, helping you increase story views by up to 30% on average

- **URL**: https://beta-securitybyobscurity.apify.com/figue/instagram-close-friends-bot.md
- **Developed by:** [Figue](https://beta-securitybyobscurity.apify.com/figue) (community)
- **Categories:** Social media, Lead generation, Automation
- **Stats:** 275 total users, 12 monthly users, 100.0% runs succeeded, 10 bookmarks
- **User rating**: 3.81 out of 5 stars

## Pricing

$40.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.
You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#rental-actors

# README

## Instagram Close Friends Automation Bot

Boost your Instagram story views and conversions by leveraging the Close Friends feature! This bot automates adding or removing users to your Close Friends list, saving time and increasing engagement by up to **30%** on average. Perfect for creators, influencers, and businesses looking to maximize ROI effortlessly.

> 🚀 **Looking for a hassle-free solution?**\
> Check out [Gramlab.io](https://www.gramlab.io/?utm_source=apify\&utm_medium=marketplace\&utm_campaign=close_friends) - our fully automated SaaS platform that handles everything for you, with no setup required! Get 5-10x more story views instantly.
>
> [![Gramlab Tutorial](https://img.youtube.com/vi/xh4QQa5x2n8/0.jpg)](https://youtu.be/xh4QQa5x2n8)
>
> **Why choose Gramlab?**
>
> - No Instagram password required - secure Chrome extension authentication
> - Real-time performance tracking
> - Multi-account management
> - Fully self-served platform
> - Human-like behavior for account safety
> - One-time payment, no subscriptions
>
> [Start Growing Now with Gramlab](https://www.gramlab.io/?utm_source=apify\&utm_medium=marketplace\&utm_campaign=close_friends) 🚀

***

### Features

- **Automated Close Friends Management**: Add or remove users based on a list of usernames.
- **Save Time**: Eliminate the manual hassle of managing Close Friends.
- **High Conversion Potential**: Drive more actions with targeted story content.
- **Add or remove users from your Instagram Close Friends list**: This feature allows you to manage your Close Friends list by adding or removing users.
- **Continue from last run**: Resume your operations from last run or by specifying a username to start from.
- **Configurable maximum profiles limit**: This feature allows you to limit the number of profiles to process.
- **Human-like behavior simulation for safety**: This feature allows you to simulate human-like behavior when adding or removing users.

***

### Input Parameters

- **Instagram Usernames** (required): List of Instagram usernames to process
- **Remove Mode** (optional): When enabled, removes users from close friends instead of adding them
- **Continue From Last Run** (optional): If enabled, continues processing from where the last run stopped. If not, starts from the beginning of the list or from the provided username
- **Start From Username** (optional): Specify a username from the list to start processing from
- **Maximum Profiles** (optional): Limit the number of profiles to process (0-200)
- **Instagram Cookies** (required): Your Instagram session cookies for authentication
- **Proxy Configuration** (optional): Proxy settings for making requests

***

### How to Use

[![Instagram Close Friends Bot Tutorial](https://img.youtube.com/vi/2ATbr8Y4qrQ/0.jpg)](https://youtu.be/2ATbr8Y4qrQ)

Watch our quick tutorial video to learn how to use the Instagram Close Friends Bot effectively.

***

1. **Get Instagram Cookie**

   - Install the Chrome Extension "EditThisCookie" [here](https://chromewebstore.google.com/detail/editthiscookies/hlgpnddmgbhkmilmcnejaibhmoiljhhb) or "Cookie-Editor" [here](https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm)
   - Log in to Instagram in your Chrome browser.
   - Open the extension and export cookies as JSON.
   - Copy the cookie data.

2. **Input Details**

   - Paste the Instagram cookie into the input box.
   - Enter the usernames you want to add or remove from your Close Friends list.
   - Optionally specify a username to start from if you want to resume from a specific point.
   - Enable or disable the "Remove Mode" checkbox to switch between adding and removing users.
   - Set the maximum number of profiles to add or remove.
   - Select the Apify Proxy Group. We recommend using at least "RESIDENTIAL" group.

3. **Start the Process**
   - Click on the "Save and Start" button.
   - The bot will begin managing your Close Friends list automatically.

***

### Output Example

The bot will provide real-time updates about the process. Statuses can be:

- `added`: The user was added to your Close Friends list.
- `removed`: The user was removed from your Close Friends list.
- `skipped`: The user was skipped because they were already in your Close Friends list.
- `failed`: The user was not added or removed due to an error.

Below is an example of the JSON output:

```json
[
    {
        "processedAt": "2024-12-10 23:37:02",
        "username": "figue_io",
        "status": "added"
    },
    {
        "processedAt": "2024-12-10 23:37:50",
        "username": "hormozi",
        "status": "removed"
    },
    {
        "processedAt": "2024-12-10 23:37:57",
        "username": "tailopez",
        "status": "skipped"
    },
    {
        "processedAt": "2024-12-10 23:37:36",
        "username": "taylorswift",
        "status": "failed"
    }
]
```

If you have any questions or need assistance, please contact us at <hello@figue.io>.

# Actor input Schema

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

List of Instagram usernames to add or remove from your Close Friends list

## `continueFromLast` (type: `boolean`):

If enabled, continues processing from where the last run stopped. If not, starts from the beginning of the list or from the provided username

## `startFromUsername` (type: `string`):

Optional username to start processing from. If provided, processing will begin from this username in the list

## `maxProfiles` (type: `integer`):

Maximum number of profiles to add to close friends (0-200)

## `removeMode` (type: `boolean`):

If enabled, removes users from close friends instead of adding them

## `proxyCountryCode` (type: `string`):

Country code for the proxy

## `cookies` (type: `array`):

Cookies are used to authorize the actor with Instagram

Follow these steps to get the cookies:

Install <a href="https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm" target="_blank">Cookie-Editor chrome extension</a>
Login to your Instagram account
Click on the extension and export the Instagram cookies
Paste the copied contents here

<a href="https://youtu.be/2ATbr8Y4qrQ" target="_blank"><img src="https://www.youtube.com/s/desktop/66e817d4/img/favicon_32x32.png" width="16px"> Video - How to get cookies</a>

## `proxy` (type: `object`):

Proxy settings for making requests

## Actor input object example

```json
{
  "usernames": [
    "figue_io",
    "hormozi",
    "tailopez",
    "arianagrande"
  ],
  "continueFromLast": false,
  "maxProfiles": 50,
  "removeMode": false,
  "proxyCountryCode": "FR",
  "cookies": [
    {
      "name": "sessionid",
      "value": "your-session-id",
      "domain": ".instagram.com",
      "path": "/"
    }
  ],
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

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

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "usernames": [
        "figue_io",
        "hormozi",
        "tailopez",
        "arianagrande"
    ],
    "cookies": [
        {
            "name": "sessionid",
            "value": "your-session-id",
            "domain": ".instagram.com",
            "path": "/"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("figue/instagram-close-friends-bot").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "usernames": [
        "figue_io",
        "hormozi",
        "tailopez",
        "arianagrande",
    ],
    "cookies": [{
            "name": "sessionid",
            "value": "your-session-id",
            "domain": ".instagram.com",
            "path": "/",
        }],
}

# Run the Actor and wait for it to finish
run = client.actor("figue/instagram-close-friends-bot").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 '{
  "usernames": [
    "figue_io",
    "hormozi",
    "tailopez",
    "arianagrande"
  ],
  "cookies": [
    {
      "name": "sessionid",
      "value": "your-session-id",
      "domain": ".instagram.com",
      "path": "/"
    }
  ]
}' |
apify call figue/instagram-close-friends-bot --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "🚀 Instagram Close Friends Automation",
        "description": "Take full advantage of Instagram’s Close Friends feature to supercharge your story engagement and drive conversions like never before. This powerful bot automates the process of adding users to your Close Friends list, helping you increase story views by up to 30% on average",
        "version": "0.0",
        "x-build-id": "eDdnH6TqxwohdArc0"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/figue~instagram-close-friends-bot/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-figue-instagram-close-friends-bot",
                "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/figue~instagram-close-friends-bot/runs": {
            "post": {
                "operationId": "runs-sync-figue-instagram-close-friends-bot",
                "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/figue~instagram-close-friends-bot/run-sync": {
            "post": {
                "operationId": "run-sync-figue-instagram-close-friends-bot",
                "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": [
                    "usernames",
                    "cookies"
                ],
                "properties": {
                    "usernames": {
                        "title": "Instagram Usernames",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "List of Instagram usernames to add or remove from your Close Friends list",
                        "items": {
                            "type": "string"
                        }
                    },
                    "continueFromLast": {
                        "title": "Continue From Last Run",
                        "type": "boolean",
                        "description": "If enabled, continues processing from where the last run stopped. If not, starts from the beginning of the list or from the provided username",
                        "default": false
                    },
                    "startFromUsername": {
                        "title": "Start From Username",
                        "type": "string",
                        "description": "Optional username to start processing from. If provided, processing will begin from this username in the list"
                    },
                    "maxProfiles": {
                        "title": "Maximum Profiles",
                        "minimum": 0,
                        "maximum": 200,
                        "type": "integer",
                        "description": "Maximum number of profiles to add to close friends (0-200)",
                        "default": 50
                    },
                    "removeMode": {
                        "title": "Remove Mode",
                        "type": "boolean",
                        "description": "If enabled, removes users from close friends instead of adding them",
                        "default": false
                    },
                    "proxyCountryCode": {
                        "title": "Proxy Country Code",
                        "type": "string",
                        "description": "Country code for the proxy",
                        "default": "FR"
                    },
                    "cookies": {
                        "title": "🍪 Instagram Cookies",
                        "type": "array",
                        "description": "Cookies are used to authorize the actor with Instagram\n\nFollow these steps to get the cookies:\n\nInstall <a href=\"https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm\" target=\"_blank\">Cookie-Editor chrome extension</a>\nLogin to your Instagram account\nClick on the extension and export the Instagram cookies\nPaste the copied contents here\n\n<a href=\"https://youtu.be/2ATbr8Y4qrQ\" target=\"_blank\"><img src=\"https://www.youtube.com/s/desktop/66e817d4/img/favicon_32x32.png\" width=\"16px\"> Video - How to get cookies</a>"
                    },
                    "proxy": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Proxy settings for making requests",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
