Best use case
Instagram Collector Skill is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
## Purpose
Teams using Instagram Collector Skill should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/instagram-collector/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How Instagram Collector Skill Compares
| Feature / Agent | Instagram Collector Skill | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
## Purpose
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
AI Agents for Startups
Explore AI agent skills for startup validation, product research, growth experiments, documentation, and fast execution with small teams.
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
SKILL.md Source
# Instagram Collector Skill
## Purpose
Collects Instagram profile data for a given handle using the Apify Instagram Profile Scraper. Extracts follower count, engagement metrics, posting frequency, and top hashtags. This collector feeds into the Marketing Audit Pipeline to populate the Instagram Performance section of the final report.
## Input Schema
```typescript
// Function signature
collectInstagram(handle: string): Promise<InstagramData>
// The handle parameter is the Instagram username without the @ symbol.
// Example: "gymshark" (not "@gymshark")
```
## Output Schema
```typescript
interface InstagramData {
followers: number;
posts: number;
engagementRate: number; // Calculated: (avgLikes + avgComments) / followers * 100
postingFrequency: string; // e.g. "1.2 posts/day", "3 posts/week", "unknown"
avgLikes: number;
avgComments: number;
topHashtags: string[]; // Up to 10 most-used hashtags from recent posts
error?: string; // Present only when collector fails
}
```
## API Dependencies
- **API Name:** Apify Instagram Profile Scraper
- **Actor ID:** `apify~instagram-profile-scraper`
- **Endpoint:** `https://api.apify.com/v2/acts/apify~instagram-profile-scraper/runs`
- **Auth:** `APIFY_API_TOKEN` environment variable
- **Cost estimate:** ~$0.005 per run on Apify free/paid tier
- **Rate limits:** Depends on Apify plan; free tier allows limited concurrent runs
## Implementation Pattern
### Data Flow
1. Receive `handle` string from the pipeline
2. Call `apifyService.scrapeInstagramProfile(handle)` which starts an Apify actor run
3. Apify runs asynchronously -- the service polls for completion (timeout: 60s)
4. Fetch the actor's dataset results once complete
5. Map the raw Apify response to the `InstagramData` interface
### Engagement Rate Calculation
```typescript
engagementRate = ((avgLikes + avgComments) / followers) * 100;
```
- If `followers` is 0, set `engagementRate` to 0 to avoid division by zero
- Engagement rate is expressed as a percentage (e.g., 3.5 means 3.5%)
### Posting Frequency Calculation
- Analyze timestamps from the last 30 posts returned by Apify
- Calculate the time span between the oldest and newest post
- Divide the number of posts by the number of days in that span
- Format as a human-readable string:
- >= 1 post/day: `"X.X posts/day"`
- < 1 post/day but >= 1/week: `"X posts/week"`
- < 1 post/week: `"X posts/month"`
- If no timestamp data available: `"unknown"`
### Top Hashtags Extraction
- Iterate through captions of recent posts
- Extract all `#hashtag` tokens using regex: `/#(\w+)/g`
- Count frequency of each hashtag
- Return the top 10 most frequently used
### Apify Response Mapping
Key fields from Apify's raw output:
- `followersCount` -> `followers`
- `postsCount` -> `posts`
- `latestPosts[].likesCount` -> used for `avgLikes`
- `latestPosts[].commentsCount` -> used for `avgComments`
- `latestPosts[].caption` -> used for hashtag extraction
- `latestPosts[].timestamp` -> used for posting frequency
## Error Handling
- Entire function wrapped in `try/catch`
- On failure, return `EMPTY_INSTAGRAM_DATA` with `error` field set:
```typescript
return { ...EMPTY_INSTAGRAM_DATA, error: 'Instagram data unavailable: <reason>' };
```
- Never throw -- always return a valid `InstagramData` object
- Log errors with Winston logger including handle and error details:
```typescript
logger.error('Instagram collector failed', { handle, err });
```
- Common failure scenarios:
- Apify token invalid or expired
- Actor run timeout (profile too large or Apify overloaded)
- Profile is private or does not exist
- Rate limit exceeded on Apify
## Example Usage
```typescript
import { collectInstagram } from '../collectors/instagramCollector';
// Successful collection
const data = await collectInstagram('gymshark');
// Returns:
// {
// followers: 6800000,
// posts: 4520,
// engagementRate: 1.85,
// postingFrequency: "1.3 posts/day",
// avgLikes: 120000,
// avgComments: 5800,
// topHashtags: ["gymshark", "fitness", "gym", "workout", "fitnessmotivation", ...],
// }
// Failed collection (graceful degradation)
const failedData = await collectInstagram('nonexistent_handle_12345');
// Returns:
// {
// followers: 0,
// posts: 0,
// engagementRate: 0,
// postingFrequency: "unknown",
// avgLikes: 0,
// avgComments: 0,
// topHashtags: [],
// error: "Instagram data unavailable: Profile not found"
// }
```
## Notes
- The collector depends on `apifyService.ts` for the actual API communication. The collector handles only data mapping and calculations.
- Apify actor runs are asynchronous. The service layer handles polling. If the run does not complete within 60 seconds, it should be treated as a timeout error.
- This collector is independently testable. In tests, mock `apifyService.scrapeInstagramProfile` to return fixture data.
- Instagram data can be stale -- Apify scrapes public data which may be cached. This is acceptable for audit purposes.
- The `EMPTY_INSTAGRAM_DATA` constant is defined in `src/types/audit.types.ts` and should be imported for fallback returns.
- This collector must never block the pipeline. Even a complete failure returns valid typed data with an error flag, allowing other collectors to proceed.Related Skills
clinstagram
Full Instagram CLI — posting, DMs, stories, analytics, followers, hashtags, likes, comments. Supports Meta Graph API (official, safe) and private API (full features). Three compliance modes: official-only, hybrid-safe, private-enabled.
tianyancha-bidding-collector
天眼查招投标数据查询工具 - 基于浏览器自动化技术批量查询企业招投标/中标公示信息,导出结构化 CSV 报表。支持 macOS 和 Windows 跨平台运行。
instagram-reel-downloader-whatsapp
Download an Instagram Reel via sssinstagram.com and return it as a WhatsApp-ready video file. Use when a reel URL is provided and yt-dlp is blocked or not preferred.
design-inspiration-collector
多平台设计灵感收集技能。当用户需要设计参考、UI灵感、视觉创意时触发。用户提出设计方向(如"医疗App"、"移动端UI"、"金融Dashboard"等),技能负责:(1) 使用Tavily搜索Behance、Dribbble、Pinterest三个平台的相关内容 (2) 整理内容并附上链接 (3) 生成腾讯文档,文档命名为"关键词+日期时间"格式 (4) 发送文档链接给用户 (5) 推荐其他相关方向(不带链接)。触发词:找灵感、收集灵感、设计参考、UI参考、视觉灵感、设计趋势、Behance、Dribbble、Pinterest。
instagram-search
Instagram Search — Search 400M+ Instagram posts, reels, and profiles. Find influencers, track hashtags, analyze engagement, and export data. No Instagram API or Meta developer account needed — works through Xpoz MCP.
Instagram Profile Scraper
A browser-based Instagram profile discovery and scraping tool.
kb-collector
Knowledge Base Collector - save YouTube, URLs, text to Obsidian with AI summarization. Auto-transcribes videos, fetches pages, supports weekly/monthly digest emails and nightly research.
instagram-reels
Download Instagram Reels, transcribe audio, and extract captions. Share a reel URL and get back a full transcript with the original description.
industry-news-collector
行业新闻聚合与热度排序工具。当用户询问XX行业的最新动态时触发,如:"今天有什么XX行业新闻?""总结一下这周的XX行业动态""最近XX行业有什么热点?"。覆盖:新产品发布、行业动态、融资新闻、技术突破、政策变化等。输出中文摘要列表,按热度排序,附带原文链接。
instagram-poster
Post images to Instagram automatically via Telegram. Generates images with WaveSpeed or uses your own. Bypasses Instagram bot detection using residential proxy. Use when: user wants to post to Instagram, auto-post image, share photo on Instagram, instagram autoposter, schedule instagram post, publish to instagram, post reel image. Requires IG_USERNAME + IG_PASSWORD env vars or a saved session. Needs human-browser skill for residential proxy.
A local-first Instagram content system for hooks, captions, content structure, and draft storage. Acts as The Attention Sculptor to optimize stop-rate and retention. No API connection, no auto-posting, no automation.
soc2-evidence-collector
Generate SOC2 evidence collection checklists, automate evidence gathering scripts, and produce audit-ready evidence packages. Covers all 5 Trust Service Criteria (Security, Availability, Processing Integrity, Confidentiality, Privacy). Use when preparing for SOC2 Type I/II audits, maintaining continuous compliance, or building evidence collection automation. Built by AfrexAI.