Quick start · Instagram
Instagram WebSocket API quick start
Connect one WebSocket with your API key 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.
- WebSocket
wss://1322.io/IG?key={api_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
- One API key covers REST and the WebSocket. Copy it from the API access page in your dashboard.
- REST: send
X-API-Key: <key>orAuthorization: Bearer <key>. Every endpoint, including/v1/health, needs it. - WebSocket: the same key as
?key=onwss://1322.io/IG. 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_API_KEY: your Instagram API key
# pip install "websockets>=13" (Python 3.9+)
import asyncio, json, os
from websockets.asyncio.client import connect
WS_URL = "wss://1322.io/IG?key=" + os.environ["IG_API_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"
const API_KEY = process.env.IG_API_KEY
if (!API_KEY) throw new Error("Set IG_API_KEY")
const WS_URL = "wss://1322.io/IG?key=" + encodeURIComponent(API_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
InstagramPostobject. - 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"
}
}keyis the post ID: dedupe on it. Fields such asis_collab,collab_with,is_pinned,is_paid_partnershipandlocationappear only when the post has that context.- In
media, usemedia_roleto tell images, videos and video covers apart, and pair a video with its cover throughcover_media_index.
Manage the list over REST
REST base https://1322.io. Each call below sends X-API-Key with your API key.
| Method | Path | What it does |
|---|---|---|
| GET | /v1/list | The Instagram accounts you track. |
| GET | /v1/limits | Current count, max_tracked and your per-key request rate (rpm). |
| POST | /v1/track | Add an account. Checks that it exists first. |
| POST | /v1/untrack | Remove an account. |
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/trackcan returnlist_full,already_tracked,invalid_userorstorage_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
- X (Twitter) WebSocket quick start: Tweets, deletes, profile and follow events
- Truth Social WebSocket quick start: Posts, retruths, quotes and media
- YouTube WebSocket quick start: Uploads, Shorts and deletions
- TikTok WebSocket quick start: Uploads, reposts, LIVE start and end
- Binance Square WebSocket quick start: Posts, pin changes and sentiment
- News WebSocket quick start: Full-text articles from news feeds
Related: