Skip to main content
API reference

Quick start · Instagram

Instagram WebSocket API quick start

Connect to your Instagram stream and receive posts, Reels, carousels and Stories from the public accounts you track as JSON. This page gets a consumer running; the API reference holds every field.

From $300/month for 5 accounts · WebSocket included · ~350ms median
WebSocket
wss://1322.io{ws_path}?key={ws_key}
REST base
https://1322.io
Auth
X-API-Key or Authorization: Bearer
Updated

What you get

Posts, Reels, carousels and Stories from the public Instagram accounts on your list, one JSON object per post. post_type tells you which. When the post has them, events also carry hashtags, mentions (coauthors included), collab, paid partnership, pinned and location.

Around 350ms median in typical operation. The Discord bot is included in every plan alongside the WebSocket.

Price: From $300/month for 5 accounts; WebSocket included. Plans: Lite $300/month (5 accounts), Standard $550/month (15 accounts), Pro $750/month (30 accounts). Pay monthly, or prepay 3 months (10% off), 6 months (15% off) or a year (25% off). See Instagram pricing.

Authentication

  • REST uses your API key. Copy it from the API access page in your dashboard.
  • REST: send X-API-Key: <key> or Authorization: Bearer <key>. Every endpoint, including /v1/health, needs it.
  • WebSocket: your account has its own path and a separate WS key, not the API key. GET /v1/dashboard returns them as ws_url and ws_key: connect to ws_url?key=<ws_key>. Copy URL on the Workspace page gives the same URL with the key in it. You do not need a Meta developer app or an Instagram login.

Connect to the WebSocket

Set these environment variables, then run either consumer from your server:

  • IG_WS_URL: ws_url from GET /v1/dashboard
  • IG_WS_KEY: ws_key from GET /v1/dashboard
  • IG_API_KEY: your API key (REST only)
# pip install "websockets>=13"   (Python 3.9+)
import asyncio, json, os
from websockets.asyncio.client import connect

# ws_url and ws_key from GET /v1/dashboard (or the Copy URL value on the Workspace page)
WS_URL = os.environ["IG_WS_URL"] + "?key=" + os.environ["IG_WS_KEY"]

def handle(post):
    if post.get("platform") != "instagram":
        return
    print(post.get("post_type"), post.get("username"), (post.get("text") or "")[:80])

async def main():
    backoff = 1
    while True:
        try:
            async with connect(WS_URL) as ws:
                backoff = 1
                async for raw in ws:
                    try:
                        event = json.loads(raw)
                    except ValueError:
                        continue
                    if isinstance(event, dict):
                        handle(event)
        except Exception as exc:
            print("disconnected:", exc)
        await asyncio.sleep(backoff)
        backoff = min(backoff * 2, 30)

asyncio.run(main())
// npm install ws, save as consumer.mjs, run: node consumer.mjs   (Node 18+)
import WebSocket from "ws"

// ws_url and ws_key from GET /v1/dashboard (or the Copy URL value on the Workspace page)
const BASE_URL = process.env.IG_WS_URL
const WS_KEY = process.env.IG_WS_KEY
if (!BASE_URL || !WS_KEY) throw new Error("Set IG_WS_URL and IG_WS_KEY")
const WS_URL = BASE_URL + "?key=" + encodeURIComponent(WS_KEY)

function handle(post) {
  if (post.platform !== "instagram") return
  console.log(post.post_type, post.username, (post.text ?? "").slice(0, 80))
}

let backoff = 1000

function connect() {
  const ws = new WebSocket(WS_URL)
  ws.on("open", () => { backoff = 1000 })
  ws.on("message", (raw) => {
    let event
    try { event = JSON.parse(raw.toString()) } catch { return }
    if (event && typeof event === "object" && !Array.isArray(event)) handle(event)
  })
  ws.on("error", (err) => console.error("socket error:", err.message))
  ws.on("close", () => {
    setTimeout(connect, backoff)
    backoff = Math.min(backoff * 2, 30000)
  })
}

connect()
  • Each message is one InstagramPost object.
  • There is no backfill: the stream starts from the moment an account is tracked, and events are not queued while you are disconnected.

One example frame

Illustrative values for fictional accounts, trimmed to the fields most consumers read first. A real frame carries the full set for your tracked accounts.

{
  "platform": "instagram",
  "username": "examplebrand",
  "display_name": "Example Brand",
  "user_avatar": "https://example.com/avatar.jpg",
  "user_followers": 48210,
  "user_id": "1234567890",
  "key": "3456789012345678901",
  "timestamp": "2026-10-15T14:03:21Z",
  "seen_at": "2026-10-15T14:03:22Z",
  "text": "Drop 02 lands Friday #drop02 @examplestudio",
  "post_type": "post",
  "media_count": 1,
  "hashtags": [
    "drop02"
  ],
  "mentions": [
    "examplestudio"
  ],
  "media": [
    {
      "kind": "image",
      "kind_v2": "image",
      "media_role": "image",
      "media_index": 0,
      "url": "https://example.com/media/drop02.jpg",
      "width": 1080,
      "height": 1350,
      "created_at": "2026-10-15T14:03:21Z"
    }
  ],
  "location": {
    "name": "Example Studio"
  }
}
  • key is the post ID: dedupe on it. Fields such as is_collab, collab_with, is_pinned, is_paid_partnership and location appear only when the post has that context.
  • In media, use media_role to tell images, videos and video covers apart, and pair a video with its cover through cover_media_index.

Manage the list over REST

REST base https://1322.io. Each call below sends X-API-Key with your API key.

MethodPathWhat it does
GET/v1/dashboardStatus, limits, tracked accounts, ws_url and ws_key.
GET/v1/listThe Instagram accounts you track.
GET/v1/limitsCurrent count, max_tracked and your per-key request rate (rpm).
POST/v1/trackAdd an account. Checks that it exists first.
POST/v1/untrackRemove an account.
curl "https://1322.io/v1/dashboard" \
  -H "X-API-Key: $IG_API_KEY"

curl "https://1322.io/v1/list" \
  -H "X-API-Key: $IG_API_KEY"

curl "https://1322.io/v1/limits" \
  -H "X-API-Key: $IG_API_KEY"

curl -X POST "https://1322.io/v1/track" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $IG_API_KEY" \
  -d '{ "username": "examplebrand" }'

curl -X POST "https://1322.io/v1/untrack" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $IG_API_KEY" \
  -d '{ "username": "examplebrand" }'
  • POST /v1/track can return list_full, already_tracked, invalid_user or storage_error. The dashboard and the Discord bot manage the same list.

Full reference

Every field, endpoint and edge case for Instagram lives in the API reference. Jump straight to the part you need:

Common questions

Is the WebSocket included in Instagram plans?

Yes. Every Instagram plan includes WebSocket delivery, REST list management and the Discord bot.

Do I need a Meta developer app?

No. You authenticate with your 1322 API key. No Meta developer app or Instagram credentials are needed.

Is there backfill?

No. It is a real-time stream from the moment an account is tracked, not a historical archive.

Other quick starts