instagram-automation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseInstagram Automation via Rube MCP
通过Rube MCP实现Instagram自动化
Automate Instagram operations through Composio's Instagram toolkit via Rube MCP.
通过Composio的Instagram工具包,借助Rube MCP自动化Instagram操作。
Prerequisites
前提条件
- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)
- Active Instagram connection via with toolkit
RUBE_MANAGE_CONNECTIONSinstagram - Always call first to get current tool schemas
RUBE_SEARCH_TOOLS - Instagram Business or Creator account required (personal accounts not supported)
- 必须已连接Rube MCP(需提供RUBE_SEARCH_TOOLS)
- 通过并使用工具包
RUBE_MANAGE_CONNECTIONS完成Instagram的激活连接instagram - 请始终先调用以获取最新的工具schema
RUBE_SEARCH_TOOLS - 需要Instagram商业账号或创作者账号(不支持个人账号)
Setup
设置
Get Rube MCP: Add as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
https://rube.app/mcp- Verify Rube MCP is available by confirming responds
RUBE_SEARCH_TOOLS - Call with toolkit
RUBE_MANAGE_CONNECTIONSinstagram - If connection is not ACTIVE, follow the returned auth link to complete Instagram/Facebook OAuth
- Confirm connection status shows ACTIVE before running any workflows
获取Rube MCP:在客户端配置中添加作为MCP服务器。无需API密钥 —— 只需添加端点即可使用。
https://rube.app/mcp- 通过确认能正常响应,验证Rube MCP是否可用
RUBE_SEARCH_TOOLS - 调用并指定工具包
RUBE_MANAGE_CONNECTIONSinstagram - 如果连接状态未显示为ACTIVE,请按照返回的授权链接完成Instagram/Facebook OAuth认证
- 在运行任何工作流之前,确认连接状态为ACTIVE
Core Workflows
核心工作流
1. Create a Single Image/Video Post
1. 创建单图/视频帖子
When to use: User wants to publish a single photo or video to Instagram
Tool sequence:
- - Get Instagram user ID [Prerequisite]
INSTAGRAM_GET_USER_INFO - - Create a media container with the image/video URL [Required]
INSTAGRAM_CREATE_MEDIA_CONTAINER - - Check if the media container is ready [Optional]
INSTAGRAM_GET_POST_STATUS - or
INSTAGRAM_CREATE_POST- Publish the container [Required]INSTAGRAM_POST_IG_USER_MEDIA_PUBLISH
Key parameters:
- : Public URL of the image to post
image_url - : Public URL of the video to post
video_url - : Post caption text
caption - : Instagram Business account user ID
ig_user_id
Pitfalls:
- Media URLs must be publicly accessible; private/authenticated URLs will fail
- Video containers may take time to process; poll GET_POST_STATUS before publishing
- Caption supports hashtags and mentions but has a 2200 character limit
- Publishing a container that is not yet finished processing returns an error
适用场景:用户想要发布单张图片或视频到Instagram
工具序列:
- - 获取Instagram用户ID [前提步骤]
INSTAGRAM_GET_USER_INFO - - 使用图片/视频URL创建媒体容器 [必填]
INSTAGRAM_CREATE_MEDIA_CONTAINER - - 检查媒体容器是否准备就绪 [可选]
INSTAGRAM_GET_POST_STATUS - 或
INSTAGRAM_CREATE_POST- 发布容器内容 [必填]INSTAGRAM_POST_IG_USER_MEDIA_PUBLISH
关键参数:
- : 要发布的图片的公开URL
image_url - : 要发布的视频的公开URL
video_url - : 帖子文案
caption - : Instagram商业账号的用户ID
ig_user_id
注意事项:
- 媒体URL必须是公开可访问的;私有/需认证的URL会导致失败
- 视频容器可能需要时间处理;发布前请调用GET_POST_STATUS轮询状态
- 文案支持话题标签和提及,但字符限制为2200个
- 发布未处理完成的容器会返回错误
2. Create a Carousel Post
2. 创建轮播帖子
When to use: User wants to publish multiple images/videos in a single carousel post
Tool sequence:
- - Create individual containers for each media item [Required, repeat per item]
INSTAGRAM_CREATE_MEDIA_CONTAINER - - Create the carousel container referencing all media containers [Required]
INSTAGRAM_CREATE_CAROUSEL_CONTAINER - - Check carousel container readiness [Optional]
INSTAGRAM_GET_POST_STATUS - - Publish the carousel [Required]
INSTAGRAM_POST_IG_USER_MEDIA_PUBLISH
Key parameters:
- : Array of media container IDs for the carousel
children - : Carousel post caption
caption - : Instagram Business account user ID
ig_user_id
Pitfalls:
- Carousels require 2-10 media items; fewer or more will fail
- Each child container must be created individually before the carousel container
- All child containers must be fully processed before creating the carousel
- Mixed media (images + videos) is supported in carousels
适用场景:用户想要在单个轮播帖子中发布多张图片/视频
工具序列:
- - 为每个媒体项单独创建容器 [必填,每个项重复执行]
INSTAGRAM_CREATE_MEDIA_CONTAINER - - 创建引用所有媒体容器的轮播容器 [必填]
INSTAGRAM_CREATE_CAROUSEL_CONTAINER - - 检查轮播容器是否准备就绪 [可选]
INSTAGRAM_GET_POST_STATUS - - 发布轮播内容 [必填]
INSTAGRAM_POST_IG_USER_MEDIA_PUBLISH
关键参数:
- : 轮播所用的媒体容器ID数组
children - : 轮播帖子文案
caption - : Instagram商业账号的用户ID
ig_user_id
注意事项:
- 轮播需要2-10个媒体项;数量不足或过多会导致失败
- 必须先单独创建每个子容器,再创建轮播容器
- 所有子容器必须完全处理完成后才能创建轮播容器
- 轮播支持混合媒体(图片+视频)
3. Get Media and Insights
3. 获取媒体内容与数据洞察
When to use: User wants to view their posts or analyze post performance
Tool sequence:
- or
INSTAGRAM_GET_IG_USER_MEDIA- List user's media [Required]INSTAGRAM_GET_USER_MEDIA - - Get details for a specific post [Optional]
INSTAGRAM_GET_IG_MEDIA - or
INSTAGRAM_GET_POST_INSIGHTS- Get metrics for a post [Optional]INSTAGRAM_GET_IG_MEDIA_INSIGHTS - - Get account-level insights [Optional]
INSTAGRAM_GET_USER_INSIGHTS
Key parameters:
- : Instagram Business account user ID
ig_user_id - : ID of the specific media post
media_id - : Metrics to retrieve (e.g., impressions, reach, engagement)
metric - : Time period for insights (e.g., day, week, lifetime)
period
Pitfalls:
- Insights are only available for Business/Creator accounts
- Some metrics require minimum follower counts
- Insight data may have a delay of up to 48 hours
- The parameter must match the metric type
period
适用场景:用户想要查看自己的帖子或分析帖子表现
工具序列:
- 或
INSTAGRAM_GET_IG_USER_MEDIA- 列出用户的媒体内容 [必填]INSTAGRAM_GET_USER_MEDIA - - 获取特定帖子的详情 [可选]
INSTAGRAM_GET_IG_MEDIA - 或
INSTAGRAM_GET_POST_INSIGHTS- 获取帖子的指标数据 [可选]INSTAGRAM_GET_IG_MEDIA_INSIGHTS - - 获取账号级别的数据洞察 [可选]
INSTAGRAM_GET_USER_INSIGHTS
关键参数:
- : Instagram商业账号的用户ID
ig_user_id - : 特定媒体帖子的ID
media_id - : 要获取的指标(例如:曝光量、触达量、互动量)
metric - : 数据洞察的时间周期(例如:日、周、全周期)
period
注意事项:
- 仅商业/创作者账号可获取数据洞察
- 部分指标要求达到最低粉丝数
- 洞察数据可能存在最多48小时的延迟
- 参数必须与指标类型匹配
period
4. Check Publishing Limits
4. 检查发布限制
When to use: User wants to verify they can publish before attempting a post
Tool sequence:
- - Check remaining publishing quota [Required]
INSTAGRAM_GET_IG_USER_CONTENT_PUBLISHING_LIMIT
Key parameters:
- : Instagram Business account user ID
ig_user_id
Pitfalls:
- Instagram enforces a 25 posts per 24-hour rolling window limit
- Publishing limit resets on a rolling basis, not at midnight
- Check limits before bulk posting operations to avoid failures
适用场景:用户想要在尝试发布前确认自己是否可以发布
工具序列:
- - 检查剩余发布配额 [必填]
INSTAGRAM_GET_IG_USER_CONTENT_PUBLISHING_LIMIT
关键参数:
- : Instagram商业账号的用户ID
ig_user_id
注意事项:
- Instagram实施24小时滚动窗口内最多发布25条帖子的限制
- 发布限制按滚动周期重置,而非午夜重置
- 批量发布前请检查限制,避免操作失败
5. Get Media Comments and Children
5. 获取媒体评论与轮播子项
When to use: User wants to view comments on a post or children of a carousel
Tool sequence:
- - List comments on a media post [Required]
INSTAGRAM_GET_IG_MEDIA_COMMENTS - - List children of a carousel post [Optional]
INSTAGRAM_GET_IG_MEDIA_CHILDREN
Key parameters:
- : ID of the media post
media_id - : Alternative media ID parameter
ig_media_id
Pitfalls:
- Comments may be paginated; follow pagination cursors for complete results
- Carousel children are returned as individual media objects
- Comment moderation settings on the account affect what is returned
适用场景:用户想要查看帖子的评论或轮播的子项
工具序列:
- - 列出媒体帖子的评论 [必填]
INSTAGRAM_GET_IG_MEDIA_COMMENTS - - 列出轮播帖子的子项 [可选]
INSTAGRAM_GET_IG_MEDIA_CHILDREN
关键参数:
- : 媒体帖子的ID
media_id - : 替代的媒体ID参数
ig_media_id
注意事项:
- 评论可能会分页;请跟随分页游标获取完整结果
- 轮播子项会以单独的媒体对象形式返回
- 账号的评论审核设置会影响返回内容
Common Patterns
通用模式
ID Resolution
ID解析
Instagram User ID:
1. Call INSTAGRAM_GET_USER_INFO
2. Extract ig_user_id from response
3. Use in all subsequent API callsMedia Container Status Check:
1. Call INSTAGRAM_CREATE_MEDIA_CONTAINER
2. Extract container_id from response
3. Poll INSTAGRAM_GET_POST_STATUS with container_id
4. Wait until status is 'FINISHED' before publishingInstagram用户ID:
1. Call INSTAGRAM_GET_USER_INFO
2. Extract ig_user_id from response
3. Use in all subsequent API calls媒体容器状态检查:
1. Call INSTAGRAM_CREATE_MEDIA_CONTAINER
2. Extract container_id from response
3. Poll INSTAGRAM_GET_POST_STATUS with container_id
4. Wait until status is 'FINISHED' before publishingTwo-Phase Publishing
两阶段发布
- Phase 1: Create media container(s) with content URLs
- Phase 2: Publish the container after it finishes processing
- Always check container status between phases for video content
- For carousels, all children must complete Phase 1 before creating the carousel container
- 阶段1:使用内容URL创建媒体容器
- 阶段2:容器处理完成后发布内容
- 视频内容必须在两个阶段之间检查容器状态
- 对于轮播,所有子项必须完成阶段1后才能创建轮播容器
Known Pitfalls
已知注意事项
Media URLs:
- All image/video URLs must be publicly accessible HTTPS URLs
- URLs behind authentication, CDN restrictions, or that require cookies will fail
- Temporary URLs (pre-signed S3, etc.) may expire before processing completes
Rate Limits:
- 25 posts per 24-hour rolling window
- API rate limits apply separately from publishing limits
- Implement exponential backoff for 429 responses
Account Requirements:
- Only Business or Creator Instagram accounts are supported
- Personal accounts cannot use the Instagram Graph API
- The account must be connected to a Facebook Page
Response Parsing:
- Media IDs are numeric strings
- Insights data may be nested under different response keys
- Pagination uses cursor-based tokens
媒体URL:
- 所有图片/视频URL必须是公开可访问的HTTPS URL
- 需认证、受CDN限制或需要Cookie的URL会导致失败
- 临时URL(如预签名S3链接等)可能在处理完成前过期
速率限制:
- 24小时滚动窗口内最多发布25条帖子
- API速率限制与发布限制是分开计算的
- 收到429响应时请实现指数退避策略
账号要求:
- 仅支持Instagram商业或创作者账号
- 个人账号无法使用Instagram Graph API
- 账号必须关联Facebook主页
响应解析:
- 媒体ID是数字字符串
- 洞察数据可能嵌套在不同的响应键下
- 分页使用基于游标的令牌
Quick Reference
快速参考
| Task | Tool Slug | Key Params |
|---|---|---|
| Get user info | INSTAGRAM_GET_USER_INFO | (none) |
| Create media container | INSTAGRAM_CREATE_MEDIA_CONTAINER | image_url/video_url, caption |
| Create carousel | INSTAGRAM_CREATE_CAROUSEL_CONTAINER | children, caption |
| Publish post | INSTAGRAM_CREATE_POST | ig_user_id, creation_id |
| Publish media | INSTAGRAM_POST_IG_USER_MEDIA_PUBLISH | ig_user_id, creation_id |
| Check post status | INSTAGRAM_GET_POST_STATUS | ig_container_id |
| List user media | INSTAGRAM_GET_IG_USER_MEDIA | ig_user_id |
| Get media details | INSTAGRAM_GET_IG_MEDIA | ig_media_id |
| Get post insights | INSTAGRAM_GET_POST_INSIGHTS | media_id, metric |
| Get user insights | INSTAGRAM_GET_USER_INSIGHTS | ig_user_id, metric, period |
| Get publishing limit | INSTAGRAM_GET_IG_USER_CONTENT_PUBLISHING_LIMIT | ig_user_id |
| Get media comments | INSTAGRAM_GET_IG_MEDIA_COMMENTS | ig_media_id |
| Get carousel children | INSTAGRAM_GET_IG_MEDIA_CHILDREN | ig_media_id |
| 任务 | 工具标识 | 关键参数 |
|---|---|---|
| 获取用户信息 | INSTAGRAM_GET_USER_INFO | (无) |
| 创建媒体容器 | INSTAGRAM_CREATE_MEDIA_CONTAINER | image_url/video_url, caption |
| 创建轮播容器 | INSTAGRAM_CREATE_CAROUSEL_CONTAINER | children, caption |
| 发布帖子 | INSTAGRAM_CREATE_POST | ig_user_id, creation_id |
| 发布媒体内容 | INSTAGRAM_POST_IG_USER_MEDIA_PUBLISH | ig_user_id, creation_id |
| 检查帖子状态 | INSTAGRAM_GET_POST_STATUS | ig_container_id |
| 列出用户媒体内容 | INSTAGRAM_GET_IG_USER_MEDIA | ig_user_id |
| 获取媒体详情 | INSTAGRAM_GET_IG_MEDIA | ig_media_id |
| 获取帖子洞察 | INSTAGRAM_GET_POST_INSIGHTS | media_id, metric |
| 获取用户洞察 | INSTAGRAM_GET_USER_INSIGHTS | ig_user_id, metric, period |
| 检查发布限制 | INSTAGRAM_GET_IG_USER_CONTENT_PUBLISHING_LIMIT | ig_user_id |
| 获取媒体评论 | INSTAGRAM_GET_IG_MEDIA_COMMENTS | ig_media_id |
| 获取轮播子项 | INSTAGRAM_GET_IG_MEDIA_CHILDREN | ig_media_id |