instagram-automation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Instagram 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
    RUBE_MANAGE_CONNECTIONS
    with toolkit
    instagram
  • Always call
    RUBE_SEARCH_TOOLS
    first to get current tool schemas
  • Instagram Business or Creator account required (personal accounts not supported)
  • 必须已连接Rube MCP(需提供RUBE_SEARCH_TOOLS)
  • 通过
    RUBE_MANAGE_CONNECTIONS
    并使用工具包
    instagram
    完成Instagram的激活连接
  • 请始终先调用
    RUBE_SEARCH_TOOLS
    以获取最新的工具schema
  • 需要Instagram商业账号或创作者账号(不支持个人账号)

Setup

设置

Get Rube MCP: Add
https://rube.app/mcp
as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
  1. Verify Rube MCP is available by confirming
    RUBE_SEARCH_TOOLS
    responds
  2. Call
    RUBE_MANAGE_CONNECTIONS
    with toolkit
    instagram
  3. If connection is not ACTIVE, follow the returned auth link to complete Instagram/Facebook OAuth
  4. Confirm connection status shows ACTIVE before running any workflows
获取Rube MCP:在客户端配置中添加
https://rube.app/mcp
作为MCP服务器。无需API密钥 —— 只需添加端点即可使用。
  1. 通过确认
    RUBE_SEARCH_TOOLS
    能正常响应,验证Rube MCP是否可用
  2. 调用
    RUBE_MANAGE_CONNECTIONS
    并指定工具包
    instagram
  3. 如果连接状态未显示为ACTIVE,请按照返回的授权链接完成Instagram/Facebook OAuth认证
  4. 在运行任何工作流之前,确认连接状态为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:
  1. INSTAGRAM_GET_USER_INFO
    - Get Instagram user ID [Prerequisite]
  2. INSTAGRAM_CREATE_MEDIA_CONTAINER
    - Create a media container with the image/video URL [Required]
  3. INSTAGRAM_GET_POST_STATUS
    - Check if the media container is ready [Optional]
  4. INSTAGRAM_CREATE_POST
    or
    INSTAGRAM_POST_IG_USER_MEDIA_PUBLISH
    - Publish the container [Required]
Key parameters:
  • image_url
    : Public URL of the image to post
  • video_url
    : Public URL of the video to post
  • caption
    : Post caption text
  • ig_user_id
    : Instagram Business account 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
工具序列:
  1. INSTAGRAM_GET_USER_INFO
    - 获取Instagram用户ID [前提步骤]
  2. INSTAGRAM_CREATE_MEDIA_CONTAINER
    - 使用图片/视频URL创建媒体容器 [必填]
  3. INSTAGRAM_GET_POST_STATUS
    - 检查媒体容器是否准备就绪 [可选]
  4. INSTAGRAM_CREATE_POST
    INSTAGRAM_POST_IG_USER_MEDIA_PUBLISH
    - 发布容器内容 [必填]
关键参数:
  • image_url
    : 要发布的图片的公开URL
  • video_url
    : 要发布的视频的公开URL
  • caption
    : 帖子文案
  • ig_user_id
    : Instagram商业账号的用户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:
  1. INSTAGRAM_CREATE_MEDIA_CONTAINER
    - Create individual containers for each media item [Required, repeat per item]
  2. INSTAGRAM_CREATE_CAROUSEL_CONTAINER
    - Create the carousel container referencing all media containers [Required]
  3. INSTAGRAM_GET_POST_STATUS
    - Check carousel container readiness [Optional]
  4. INSTAGRAM_POST_IG_USER_MEDIA_PUBLISH
    - Publish the carousel [Required]
Key parameters:
  • children
    : Array of media container IDs for the carousel
  • caption
    : Carousel post caption
  • ig_user_id
    : Instagram Business account 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
适用场景:用户想要在单个轮播帖子中发布多张图片/视频
工具序列:
  1. INSTAGRAM_CREATE_MEDIA_CONTAINER
    - 为每个媒体项单独创建容器 [必填,每个项重复执行]
  2. INSTAGRAM_CREATE_CAROUSEL_CONTAINER
    - 创建引用所有媒体容器的轮播容器 [必填]
  3. INSTAGRAM_GET_POST_STATUS
    - 检查轮播容器是否准备就绪 [可选]
  4. INSTAGRAM_POST_IG_USER_MEDIA_PUBLISH
    - 发布轮播内容 [必填]
关键参数:
  • children
    : 轮播所用的媒体容器ID数组
  • caption
    : 轮播帖子文案
  • ig_user_id
    : Instagram商业账号的用户ID
注意事项:
  • 轮播需要2-10个媒体项;数量不足或过多会导致失败
  • 必须先单独创建每个子容器,再创建轮播容器
  • 所有子容器必须完全处理完成后才能创建轮播容器
  • 轮播支持混合媒体(图片+视频)

3. Get Media and Insights

3. 获取媒体内容与数据洞察

When to use: User wants to view their posts or analyze post performance
Tool sequence:
  1. INSTAGRAM_GET_IG_USER_MEDIA
    or
    INSTAGRAM_GET_USER_MEDIA
    - List user's media [Required]
  2. INSTAGRAM_GET_IG_MEDIA
    - Get details for a specific post [Optional]
  3. INSTAGRAM_GET_POST_INSIGHTS
    or
    INSTAGRAM_GET_IG_MEDIA_INSIGHTS
    - Get metrics for a post [Optional]
  4. INSTAGRAM_GET_USER_INSIGHTS
    - Get account-level insights [Optional]
Key parameters:
  • ig_user_id
    : Instagram Business account user ID
  • media_id
    : ID of the specific media post
  • metric
    : Metrics to retrieve (e.g., impressions, reach, engagement)
  • period
    : Time period for insights (e.g., day, week, lifetime)
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
    period
    parameter must match the metric type
适用场景:用户想要查看自己的帖子或分析帖子表现
工具序列:
  1. INSTAGRAM_GET_IG_USER_MEDIA
    INSTAGRAM_GET_USER_MEDIA
    - 列出用户的媒体内容 [必填]
  2. INSTAGRAM_GET_IG_MEDIA
    - 获取特定帖子的详情 [可选]
  3. INSTAGRAM_GET_POST_INSIGHTS
    INSTAGRAM_GET_IG_MEDIA_INSIGHTS
    - 获取帖子的指标数据 [可选]
  4. INSTAGRAM_GET_USER_INSIGHTS
    - 获取账号级别的数据洞察 [可选]
关键参数:
  • ig_user_id
    : Instagram商业账号的用户ID
  • media_id
    : 特定媒体帖子的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:
  1. INSTAGRAM_GET_IG_USER_CONTENT_PUBLISHING_LIMIT
    - Check remaining publishing quota [Required]
Key parameters:
  • ig_user_id
    : Instagram Business account 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
适用场景:用户想要在尝试发布前确认自己是否可以发布
工具序列:
  1. INSTAGRAM_GET_IG_USER_CONTENT_PUBLISHING_LIMIT
    - 检查剩余发布配额 [必填]
关键参数:
  • ig_user_id
    : Instagram商业账号的用户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:
  1. INSTAGRAM_GET_IG_MEDIA_COMMENTS
    - List comments on a media post [Required]
  2. INSTAGRAM_GET_IG_MEDIA_CHILDREN
    - List children of a carousel post [Optional]
Key parameters:
  • media_id
    : ID of the media post
  • ig_media_id
    : Alternative media ID parameter
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
适用场景:用户想要查看帖子的评论或轮播的子项
工具序列:
  1. INSTAGRAM_GET_IG_MEDIA_COMMENTS
    - 列出媒体帖子的评论 [必填]
  2. INSTAGRAM_GET_IG_MEDIA_CHILDREN
    - 列出轮播帖子的子项 [可选]
关键参数:
  • media_id
    : 媒体帖子的ID
  • ig_media_id
    : 替代的媒体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 calls
Media 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 publishing
Instagram用户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 publishing

Two-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

快速参考

TaskTool SlugKey Params
Get user infoINSTAGRAM_GET_USER_INFO(none)
Create media containerINSTAGRAM_CREATE_MEDIA_CONTAINERimage_url/video_url, caption
Create carouselINSTAGRAM_CREATE_CAROUSEL_CONTAINERchildren, caption
Publish postINSTAGRAM_CREATE_POSTig_user_id, creation_id
Publish mediaINSTAGRAM_POST_IG_USER_MEDIA_PUBLISHig_user_id, creation_id
Check post statusINSTAGRAM_GET_POST_STATUSig_container_id
List user mediaINSTAGRAM_GET_IG_USER_MEDIAig_user_id
Get media detailsINSTAGRAM_GET_IG_MEDIAig_media_id
Get post insightsINSTAGRAM_GET_POST_INSIGHTSmedia_id, metric
Get user insightsINSTAGRAM_GET_USER_INSIGHTSig_user_id, metric, period
Get publishing limitINSTAGRAM_GET_IG_USER_CONTENT_PUBLISHING_LIMITig_user_id
Get media commentsINSTAGRAM_GET_IG_MEDIA_COMMENTSig_media_id
Get carousel childrenINSTAGRAM_GET_IG_MEDIA_CHILDRENig_media_id
任务工具标识关键参数
获取用户信息INSTAGRAM_GET_USER_INFO(无)
创建媒体容器INSTAGRAM_CREATE_MEDIA_CONTAINERimage_url/video_url, caption
创建轮播容器INSTAGRAM_CREATE_CAROUSEL_CONTAINERchildren, caption
发布帖子INSTAGRAM_CREATE_POSTig_user_id, creation_id
发布媒体内容INSTAGRAM_POST_IG_USER_MEDIA_PUBLISHig_user_id, creation_id
检查帖子状态INSTAGRAM_GET_POST_STATUSig_container_id
列出用户媒体内容INSTAGRAM_GET_IG_USER_MEDIAig_user_id
获取媒体详情INSTAGRAM_GET_IG_MEDIAig_media_id
获取帖子洞察INSTAGRAM_GET_POST_INSIGHTSmedia_id, metric
获取用户洞察INSTAGRAM_GET_USER_INSIGHTSig_user_id, metric, period
检查发布限制INSTAGRAM_GET_IG_USER_CONTENT_PUBLISHING_LIMITig_user_id
获取媒体评论INSTAGRAM_GET_IG_MEDIA_COMMENTSig_media_id
获取轮播子项INSTAGRAM_GET_IG_MEDIA_CHILDRENig_media_id