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
- Price
- freeプロバイダー原価
- Success rate
- —成功率データはまだありません成功率データはまだありません
- Latency p50
- ——
- Last verified
- —Not verified yet
POSThttps://toolswitch.dev/v1/tools/instagram.instagram.media.container.createPreview- Uses platform quota
- Synchronous response
- Reads public data
パラメータ
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());このゲートウェイ API はプレビュー版です。URL や認証方式は変更される場合があります。 パラメータはサンプルデータです。 呼び出し料金は free です。サービス料を含みます。