Instagram API

Schedule and automate Instagram posts with SocialSyncerAPI — Feed, Stories, Reels, Carousels, collaborators, and user tags.

Quick Reference

Before You Start

Instagram requires a Business or Creator account. Personal accounts cannot post via API.

Google Drive, Dropbox, OneDrive, and iCloud links do not work as media URLs. These services return HTML pages, not media files. Instagram's servers cannot fetch media from them. Use direct CDN URLs or upload via SocialSyncerAPI's media endpoint.

Quick Start

Post an image to Instagram in under 60 seconds:

Python (httpx)

import httpx

resp = httpx.post(
    "https://api.socialsyncerapi.com/v1/posts",
    headers={"Authorization": "Bearer sk_your_api_key"},
    json={
        "content": "Check out this photo!",
        "mediaItems": [
            {"type": "image", "url": "https://cdn.example.com/photo.jpg"}
        ],
        "platforms": [
            {"platform": "instagram", "accountId": "YOUR_ACCOUNT_ID"}
        ],
        "publishNow": True
    }
)
data = resp.json()
print(f"Posted to Instagram! {data['id']}")

curl

curl -X POST https://api.socialsyncerapi.com/v1/posts \
  -H "Authorization: Bearer sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Check out this photo!",
    "mediaItems": [
      {"type": "image", "url": "https://cdn.example.com/photo.jpg"}
    ],
    "platforms": [
      {"platform": "instagram", "accountId": "YOUR_ACCOUNT_ID"}
    ],
    "publishNow": true
  }'

Node.js (fetch)

const resp = await fetch("https://api.socialsyncerapi.com/v1/posts", {
  method: "POST",
  headers: {
    "Authorization": "Bearer sk_your_api_key",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    content: "Check out this photo!",
    mediaItems: [
      { type: "image", url: "https://cdn.example.com/photo.jpg" }
    ],
    platforms: [
      { platform: "instagram", accountId: "YOUR_ACCOUNT_ID" }
    ],
    publishNow: true
  })
});
const data = await resp.json();
console.log("Posted to Instagram!", data.id);

Content Types

Feed Post

A single image or video in the main feed. Best aspect ratio is 4:5 (portrait), but 1:1 (square) and 1.91:1 (landscape) are also supported. No contentType field is needed — feed is the default.

Feed Post — Python

import httpx

resp = httpx.post(
    "https://api.socialsyncerapi.com/v1/posts",
    headers={"Authorization": "Bearer sk_your_api_key"},
    json={
        "content": "Beautiful sunset today #photography",
        "mediaItems": [
            {"type": "image", "url": "https://cdn.example.com/sunset.jpg"}
        ],
        "platforms": [
            {"platform": "instagram", "accountId": "YOUR_ACCOUNT_ID"}
        ],
        "publishNow": True
    }
)
print("Feed post created!", resp.json()["id"])

Feed Post — curl

curl -X POST https://api.socialsyncerapi.com/v1/posts \
  -H "Authorization: Bearer sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Beautiful sunset today #photography",
    "mediaItems": [
      {"type": "image", "url": "https://cdn.example.com/sunset.jpg"}
    ],
    "platforms": [
      {"platform": "instagram", "accountId": "YOUR_ACCOUNT_ID"}
    ],
    "publishNow": true
  }'

Feed Post — Node.js

const resp = await fetch("https://api.socialsyncerapi.com/v1/posts", {
  method: "POST",
  headers: {
    "Authorization": "Bearer sk_your_api_key",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    content: "Beautiful sunset today #photography",
    mediaItems: [
      { type: "image", url: "https://cdn.example.com/sunset.jpg" }
    ],
    platforms: [
      { platform: "instagram", accountId: "YOUR_ACCOUNT_ID" }
    ],
    publishNow: true
  })
});
console.log("Feed post created!", (await resp.json()).id);

Carousel

Up to 10 mixed image/video items. All items should share the same aspect ratio — the first item determines the ratio for the entire carousel.

Carousel — Python

import httpx

resp = httpx.post(
    "https://api.socialsyncerapi.com/v1/posts",
    headers={"Authorization": "Bearer sk_your_api_key"},
    json={
        "content": "Trip highlights from last weekend",
        "mediaItems": [
            {"type": "image", "url": "https://cdn.example.com/photo1.jpg"},
            {"type": "image", "url": "https://cdn.example.com/photo2.jpg"},
            {"type": "video", "url": "https://cdn.example.com/clip.mp4"},
            {"type": "image", "url": "https://cdn.example.com/photo3.jpg"}
        ],
        "platforms": [
            {"platform": "instagram", "accountId": "YOUR_ACCOUNT_ID"}
        ],
        "publishNow": True
    }
)
print("Carousel posted!", resp.json()["id"])

Carousel — curl

curl -X POST https://api.socialsyncerapi.com/v1/posts \
  -H "Authorization: Bearer sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Trip highlights from last weekend",
    "mediaItems": [
      {"type": "image", "url": "https://cdn.example.com/photo1.jpg"},
      {"type": "image", "url": "https://cdn.example.com/photo2.jpg"},
      {"type": "video", "url": "https://cdn.example.com/clip.mp4"},
      {"type": "image", "url": "https://cdn.example.com/photo3.jpg"}
    ],
    "platforms": [
      {"platform": "instagram", "accountId": "YOUR_ACCOUNT_ID"}
    ],
    "publishNow": true
  }'

Carousel — Node.js

const resp = await fetch("https://api.socialsyncerapi.com/v1/posts", {
  method: "POST",
  headers: {
    "Authorization": "Bearer sk_your_api_key",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    content: "Trip highlights from last weekend",
    mediaItems: [
      { type: "image", url: "https://cdn.example.com/photo1.jpg" },
      { type: "image", url: "https://cdn.example.com/photo2.jpg" },
      { type: "video", url: "https://cdn.example.com/clip.mp4" },
      { type: "image", url: "https://cdn.example.com/photo3.jpg" }
    ],
    platforms: [
      { platform: "instagram", accountId: "YOUR_ACCOUNT_ID" }
    ],
    publishNow: true
  })
});
console.log("Carousel posted!", (await resp.json()).id);

Story

Set contentType: "story" to publish to Stories. Stories disappear after 24 hours, text captions are not displayed, and link stickers are not available via the API.

Story — Python

import httpx

resp = httpx.post(
    "https://api.socialsyncerapi.com/v1/posts",
    headers={"Authorization": "Bearer sk_your_api_key"},
    json={
        "mediaItems": [
            {"type": "image", "url": "https://cdn.example.com/story.jpg"}
        ],
        "platforms": [{
            "platform": "instagram",
            "accountId": "YOUR_ACCOUNT_ID",
            "platformSpecificData": {
                "contentType": "story"
            }
        }],
        "publishNow": True
    }
)
print("Story posted!", resp.json()["id"])

Story — curl

curl -X POST https://api.socialsyncerapi.com/v1/posts \
  -H "Authorization: Bearer sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "mediaItems": [
      {"type": "image", "url": "https://cdn.example.com/story.jpg"}
    ],
    "platforms": [{
      "platform": "instagram",
      "accountId": "YOUR_ACCOUNT_ID",
      "platformSpecificData": {
        "contentType": "story"
      }
    }],
    "publishNow": true
  }'

Story — Node.js

const resp = await fetch("https://api.socialsyncerapi.com/v1/posts", {
  method: "POST",
  headers: {
    "Authorization": "Bearer sk_your_api_key",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    mediaItems: [
      { type: "image", url: "https://cdn.example.com/story.jpg" }
    ],
    platforms: [{
      platform: "instagram",
      accountId: "YOUR_ACCOUNT_ID",
      platformSpecificData: {
        contentType: "story"
      }
    }],
    publishNow: true
  })
});
console.log("Story posted!", (await resp.json()).id);

Reel

Set contentType: "reels" to publish a Reel, or let SocialSyncerAPI auto-detect it from vertical 9:16 video under 90 seconds. Reels must be vertical (9:16) and no longer than 90 seconds.

Reel — Python

import httpx

resp = httpx.post(
    "https://api.socialsyncerapi.com/v1/posts",
    headers={"Authorization": "Bearer sk_your_api_key"},
    json={
        "content": "New tutorial is up!",
        "mediaItems": [
            {"type": "video", "url": "https://cdn.example.com/reel.mp4"}
        ],
        "platforms": [{
            "platform": "instagram",
            "accountId": "YOUR_ACCOUNT_ID",
            "platformSpecificData": {
                "contentType": "reels",
                "shareToFeed": True
            }
        }],
        "publishNow": True
    }
)
print("Reel posted!", resp.json()["id"])

Reel — curl

curl -X POST https://api.socialsyncerapi.com/v1/posts \
  -H "Authorization: Bearer sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "New tutorial is up!",
    "mediaItems": [
      {"type": "video", "url": "https://cdn.example.com/reel.mp4"}
    ],
    "platforms": [{
      "platform": "instagram",
      "accountId": "YOUR_ACCOUNT_ID",
      "platformSpecificData": {
        "contentType": "reels",
        "shareToFeed": true
      }
    }],
    "publishNow": true
  }'

Reel — Node.js

const resp = await fetch("https://api.socialsyncerapi.com/v1/posts", {
  method: "POST",
  headers: {
    "Authorization": "Bearer sk_your_api_key",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    content: "New tutorial is up!",
    mediaItems: [
      { type: "video", url: "https://cdn.example.com/reel.mp4" }
    ],
    platforms: [{
      platform: "instagram",
      accountId: "YOUR_ACCOUNT_ID",
      platformSpecificData: {
        contentType: "reels",
        shareToFeed: true
      }
    }],
    publishNow: true
  })
});
console.log("Reel posted!", (await resp.json()).id);

Media Requirements

Images

Aspect Ratios

Feed posts accept aspect ratios between 0.8 (4:5) and 1.91 (1.91:1). Images outside that range must be posted as Stories or Reels.

Videos

Oversized media is auto-compressed. Images above 8 MB, videos above 300 MB (feed/reels) or 100 MB (stories) are compressed automatically. Original files are preserved.

Platform-Specific Data

All fields go inside platformSpecificData on the Instagram platform entry.

Constraints

What You Can't Do

These features are not available through Instagram's API:

Common Errors