# CaptionAI IG (`edgeofcali/ig-caption-ai`) Actor

CaptionAI IG — high-performance Apify actor.

- **URL**: https://apify.com/edgeofcali/ig-caption-ai.md
- **Developed by:** [Edward Martinez](https://apify.com/edgeofcali) (community)
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

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

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## CaptionAI IG 🤖✍️

[![Apify Actor](https://img.shields.io/badge/Apify-Actor-brightgreen?logo=apify)](https://apify.com)
[![Instagram AI](https://img.shields.io/badge/Platform-Instagram-E1306C?logo=instagram)](https://instagram.com)
[![Node.js](https://img.shields.io/badge/Node.js-20%2B-339933?logo=node.js)](https://nodejs.org)
[![License](https://img.shields.io/badge/License-MIT-blue)](LICENSE)
[![Category](https://img.shields.io/badge/Category-AI%20Agent-purple)](https://apify.com)

> **AI caption generator trained on top-performing Instagram content.** Generate 5 viral-ready caption variations with proven hook formulas, optimal emoji placement, strategic CTAs, and 3 tailored hashtag sets — all in one click.

***

### 🚀 What is CaptionAI IG?

CaptionAI IG is an intelligent Apify actor that combines real-time Instagram data scraping with AI-powered caption generation. It crawls Instagram's explore and hashtag pages to analyse trending content patterns in your niche, then uses proven copywriting frameworks to generate 5 unique, engagement-optimised caption variations tailored to your brand voice and goal.

Whether you are a content creator, social media manager, e-commerce brand, or marketing agency — CaptionAI IG saves you hours of caption writing while delivering results backed by real Instagram engagement data.

***

### 🎯 Use Cases

| Use Case | Who Benefits | Outcome |
|---|---|---|
| Product Launch Captions | E-commerce brands | Higher click-through on bio link |
| Engagement-Boosting Posts | Content creators | More comments and shares |
| Brand Awareness Campaigns | Startups & SMBs | Increased follower growth |
| Influencer Content | Micro & macro influencers | Stronger audience connection |
| Agency Client Work | Social media agencies | Scalable caption production |
| Hashtag Strategy | All Instagram users | Broader reach across 3 tag tiers |
| A/B Caption Testing | Performance marketers | Data-driven content decisions |
| Niche Community Posts | Community managers | Higher niche engagement rates |

***

### 📥 Input Fields

| Field | Type | Default | Description |
|---|---|---|---|
| `topic` | String | `"lifestyle product launch"` | 🎯 The topic or description of your image/post |
| `brandVoice` | String | `"casual"` | 🎤 Brand tone: `casual`, `professional`, or `witty` |
| `niche` | String | `"lifestyle"` | 🏷️ Your Instagram niche (e.g. fitness, food, tech) |
| `goal` | String | `"engagement"` | 🎪 Post goal: `engagement`, `sales`, or `awareness` |
| `postType` | String | `"photo"` | 📸 Type of post: `photo`, `reel`, `carousel`, or `story` |

***

### 📤 Output Fields

| Field | Type | Description |
|---|---|---|
| `url` | String | Source Instagram URL scraped |
| `scrapedAt` | String | ISO 8601 timestamp of when data was collected |
| `actorVersion` | String | Version of the actor that generated this record |
| `captionVariants` | Array\[5] | Five unique AI-generated caption variations |
| `hookFormula` | String | The proven hook formula applied to captions |
| `cta` | String | Strategic call-to-action optimised for your goal |
| `hashtagSet1` | Array | 🔍 Niche-specific hashtags (lower competition, higher relevance) |
| `hashtagSet2` | Array | 📊 Medium-reach hashtags (balanced competition/reach) |
| `hashtagSet3` | Array | 🌍 Broad/trending hashtags (maximum exposure) |
| `emojiSuggestions` | Array | 10 contextually relevant emojis for your content |
| `characterCount` | Array | Character counts for each of the 5 caption variants |
| `aiViralScore` | Number | AI-predicted viral potential score (0–10) |
| `aiScore` | Number | Relevance/quality score based on scraped engagement data (0–10) |
| `aiInsight` | String | One-sentence AI insight about the content opportunity |

***

### 📊 Example Output

```json
{
  "url": "https://www.instagram.com/explore/tags/lifestyle/",
  "scrapedAt": "2024-11-15T14:32:00.000Z",
  "actorVersion": "0.1.0",
  "aiInsight": "Generated 5 AI-optimised caption variants for 'product launch' targeting the lifestyle niche with a casual brand voice aimed at maximising engagement — the Question Hook is the recommended structure for this content pillar.",
  "aiScore": 7.5,
  "captionVariants": [
    "✨ This is the secret no one tells you about product launch...\n\nWe have been obsessed with lifestyle for years, and honestly? product launch is the game-changer we never knew we needed.\n\nDrop a 🔥 in the comments if you agree!",
    "POV: You just discovered the best product launch in the entire lifestyle space 🔥\n\nHonestly, we did not think it was possible until we tried it ourselves.\n\nDrop a 🔥 in the comments if you agree!",
    "Okay but can we talk about product launch for a second? 😍\n\nBecause the lifestyle community is SLEEPING on this.\n\nSave this post because you will want to come back to it. 📌",
    "Not us being completely obsessed with product launch ✨\n\nIf you know, you know.\n\nLet us know in the comments: are you team product launch or nah? 🔥",
    "Real talk: product launch is the best thing to happen to lifestyle this year 💪\n\nWe have tested it, tried it, and lived it.\n\nDrop a 🔥 in the comments if you agree!"
  ],
  "hookFormula": "Question Hook: Start with a relatable question to spark conversation",
  "cta": "Drop a 🔥 in the comments if you agree!",
  "hashtagSet1": ["#lifestylecommunity", "#lifestylelovers", "#productlaunchniche", "#lifestyletips", "#productlaunchinspo", "#lifestylecreator", "#productlaunchdaily", "#lifestylelife", "#productlaunchgoals", "#lifestylevibes"],
  "hashtagSet2": ["#lifestyle", "#productlaunch", "#instagramcreator", "#contentcreator", "#lifestylebrand", "#socialmediamarketing", "#instagrammarketing", "#productlaunchlife", "#instapost", "#lifestyleworld"],
  "hashtagSet3": ["#instagram", "#instagood", "#photooftheday", "#follow", "#like4like", "#instadaily", "#viral", "#trending", "#explore", "#reels"],
  "emojiSuggestions": ["😍", "🔥", "💯", "✨", "👏", "🙌", "💪", "💬", "❤️", "🔁"],
  "characterCount": [312, 248, 271, 253, 261],
  "aiViralScore": 7.5
}
```

***

### 💡 How It Works

1. **Input Processing** — You provide your topic, brand voice, niche, goal, and post type
2. **Instagram Scraping** — The actor crawls relevant Instagram explore and hashtag pages to gather real engagement data and trending content patterns
3. **AI Caption Generation** — Using proven copywriting formulas trained on top-performing Instagram content, 5 unique captions are generated
4. **Hook Formula Selection** — The optimal hook formula is selected based on your brand voice and goal combination
5. **Hashtag Strategy** — Three tiers of hashtags are generated: niche-specific (high relevance), medium-reach (balanced), and broad (maximum exposure)
6. **Emoji Optimisation** — Context-aware emoji suggestions are provided based on your tone and goal
7. **Scoring** — Each output receives an AI Viral Score and AI Quality Score for easy comparison

***

### ⚙️ Technical Details

- Built with **Node.js 20+** using ESM modules
- Uses **Playwright** for dynamic Instagram content rendering
- **Automatic retry** on failed requests (up to 3 retries)
- **Rate-limit friendly**: random 800–2000ms delays between requests
- **Proxy support**: Automatically uses Apify proxy when available
- **Zod validation**: Every output record is schema-validated before storage
- **Scroll pagination**: Automatically scrolls to reveal more Instagram content

***

### 💰 Pricing

| Plan | Requests | Price |
|---|---|---|
| Free Trial | 5 runs | Free |
| Starter | 100 runs/month | $9/month |
| Professional | 1,000 runs/month | $29/month |
| Agency | Unlimited | $99/month |

*Each run generates 5 caption variations, 3 hashtag sets, and full AI scoring.*

***

### 🔒 Compliance & Ethics

This actor respects Instagram's robots.txt, implements rate limiting, and only accesses publicly available content. No login credentials are required or used.

***

### 📬 Support

For issues, feature requests, or custom implementations, please open an issue on the Apify platform or contact us through the actor page.

# Actor input Schema

## `startUrls` (type: `array`):

List of URLs to start scraping from.

## `maxItems` (type: `integer`):

Maximum number of results to return.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://apify.com"
    }
  ],
  "maxItems": 50
}
```

# Actor output Schema

## `results` (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 = {
    "startUrls": [
        {
            "url": "https://apify.com"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("edgeofcali/ig-caption-ai").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 = { "startUrls": [{ "url": "https://apify.com" }] }

# Run the Actor and wait for it to finish
run = client.actor("edgeofcali/ig-caption-ai").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 '{
  "startUrls": [
    {
      "url": "https://apify.com"
    }
  ]
}' |
apify call edgeofcali/ig-caption-ai --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,edgeofcali/ig-caption-ai"
        }
    }
}
```

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/7kQ4Ff7PT7kixvlfh/builds/ReolBW7fHgU2sAdfW/openapi.json
