Stage an Instagram post — create its media container
instagram.instagram.media.container.createStage an Instagram post by creating the media container it will be published from
- 价格
- free按供应商原价
- 成功率
- —暂无成功率数据暂无成功率数据
- 延迟 p50
- ——
- 最后验证
- —尚未验证
POSThttps://toolswitch.dev/v1/tools/instagram.instagram.media.container.create预览- 可用平台额度调用
- 同步返回
- 读取公开数据
参数
step 1 of the publish flow. Needs instagram_content_publish (treg's `post` capability — a `read` connection 403s here) and returns {id: <container id>}. A VIDEO container is not ready when this returns: poll instagram.media.container.status until status_code is FINISHED before publishing, or the publish call fails. Stories have no carousel — publish each story as its own container
| 参数 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| 路径参数 | ||||
ig_user_id | 字符串 | 必填 | numeric Instagram professional account id — the same one instagram.user.profile takes | 17841400000000000 |
| 查询参数 | ||||
caption | 字符串 | 可选 | up to 2,200 characters and 30 hashtags. On a carousel the caption belongs on the PARENT container — set it on a child and the post publishes captionless | Three things we learned this week. |
children | 字符串 | 可选 | CAROUSEL parent only: comma-separated child container ids, 2 to 10 of them, in display order | 17890000000000001,17890000000000002 |
image_url | 字符串 | 可选 | public JPEG URL. Use this OR video_url, never both | https://example.com/photo.jpg |
video_url | 字符串 | 可选 | public MP4 URL | https://example.com/clip.mp4 |
media_type | 字符串 | 可选 | omit for a plain feed image; REELS for a video in the feed, STORIES for a 24-hour story, CAROUSEL for the parent container that groups children | REELS |
location_id | 字符串 | 可选 | a Facebook Page id that has a location | |
thumb_offset | 整数 | 可选 | video only — milliseconds into the clip to take the cover frame from | 0 |
collaborators | 字符串 | 可选 | JSON array of @handles invited as collaborators; not allowed on stories | |
is_carousel_item | 布尔 | 可选 | true on each child container of a carousel; children carry no caption and are never published on their own | true |
- 路径参数
ig_user_id字符串必填numeric Instagram professional account id — the same one instagram.user.profile takes
示例:
17841400000000000- 查询参数
caption字符串可选up to 2,200 characters and 30 hashtags. On a carousel the caption belongs on the PARENT container — set it on a child and the post publishes captionless
示例:
Three things we learned this week.children字符串可选CAROUSEL parent only: comma-separated child container ids, 2 to 10 of them, in display order
示例:
17890000000000001,17890000000000002image_url字符串可选public JPEG URL. Use this OR video_url, never both
示例:
https://example.com/photo.jpgvideo_url字符串可选public MP4 URL
示例:
https://example.com/clip.mp4media_type字符串可选omit for a plain feed image; REELS for a video in the feed, STORIES for a 24-hour story, CAROUSEL for the parent container that groups children
示例:
REELSlocation_id字符串可选a Facebook Page id that has a location
thumb_offset整数可选video only — milliseconds into the clip to take the cover frame from
示例:
0collaborators字符串可选JSON array of @handles invited as collaborators; not allowed on stories
is_carousel_item布尔可选true on each child container of a carousel; children carry no caption and are never published on their own
示例:
true
代码示例
将 $TOOLSWITCH_KEY 替换为你在控制台创建的密钥。
curl -X POST 'https://toolswitch.dev/v1/tools/instagram.instagram.media.container.create' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY"import os
import requests
response = requests.request(
"POST",
"https://toolswitch.dev/v1/tools/instagram.instagram.media.container.create",
headers={"X-Toolswitch-Key": os.environ["TOOLSWITCH_KEY"]},
)
response.raise_for_status()
print(response.text)const response = await fetch("https://toolswitch.dev/v1/tools/instagram.instagram.media.container.create", {
method: "POST",
headers: {
"X-Toolswitch-Key": process.env.TOOLSWITCH_KEY ?? "",
},
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
console.log(await response.text());网关接口为预览版,地址与鉴权方式可能调整。 示例参数仅为样例数据。 调用按 free 计费,已含服务费。