# Instagram post images by API: sizes, carousels and publishing

> Generate Instagram feed posts and carousels from a template, in the sizes Instagram keeps uncropped, as JPEGs its publishing API accepts.

Published 2026-11-06 · https://shareglint.com/en/use-cases/instagram-posts

An Instagram feed post made from a template is a quote card, an announcement, a testimonial, a carousel slide or a photo collage with your brand's layout and this week's words. With Shareglint you render it from data — one request per post, a batch for the month — as a **JPEG**, because that is the only format Instagram's publishing API takes. This page covers the sizes, carousels and automatic publishing; the cross-network workflow is on [social media images](https://shareglint.com/en/use-cases/social-media-images).

## The two sets of numbers

Instagram has two sets of rules, and they differ.

**In the app** — when someone uploads by hand — a photo keeps its resolution when it is 320 to 1080 pixels wide with an aspect ratio between 1.91:1 and 3:4, that is "a width of 1080 pixels with a height between 566 and 1440 pixels". Other ratios are cropped, smaller photos enlarged to 320 px wide, larger ones scaled down to 1080 px ([Instagram Help](https://help.instagram.com/1631821640426723/?locale=en_US)).

**Through the Content Publishing API** — when a tool posts for you — an image must be JPEG, at most 8 MB, with an aspect ratio "within a 4:5 to 1.91:1 range", between 320 and 1440 pixels wide (scaled up or down to fit) and in sRGB ([Meta for Developers, IG User Media](https://developers.facebook.com/documentation/instagram-platform/instagram-graph-api/reference/ig-user/media), read 2026-11-06). The tallest ratio the API accepts is 4:5, not the 3:4 the app allows.

So for anything that may be posted automatically, stay between **4:5 and 1.91:1**. The presets that fit both sets of rules:

| Preset | Size | Ratio | Use |
|---|---|---|---|
| `portrait` | 1080×1350 | 4:5 | Single posts — the tallest the API takes, the most screen in the feed |
| `square` | 1080×1080 | 1:1 | Carousels, quote cards |
| `og` | 1200×630 | 1.91:1 | Landscape photos, rarely used in the feed |

Files come out at twice the preset size by default (`portrait` is 2160×2700); the API scales anything wider than 1440 px down, and a manual upload is scaled to 1080 px. Add `"scale": 1` if you want the file at exactly 1080 px wide.

## One post

```bash
curl -X POST "https://shareglint.com/v1/images?wait=true" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "template": "testimonial-stars",
    "size": "portrait",
    "format": "jpeg",
    "modifications": {
      "quote": "We cut our weekly reporting from a day to an hour.",
      "rating": "5",
      "name": "Ana Ruiz",
      "role": "Head of Ops",
      "company": "Northwind"
    }
  }'
```

`format: jpeg` is the important line: a PNG is fine for a manual upload, but Instagram's API rejects it — "JPEG is the only image format supported" ([Instagram content publishing](https://developers.facebook.com/documentation/instagram-platform/content-publishing)). JPEG quality is 85 by default; set `quality` up to 100 for type-heavy designs. The same values again return the same file for free.

## Carousels

A carousel is a cover, slides and a closing slide. Render them from the carousel templates, all in the **same size**: Instagram crops every carousel item "based on the first image in the carousel", 1:1 by default, and allows up to 20 items per carousel (Instagram content publishing documentation, above).

```bash
# Cover and end slide: one request each. Slides: one batch.
curl -X POST "https://shareglint.com/v1/batches" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "template": "carousel-slide",
    "sizes": ["square"],
    "format": "jpeg",
    "rows": [
      { "id": "2", "index": "2", "total": "6", "heading": "Measure one thing", "body": "Pick the number your team can move this month." },
      { "id": "3", "index": "3", "total": "6", "heading": "Write it down", "body": "A goal in a chat thread is a wish." }
    ]
  }'
```

`GET /v1/batches/{id}` returns each slide's URL with its `id`, so you can list them in carousel order. Rows per batch by plan: Free 50, Starter 500, Pro 1,000, Scale 2,000, Business 5,000.

## Publishing automatically

Shareglint makes the image; posting it is Instagram's API (or your scheduling tool, which uses that API). The flow Meta documents:

1. The account must be an Instagram **professional account** — business or creator ([Instagram Platform overview](https://developers.facebook.com/documentation/instagram-platform/overview)).
2. `POST /<IG_ID>/media` with `image_url` set to the rendered JPEG's URL creates a container. Meta fetches the file itself, so it "must be on a public server" — the URL from the render is.
3. `POST /<IG_ID>/media_publish` with `creation_id` set to the container's id publishes it.
4. For a carousel, create a container per item with `is_carousel_item=true`, then one `CAROUSEL` container listing their ids, then publish that.

Limits to plan around: containers expire after 24 hours, and the number of API-published posts per day is capped — the content publishing page says 100 posts in a 24-hour moving period in one place and 50 in its carousel notes (read 2026-11-06), so check `GET /<IG_ID>/content_publishing_limit` rather than relying on either.

No-code tools work the same way: in [n8n](https://shareglint.com/en/integrations/n8n) or [Make](https://shareglint.com/en/integrations/make) an HTTP step renders the JPEG and a second step posts its URL through Meta's API.

## Design notes

- **Text size.** The feed shows a post at a fraction of its pixel size; keep headlines short and large. Long text shrinks to fit its box in the built-in templates.
- **Brand.** `accent` and `theme` on every template keep a month of posts consistent.

## Cost

One render per image; a six-slide carousel is six renders, the same slides again are free. The Free plan's 100 renders a month carry a watermark. Starter is $9 a month for 2,000 renders ([pricing](https://shareglint.com/en/pricing)).

## What it does not do

- It does not post to Instagram or store your Instagram token; your code or scheduler does that with Meta's API.
- It does not write captions or hashtags.
- It does not apply Instagram filters, music or stickers — those exist only inside the app.
- It cannot post to personal accounts: Instagram's API is for professional accounts only.

## FAQ

### What size should an Instagram post image be?

Instagram keeps a photo uncropped when it is 320 to 1080 pixels wide with an aspect ratio between 1.91:1 and 3:4, so 1080 pixels wide and 566 to 1440 pixels tall. A 4:5 portrait (1080×1350) or a 1:1 square (1080×1080) are the usual choices.

### Can I post to Instagram automatically with the API?

Instagram's Content Publishing API can post images from a public URL to professional (business or creator) accounts. It takes JPEG only, aspect ratios from 4:5 to 1.91:1, up to 8 MB. Render the image as JPEG here, then pass its URL to Instagram's API.

### Why JPEG and not PNG?

Instagram's publishing API documentation says JPEG is the only image format it supports. A PNG works when you upload by hand in the app, but an automated post needs format jpeg.

### Can I make an Instagram carousel by API?

Yes. Render the cover, the slides and the closing slide from the carousel templates in the same size, then create a carousel container with Instagram's API. Instagram allows up to 20 items and crops every item to the first one's ratio.
