LateLate API
Platforms

Instagram API

Post to Instagram with Late API - Feed posts, Stories, Reels, and Carousels


Quick Start

Post to Instagram in under 60 seconds:

curl -X POST https://getlate.dev/api/v1/posts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Check out this photo! 📸",
    "mediaItems": [
      {"url": "https://example.com/photo.jpg"}
    ],
    "platforms": [
      {"platform": "instagram", "accountId": "YOUR_ACCOUNT_ID"}
    ],
    "publishNow": true
  }'
const response = await fetch('https://getlate.dev/api/v1/posts', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    content: 'Check out this photo! 📸',
    mediaItems: [
      { url: 'https://example.com/photo.jpg' }
    ],
    platforms: [
      { platform: 'instagram', accountId: 'YOUR_ACCOUNT_ID' }
    ],
    publishNow: true
  })
});

const { post } = await response.json();
console.log('Posted to Instagram!', post._id);
import requests

response = requests.post(
    'https://getlate.dev/api/v1/posts',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    json={
        'content': 'Check out this photo! 📸',
        'mediaItems': [
            {'url': 'https://example.com/photo.jpg'}
        ],
        'platforms': [
            {'platform': 'instagram', 'accountId': 'YOUR_ACCOUNT_ID'}
        ],
        'publishNow': True
    }
)

post = response.json()
print(f"Posted to Instagram! {post['_id']}")

Note: Instagram requires media for all posts. Text-only posts are not supported.

Content Types

Instagram supports multiple content types, each with different requirements:

TypeDescriptionMedia Required
Feed PostStandard image/video postYes
CarouselMulti-image/video post (up to 10)Yes
Story24-hour ephemeral contentYes
ReelShort-form video (up to 90 sec)Yes (video)

Image Requirements

PropertyFeed PostStoryCarousel
Max Images1110
FormatsJPEG, PNGJPEG, PNGJPEG, PNG
Max File Size8 MB8 MB8 MB each
Recommended1080 × 1350 px1080 × 1920 px1080 × 1080 px

Aspect Ratio Requirements

This is critical for Instagram! Feed posts have strict aspect ratio requirements:

OrientationRatioDimensionsUse Case
Portrait4:51080 × 1350 pxBest engagement
Square1:11080 × 1080 pxStandard
Landscape1.91:11080 × 566 pxMinimum

Allowed range: 0.8 (4:5) to 1.91 (1.91:1)

✅ 4:5 (0.8) - Portrait
✅ 1:1 (1.0) - Square
✅ 1.91:1 (1.91) - Landscape
❌ 9:16 (0.56) - Too tall, use Story instead
❌ 16:9 (1.78) - Acceptable but cropped

Important: Images outside the 0.8-1.91 range (like 9:16 vertical videos) must be posted as Stories using contentType: "story".

Video Requirements

Feed Videos / Reels

PropertyRequirement
FormatsMP4, MOV
Max File Size300 MB (auto-compressed if larger)
Max Duration90 seconds (Reels), 60 min (Feed)
Min Duration3 seconds
Aspect Ratio9:16 (Reels), 4:5 to 1.91:1 (Feed)
Resolution1080 × 1920 px (Reels)
Frame Rate30 fps recommended
CodecH.264

Story Videos

PropertyRequirement
Max File Size100 MB (auto-compressed if larger)
Max Duration60 seconds
Aspect Ratio9:16
Resolution1080 × 1920 px

Create carousel posts with up to 10 items mixing images and videos:

curl -X POST https://getlate.dev/api/v1/posts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Check out these photos from my trip! 🌴",
    "mediaItems": [
      {"url": "https://example.com/photo1.jpg"},
      {"url": "https://example.com/photo2.jpg"},
      {"url": "https://example.com/video.mp4"},
      {"url": "https://example.com/photo3.jpg"}
    ],
    "platforms": [
      {"platform": "instagram", "accountId": "YOUR_ACCOUNT_ID"}
    ],
    "publishNow": true
  }'
const response = await fetch('https://getlate.dev/api/v1/posts', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    content: 'Check out these photos from my trip! 🌴',
    mediaItems: [
      { url: 'https://example.com/photo1.jpg' },
      { url: 'https://example.com/photo2.jpg' },
      { url: 'https://example.com/video.mp4' },
      { url: 'https://example.com/photo3.jpg' }
    ],
    platforms: [
      { platform: 'instagram', accountId: 'YOUR_ACCOUNT_ID' }
    ],
    publishNow: true
  })
});
response = requests.post(
    'https://getlate.dev/api/v1/posts',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    json={
        'content': 'Check out these photos from my trip! 🌴',
        'mediaItems': [
            {'url': 'https://example.com/photo1.jpg'},
            {'url': 'https://example.com/photo2.jpg'},
            {'url': 'https://example.com/video.mp4'},
            {'url': 'https://example.com/photo3.jpg'}
        ],
        'platforms': [
            {'platform': 'instagram', 'accountId': 'YOUR_ACCOUNT_ID'}
        ],
        'publishNow': True
    }
)
  • All items should have the same aspect ratio
  • First item determines the aspect ratio for all
  • Mix of images and videos is allowed
  • Each item: max 8 MB (images), 100 MB (videos)

Stories

To post as a Story instead of feed:

curl -X POST https://getlate.dev/api/v1/posts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mediaItems": [
      {"url": "https://example.com/story-image.jpg"}
    ],
    "platforms": [{
      "platform": "instagram",
      "accountId": "YOUR_ACCOUNT_ID",
      "platformSpecificData": {
        "contentType": "story"
      }
    }],
    "publishNow": true
  }'
const response = await fetch('https://getlate.dev/api/v1/posts', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    mediaItems: [
      { url: 'https://example.com/story-image.jpg' }
    ],
    platforms: [{
      platform: 'instagram',
      accountId: 'YOUR_ACCOUNT_ID',
      platformSpecificData: {
        contentType: 'story'
      }
    }],
    publishNow: true
  })
});
response = requests.post(
    'https://getlate.dev/api/v1/posts',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    json={
        'mediaItems': [
            {'url': 'https://example.com/story-image.jpg'}
        ],
        'platforms': [{
            'platform': 'instagram',
            'accountId': 'YOUR_ACCOUNT_ID',
            'platformSpecificData': {
                'contentType': 'story'
            }
        }],
        'publishNow': True
    }
)

Story Notes:

  • Stories disappear after 24 hours
  • No text captions displayed (use image overlays)
  • 9:16 aspect ratio recommended
  • Tappable links available for business accounts

Collaborators

Invite up to 3 collaborators on feed posts and Reels:

{
  "platforms": [
    {
      "platform": "instagram",
      "accountId": "acc_123",
      "platformSpecificData": {
        "collaborators": ["username1", "username2"]
      }
    }
  ]
}

Automatic Compression

Late automatically compresses oversized media:

Content TypeImage LimitVideo LimitAction
Feed/Carousel8 MB300 MBAuto-compress
Story8 MB100 MBAuto-compress
Reel8 MB300 MBAuto-compress

Original files are preserved.

Common Issues

"Invalid aspect ratio"

Your image is outside the 0.8-1.91 range. Solutions:

  1. Crop to 4:5 or 1:1
  2. Use contentType: "story" for 9:16 content

Video rejected as Reel

Videos under 90 seconds with 9:16 aspect ratio automatically become Reels. If you want a feed video, use a different aspect ratio.

Ensure all carousel items have the same aspect ratio. The first item sets the ratio for all.