# Instagram Comment Picker: Random Giveaway Winner (`rowfinch/instagram-comment-picker`) Actor

Draw random giveaway winners from Instagram post and reel comments. One entry per account, optional keyword, and each winner row shows the comments read and the accounts in the draw.

- **URL**: https://apify.com/rowfinch/instagram-comment-picker.md
- **Developed by:** [Rowfinch](https://apify.com/rowfinch) (community)
- **Categories:** Social media, Marketing
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 84.6% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.40 / 1,000 comment reads

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Instagram Comment Picker

Pick random giveaway winners from the comments of any public Instagram post or reel. One entry per account, an optional keyword, and every winner row shows how many people were in the draw.

**$0.40 per 1,000 comments read. Winners are free.**

### What it's for

- **Giveaways and contests**: draw 1 to 100 winners from everyone who commented.
- **"Comment the word to enter" campaigns**: only comments with your keyword can win.
- **Several posts at once**: each post gets its own draw, in the same run.
- **Agencies and automations**: schedule it or call it from the API, and get the winners as JSON, CSV or Excel.

### How the draw works

1. Reads the post's comments in Instagram's order, up to **Comments read per post**.
2. Keeps one entry per account: its first comment. Accounts with no username are left out.
3. With a keyword, only comments that contain it can win. Capital letters don't matter.
4. Draws the winners at random with Node's cryptographic generator. No account wins twice.

To include everyone, set **Comments read per post** above the post's comment count.

### Input

| Field | What it does |
|---|---|
| `directUrls` | Post or reel URLs, one per line. Each one is drawn separately |
| `winners` | Winners per post, 1 to 100 (default 1) |
| `keyword` | Only comments containing this word can win (optional) |
| `maxComments` | Comments read per post (default 5,000) |

### Output

One row per winner:

```json
{
  "postUrl": "https://www.instagram.com/p/DepFSEJAl_l/",
  "rank": 1,
  "winner": "lorraine_carriere",
  "commentText": "❤️❤️❤️",
  "commentUrl": "https://www.instagram.com/p/DepFSEJAl_l/c/17880172488552229/",
  "commentedAt": "2026-10-19T01:36:04.000Z",
  "eligibleCount": 48,
  "commentsRead": 50,
  "keyword": null
}
```

`eligibleCount` is how many accounts could win and `commentsRead` is how many comments were read, so you can publish the size of the draw with the result.

Posts with no comments, no comment matching the keyword, or that are private or missing get a row with the reason, free of charge:

```json
{ "input": "https://www.instagram.com/p/some_private_post/", "error": "Private post" }
```

### Price

- **$0.40 per 1,000 comments read**
- Winners, errors and private posts: free

Other giveaway pickers on Apify charge $0.25 for each winner drawn. Here the winners are free: a draw of 10 winners from 500 comments costs $0.20, not $2.50.

| Draw | Cost |
|---|---|
| Post with 500 comments | $0.20 |
| Post with 5,000 comments | $2.00 |

A run stops at the maximum cost you set for it. On Apify's free plan, each draw reads the first 100 comments. The free plan includes 5 runs of this actor a month.

### FAQ

**Can the same person win twice?**
No. Each account enters once, with its first comment, however many times it commented.

**Does it count replies?**
No. Only top-level comments enter the draw.

**Does it check if the winner follows the account or liked the post?**
No. It draws from comments only. To check followers, run [Instagram Followers Scraper](https://apify.com/rowfinch/instagram-followers-scraper) on your account.

**Does it work with private accounts?**
No. Only public posts and reels.

**Need every comment, not just the winners?**
Use [Instagram Comments Scraper](https://apify.com/rowfinch/instagram-comment-scraper), at the same price per comment.

# Actor input Schema

## `directUrls` (type: `array`):

The giveaway posts. Each one is drawn separately.

## `winners` (type: `integer`):

How many people to draw from each post's comments.

## `keyword` (type: `string`):

Leave empty to count every comment. Capital letters don't matter.

## `maxComments` (type: `integer`):

Set it above the post's comment count to include everyone. Each comment read costs $0.40 per 1,000.

## Actor input object example

```json
{
  "directUrls": [
    "https://www.instagram.com/p/DepFSEJAl_l/"
  ],
  "winners": 3,
  "maxComments": 500
}
```

# Actor output Schema

## `winners` (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 = {
    "directUrls": [
        "https://www.instagram.com/p/DepFSEJAl_l/"
    ],
    "winners": 3,
    "maxComments": 500
};

// Run the Actor and wait for it to finish
const run = await client.actor("rowfinch/instagram-comment-picker").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 = {
    "directUrls": ["https://www.instagram.com/p/DepFSEJAl_l/"],
    "winners": 3,
    "maxComments": 500,
}

# Run the Actor and wait for it to finish
run = client.actor("rowfinch/instagram-comment-picker").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 '{
  "directUrls": [
    "https://www.instagram.com/p/DepFSEJAl_l/"
  ],
  "winners": 3,
  "maxComments": 500
}' |
apify call rowfinch/instagram-comment-picker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rowfinch/instagram-comment-picker"
        }
    }
}
```

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/Vqfqb77rrSSe8LQp3/builds/jO0Mc8gFeHKiWm5Og/openapi.json
