Python మరియు Node.js లో Instagram API: పని చేసే ఉదాహరణలు
Instagram API కి HTTPS తప్ప మరేమీ అవసరం లేదు, కాబట్టి Python యొక్క requests మరియు Node.js లోని అంతర్నిర్మిత fetch సరిపోతాయి: POST /<IG_ID>/media ఆ తర్వాత media_publish ప్రచురిస్తుంది; /<IG_MEDIA_ID>/comments మరియు /<IG_COMMENT_ID>/replies కామెంట్లను చదివి వాటికి జవాబిస్తాయి; /insights మెట్రిక్స్ ఇస్తుంది; వెబ్హుక్ను రా బాడీ యొక్క HMAC-SHA256 తో తనిఖీ చేస్తారు. ప్రతి లోపంలో code మరియు subcode ఉంటాయి, వాటి ఆధారంగా మళ్లీ ప్రయత్నించడం ఉపయోగపడుతుందో లేదో తెలుస్తుంది.
easyCoexistence అవే పనులను Claude, ChatGPT లేదా మీ స్వంత ఏజెంట్ కోసం MCP టూల్స్గా నడుపుతుంది, టోకెన్ను తన వైపే ఉంచుతూ: publish_instagram_post, reply_to_comment, get_social_insights మరియు set_social_webhook_destination, Meta యొక్క అధికారిక API పై.
తాజా Graph API వెర్షన్, 2026 జూలై 29న విడుదలైంది; v25.0 2028 జూలై 29 వరకు అందుబాటులో ఉంటుంది.
వీడియో కంటైనర్ యొక్క status_code ను ఎంత తరచుగా తనిఖీ చేయాలో Meta సూచిస్తుంది, గరిష్ఠంగా 5 నిమిషాల వరకు.
ఒక GET /<IG_MEDIA_ID>/comments అభ్యర్థన తిరిగి ఇవ్వగల గరిష్ఠ కామెంట్ల సంఖ్య; రిప్లైలు ఫీల్డ్ ఎక్స్పాన్షన్ ద్వారా మాత్రమే వస్తాయి.
తాత్కాలిక ప్రచురణ లోపం, దీనికి Meta 30 సెకన్ల నుండి 2 నిమిషాల లోపల 1 నుండి 2 సార్లు మళ్లీ ప్రయత్నించమని చెబుతుంది.
X-Hub-Signature-256 లోని ప్రిఫిక్స్, ఇది యాప్ సీక్రెట్ను కీగా ఉపయోగించి లెక్కించిన పేలోడ్ యొక్క HMAC-SHA256 కు ముందు వస్తుంది.
ఉదాహరణలకు ఏమేం కావాలి?
ఒక రన్టైమ్, ఒక టోకెన్, మరియు నాలుగు విలువలు. ఉదాహరణలు graph.instagram.com పై Instagram Login ద్వారా Instagram API ను పిలుస్తాయి; Unified Login యాప్ అదే పాత్లను ఖాతా ID తో ఉపయోగిస్తుంది, కానీ Facebook Login యొక్క Graph హోస్ట్పై, దాని Business Integration System User టోకెన్తో. Python కు requests ప్యాకేజ్ అవసరం, వెబ్హుక్ కోసం Flask కూడా; Node.js కు దాని అంతర్నిర్మిత fetch కోసం వెర్షన్ 18 లేదా ఆ తర్వాతది కావాలి.
- GRAPH: https://graph.instagram.com/v26.0, హోస్ట్ మరియు API వెర్షన్.
IG_ID: ప్రొఫెషనల్ ఖాతా ID, GET /me ఇచ్చేuser_id.- TOKEN: దీర్ఘకాలిక Instagram User యాక్సెస్ టోకెన్, సర్వర్లో మాత్రమే ఉంచాలి.
APP_SECRETమరియుVERIFY_TOKEN: వెబ్హుక్ అభ్యర్థనలను తనిఖీ చేయడానికి.
Python లో API ను ఎలా పిలిచి లోపాలను ఎలా నిర్వహించాలి?
ఒకే సహాయక ఫంక్షన్ ద్వారా, దీన్ని క్రింది Python ఉదాహరణలు పంచుకుంటాయి. అది టోకెన్ను access_token గా పంపుతుంది, Meta కోడ్, subcode మరియు fbtrace_id తో MetaError ను రైజ్ చేస్తుంది, మరియు Meta తాత్కాలికం అని పిలిచే వాటినే మళ్లీ ప్రయత్నిస్తుంది: కోడ్లు 1 మరియు 2, థ్రాటిలింగ్ కోడ్లు 4, 17 మరియు 80002, మరియు subcodes 2207001, 2207003, 2207008 మరియు 2207032. subcode 2207051 తో కోడ్ 4 అంటే స్పామ్ అనుమానం, కాబట్టి అది వెంటనే ఆగిపోతుంది.
import json
import time
import requests
GRAPH = "https://graph.instagram.com/v26.0"
IG_ID = "<IG_ID>" # user_id from GET /me
TOKEN = "<TOKEN>" # long-lived Instagram User access token, server side only
RETRY_CODES = {1, 2, 4, 17, 80002}
RETRY_SUBCODES = {2207001, 2207003, 2207008, 2207032}
class MetaError(Exception):
def __init__(self, error: dict, status: int):
super().__init__(error.get("message", f"HTTP {status}"))
self.code = error.get("code")
self.subcode = error.get("error_subcode")
self.fbtrace_id = error.get("fbtrace_id") # log it: Meta support asks for it
@property
def needs_new_token(self) -> bool:
return self.code in (102, 190)
@property
def retryable(self) -> bool:
if self.subcode == 2207051: # code 4 with this subcode is suspected spam: stop
return False
return self.code in RETRY_CODES or self.subcode in RETRY_SUBCODES
def wait_seconds(resp) -> int:
"""estimated_time_to_regain_access from X-Business-Use-Case-Usage, at least 60 s."""
try:
usage = json.loads(resp.headers.get("X-Business-Use-Case-Usage", "{}"))
minutes = max(e.get("estimated_time_to_regain_access", 0) for v in usage.values() for e in v)
except (ValueError, AttributeError, TypeError):
minutes = 0
return max(60, int(minutes) * 60)
def graph(method: str, path: str, attempts: int = 3, **params) -> dict:
if attempts < 1:
raise ValueError("attempts must be at least 1")
params["access_token"] = TOKEN
for attempt in range(1, attempts + 1):
resp = requests.request(method, f"{GRAPH}/{path}", params=params, timeout=30)
try:
data = resp.json()
except ValueError:
data = {}
if resp.ok and "error" not in data:
return data
err = MetaError(data.get("error", {}), resp.status_code)
if not err.retryable or attempt == attempts:
raise err
time.sleep(wait_seconds(resp))Node.js లో API ను ఎలా పిలిచి లోపాలను ఎలా నిర్వహించాలి?
Node.js 18 లేదా ఆ తర్వాతి వెర్షన్ కోసం అదే సహాయక ఫంక్షన్ ద్వారా, fetch ను ఉపయోగిస్తూ, డిపెండెన్సీలు లేకుండా. థ్రాటిల్ అయిన కాల్ estimated_time_to_regain_access కోసం వేచి ఉంటుంది, అంటే X-Business-Use-Case-Usage హెడర్లో Meta చెప్పే నిమిషాలు; ఆ హెడర్ లేకపోతే 60 సెకన్లు. ఎందుకంటే థ్రాటిల్ అయి ఉన్నప్పుడు చేసిన కాల్స్ను కూడా Meta లెక్కిస్తుంది. needsNewToken కోడ్లు 190 మరియు 102 ను ఫ్లాగ్ చేస్తుంది, వీటిని ఏ రీట్రై కూడా సరిచేయలేదు.
const GRAPH = "https://graph.instagram.com/v26.0";
const IG_ID = process.env.IG_ID; // user_id from GET /me
const TOKEN = process.env.TOKEN; // long-lived Instagram User access token, server side only
const RETRY_CODES = new Set([1, 2, 4, 17, 80002]);
const RETRY_SUBCODES = new Set([2207001, 2207003, 2207008, 2207032]);
export class MetaError extends Error {
constructor(error, status) {
super(error.message ?? `HTTP ${status}`);
this.code = error.code;
this.subcode = error.error_subcode;
this.fbtraceId = error.fbtrace_id; // log it: Meta support asks for it
}
get needsNewToken() {
return this.code === 190 || this.code === 102;
}
get retryable() {
if (this.subcode === 2207051) return false; // code 4 with this subcode is suspected spam: stop
return RETRY_CODES.has(this.code) || RETRY_SUBCODES.has(this.subcode);
}
}
export const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
// estimated_time_to_regain_access from X-Business-Use-Case-Usage, at least 60 s
function waitMs(res) {
try {
const usage = JSON.parse(res.headers.get("x-business-use-case-usage") ?? "{}");
const minutes = Math.max(0, ...Object.values(usage).flat().map((e) => e.estimated_time_to_regain_access ?? 0));
return Math.max(60, minutes * 60) * 1000;
} catch {
return 60_000;
}
}
export async function graph(method, path, params = {}, attempts = 3) {
const url = new URL(`${GRAPH}/${path}`);
for (const [key, value] of Object.entries({ ...params, access_token: TOKEN })) {
url.searchParams.set(key, String(value));
}
for (let attempt = 1; attempt <= attempts; attempt++) {
const res = await fetch(url, { method });
const data = await res.json().catch(() => ({}));
if (res.ok && !data.error) return data;
const err = new MetaError(data.error ?? {}, res.status);
if (!err.retryable || attempt === attempts) throw err;
await sleep(waitMs(res));
}
throw new Error("attempts must be at least 1");
}Python లో ఫోటో మరియు Reel ను ఎలా ప్రచురించాలి?
రెండూ కంటైనర్ ప్రవాహాన్ని అనుసరిస్తాయి. ఫోటో కంటైనర్ వెంటనే సిద్ధమవుతుంది, కాబట్టి దాని తర్వాతే media_publish వస్తుంది. Reel వీడియో ముందుగా ప్రాసెస్ అవుతుంది: Meta సూచించినట్లు, ఫంక్షన్ ప్రతి నిమిషానికి ఒకసారి status_code ను గరిష్ఠంగా 5 నిమిషాల వరకు తనిఖీ చేస్తుంది, FINISHED వచ్చినప్పుడు ప్రచురిస్తుంది, ERROR లేదా EXPIRED వస్తే ఆగిపోతుంది. చిత్రాలు JPEG అయి ఉండాలి, మీడియా ఒక పబ్లిక్ URL లో ఉండాలి.
# Uses graph(), IG_ID and time from the helper above
def publish_photo(image_url: str, caption: str) -> str:
"""A JPEG at a public URL: create the container, then publish it."""
container = graph("POST", f"{IG_ID}/media", image_url=image_url, caption=caption)
return graph("POST", f"{IG_ID}/media_publish", creation_id=container["id"])["id"]
def publish_reel(video_url: str, caption: str) -> str:
"""A Reel: publish once Meta has processed the video, checking once a minute."""
cid = graph("POST", f"{IG_ID}/media", media_type="REELS", video_url=video_url, caption=caption)["id"]
for _ in range(5): # Meta: once a minute, for no more than 5 minutes
time.sleep(60)
status = graph("GET", cid, fields="status_code")["status_code"]
if status == "FINISHED":
return graph("POST", f"{IG_ID}/media_publish", creation_id=cid)["id"]
if status in ("ERROR", "EXPIRED"):
raise RuntimeError(f"Container {cid} ended as {status}")
raise TimeoutError(f"Container {cid} is still processing: check it again later")Node.js లో ఫోటో మరియు Reel ను ఎలా ప్రచురించాలి?
అవే రెండు ఫంక్షన్లు, ప్రతి ఒక్కటీ కొత్త మీడియా ID ను తిరిగి ఇస్తుంది. ఐదు తనిఖీల తర్వాత కూడా IN_PROGRESS లో ఉన్న కంటైనర్ దాని సృష్టి తర్వాత 24 గంటల వరకు చెల్లుతుంది, కాబట్టి లోపం దాన్ని తర్వాత మళ్లీ తనిఖీ చేయమని చెబుతుంది; అలా ఖాతా యొక్క రోజుకు 400 పరిమితిని వృథా చేయకుండా ఉంటారు.
// Uses graph(), sleep() and IG_ID from the helper above
export async function publishPhoto(imageUrl, caption) {
const { id } = await graph("POST", `${IG_ID}/media`, { image_url: imageUrl, caption });
return (await graph("POST", `${IG_ID}/media_publish`, { creation_id: id })).id;
}
export async function publishReel(videoUrl, caption) {
const { id } = await graph("POST", `${IG_ID}/media`, { media_type: "REELS", video_url: videoUrl, caption });
for (let check = 0; check < 5; check++) {
await sleep(60_000); // Meta: once a minute, for no more than 5 minutes
const { status_code: status } = await graph("GET", id, { fields: "status_code" });
if (status === "FINISHED") return (await graph("POST", `${IG_ID}/media_publish`, { creation_id: id })).id;
if (status === "ERROR" || status === "EXPIRED") throw new Error(`Container ${id} ended as ${status}`);
}
throw new Error(`Container ${id} is still processing: check it again later`);
}Python లో కామెంట్లను ఎలా చదివి జవాబివ్వాలి?
GET /<IG_MEDIA_ID>/comments ఒక్కో అభ్యర్థనలో గరిష్ఠంగా 50 టాప్-లెవెల్ కామెంట్లను, కొత్తవి ముందు, తిరిగి ఇస్తుంది; POST /<IG_COMMENT_ID>/replies ఒక దానికి పబ్లిక్ రిప్లై పంపుతుంది. ఫంక్షన్ ప్రతి రిప్లైకి టెక్స్ట్ కోసం మీ కాల్బ్యాక్ను అడుగుతుంది, ఏ టెక్స్ట్ తిరిగి రాకపోతే ఆ కామెంట్ను దాటేస్తుంది. దాచిన కామెంట్లకు రిప్లై ఇవ్వలేరు, రిప్లైకి రిప్లై ఇస్తే అది టాప్-లెవెల్ కామెంట్పైనే వస్తుంది.
# Uses graph() from the helper above
def reply_to_comments(media_id: str, write_reply) -> int:
"""Reply in public to each comment write_reply returns text for."""
page = graph("GET", f"{media_id}/comments", fields="id,text,username,timestamp")
sent = 0
for comment in page.get("data", []):
text = write_reply(comment)
if text:
graph("POST", f"{comment['id']}/replies", message=text)
sent += 1
return sent
# Example: reply to questions about price
reply_to_comments("<IG_MEDIA_ID>", lambda c: "Prices are in our bio link." if "price" in c["text"].lower() else None)Node.js లో కామెంట్లను ఎలా చదివి జవాబివ్వాలి?
Node.js లోని అదే లూప్. రెండు కాల్స్కు instagram_business_basic మరియు instagram_business_manage_comments అనుమతులు కావాలి, మరియు username ఫీల్డ్కు రెండోది అవసరం. బదులుగా ప్రైవేట్గా రిప్లై ఇవ్వాలంటే, POST /<IG_ID>/messages లో recipient.comment_id పంపితే, కామెంట్ చేసిన వ్యక్తికి ఒక DM వెళ్తుంది, కామెంట్ తేదీ నుండి 7 రోజుల్లోపు; వారు జవాబిచ్చే వరకు తదుపరి మెసేజ్ వేచి ఉంటుంది.
// Uses graph() from the helper above
// Reply in public to each comment writeReply returns text for
export async function replyToComments(mediaId, writeReply) {
const { data = [] } = await graph("GET", `${mediaId}/comments`, { fields: "id,text,username,timestamp" });
let sent = 0;
for (const comment of data) {
const text = writeReply(comment);
if (text) {
await graph("POST", `${comment.id}/replies`, { message: text });
sent++;
}
}
return sent;
}
// Example: reply to questions about price
await replyToComments("<IG_MEDIA_ID>", (c) => (/price/i.test(c.text) ? "Prices are in our bio link." : null));Python లో ఇన్సైట్స్ ఎలా చదవాలి?
ఖాతా ఇన్సైట్స్కు period=day మరియు metric_type=total_value కావాలి, మరియు ప్రతి మెట్రిక్ total_value.value ను ఇస్తుంది; పోస్ట్ ఇన్సైట్స్ values[0].value ను ఇస్తాయి. ఉదాహరణ ఖాతాపై reach, views మరియు accounts_engaged, పోస్ట్ లేదా Reel పై reach, views, likes, comments, saved మరియు shares అడుగుతుంది, ఇవి Meta రిఫరెన్స్ రెండింటికీ జాబితా చేస్తుంది. డేటా లేని మెట్రిక్ను 0 గా ఇవ్వకుండా వదిలేస్తుంది.
# Uses graph() and IG_ID from the helper above
def account_insights() -> dict:
"""Reach, views and accounts engaged over the last 24 hours."""
data = graph("GET", f"{IG_ID}/insights", metric="reach,views,accounts_engaged",
period="day", metric_type="total_value")["data"]
return {m["name"]: m["total_value"]["value"] for m in data}
def post_insights(media_id: str) -> dict:
"""Totals for one post or Reel."""
data = graph("GET", f"{media_id}/insights", metric="reach,views,likes,comments,saved,shares")["data"]
return {m["name"]: m["values"][0]["value"] for m in data}Node.js లో ఇన్సైట్స్ ఎలా చదవాలి?
Node.js లో అవే రెండు అభ్యర్థనలు, ప్రతి ఒక్కటీ మెట్రిక్ పేరు కీగా గల ఒక ఆబ్జెక్ట్ ఇస్తుంది. రెండింటిలోనూ బ్రేక్డౌన్ పంపరు: ఒక మెట్రిక్ మద్దతు ఇవ్వని బ్రేక్డౌన్ అడిగితే అభ్యర్థన unknown లోపంతో విఫలమవుతుందని Meta హెచ్చరిస్తుంది, మరియు ఇన్సైట్స్ డేటా 48 గంటల వరకు ఆలస్యం కావచ్చు, కాబట్టి ఇటీవలి పోస్ట్లను తర్వాత మళ్లీ చదవండి.
// Uses graph() and IG_ID from the helper above
// Reach, views and accounts engaged over the last 24 hours
export async function accountInsights() {
const { data } = await graph("GET", `${IG_ID}/insights`, {
metric: "reach,views,accounts_engaged",
period: "day",
metric_type: "total_value",
});
return Object.fromEntries(data.map((m) => [m.name, m.total_value?.value]));
}
// Totals for one post or Reel
export async function postInsights(mediaId) {
const { data } = await graph("GET", `${mediaId}/insights`, { metric: "reach,views,likes,comments,saved,shares" });
return Object.fromEntries(data.map((m) => [m.name, m.values?.[0]?.value]));
}Python లో వెబ్హుక్ ను ఎలా ధృవీకరించాలి?
Flask తో, ఒకే మార్గంలో రెండు రూట్లు. GET Meta యొక్క ధృవీకరణ అభ్యర్థనకు జవాబిస్తుంది: hub.mode subscribe అయి, hub.verify_token సరిపోలితే, hub.challenge ను సాదా టెక్స్ట్గా ఇస్తుంది, లేకపోతే 403. POST sha256= మరియు యాప్ సీక్రెట్తో రా బాడీ యొక్క HMAC-SHA256 ను లెక్కిస్తుంది, దాన్ని X-Hub-Signature-256 తో స్థిరమైన సమయంలో పోలుస్తుంది, మరియు ఏ నెమ్మది పని మొదలయ్యే ముందే 200 ఇస్తుంది.
import hashlib
import hmac
import json
import os
from queue import Queue
from flask import Flask, abort, request
app = Flask(__name__)
VERIFY_TOKEN = os.environ["VERIFY_TOKEN"]
APP_SECRET = os.environ["APP_SECRET"].encode()
jobs: Queue = Queue() # swap for your own job queue
@app.get("/webhooks/instagram")
def verify():
"""Meta's verification request: send hub.challenge back when the token matches."""
args = request.args
if args.get("hub.mode") == "subscribe" and args.get("hub.verify_token") == VERIFY_TOKEN:
return args.get("hub.challenge", ""), 200, {"Content-Type": "text/plain"}
abort(403)
@app.post("/webhooks/instagram")
def receive():
"""An event: check X-Hub-Signature-256 over the raw bytes, then answer at once."""
raw = request.get_data()
expected = b"sha256=" + hmac.new(APP_SECRET, raw, hashlib.sha256).hexdigest().encode()
if not hmac.compare_digest(expected, request.headers.get("X-Hub-Signature-256", "").encode()):
abort(401)
for entry in json.loads(raw).get("entry", []):
jobs.put(entry) # slow work happens elsewhere; Meta wants a quick 200
return "", 200Node.js లో వెబ్హుక్ ను ఎలా ధృవీకరించాలి?
అంతర్నిర్మిత http మాడ్యూల్తో, ఫ్రేమ్వర్క్ లేకుండా. ఏదైనా పార్స్ చేయడానికి ముందే బాడీ రా బైట్స్గా సేకరిస్తారు, ఎందుకంటే పార్స్ చేసి మళ్లీ సీరియలైజ్ చేసిన బాడీ Meta లెక్కించిన సిగ్నేచర్తో సరిపోదు. Meta విఫలమైన నోటిఫికేషన్ను 36 గంటల వరకు మళ్లీ పంపుతుంది, కాబట్టి హ్యాండ్లర్ ఇప్పటికే ప్రాసెస్ చేసిన ఈవెంట్లను కూడా దాటేయాలి.
import crypto from "node:crypto";
import http from "node:http";
const { VERIFY_TOKEN, APP_SECRET } = process.env;
const PATH = "/webhooks/instagram";
const jobs = []; // swap for your own job queue
http
.createServer((req, res) => {
const url = new URL(req.url, "http://localhost");
if (url.pathname !== PATH) return res.writeHead(404).end();
if (req.method === "GET") {
// Meta's verification request: send hub.challenge back when the token matches
const ok =
url.searchParams.get("hub.mode") === "subscribe" &&
url.searchParams.get("hub.verify_token") === VERIFY_TOKEN;
return res
.writeHead(ok ? 200 : 403, { "Content-Type": "text/plain" })
.end(ok ? url.searchParams.get("hub.challenge") ?? "" : "");
}
const chunks = [];
req.on("data", (chunk) => chunks.push(chunk));
req.on("end", () => {
const raw = Buffer.concat(chunks); // the exact bytes Meta signed
const expected = Buffer.from("sha256=" + crypto.createHmac("sha256", APP_SECRET).update(raw).digest("hex"));
const given = Buffer.from(req.headers["x-hub-signature-256"] ?? "");
if (given.length !== expected.length || !crypto.timingSafeEqual(given, expected)) {
return res.writeHead(401).end();
}
res.writeHead(200).end(); // answer first, work after
try {
for (const entry of JSON.parse(raw.toString("utf8")).entry ?? []) jobs.push(entry);
} catch {
// not JSON: nothing to queue
}
});
})
.listen(3000);కోడ్ ఏ Meta లోపాలను మళ్లీ ప్రయత్నించాలి?
తాత్కాలికమైనవి మాత్రమే, ఎందుకంటే మిగతావి ఏదైనా మారేవరకు అదే సమాధానం ఇస్తాయి: ఫైల్, URL, అనుమతి లేదా ఖాతా స్థితి. పైన ఉన్న సహాయకులు వేరు చేసే ప్రతి కోడ్ కోసం ఏం చేయాలో Meta లోపం రిఫరెన్స్లు చెబుతాయి:
అదే కోడ్ను easyCoexistence క్రెడెన్షియల్స్పై ఎలా నడపాలి?
easyCoexistence టోకెన్పై దీన్ని నడపలేరు: Instagram టోకెన్లు ఎప్పుడూ ఇవ్వబడవు (Meta నిబంధనలు), కాబట్టి get_social_credentials మరియు Partner API యొక్క GET /api/v1/channels/:id?credentials=1 టోకెన్ లేకుండా ఖాతా ID మరియు API బేస్ను ఇస్తాయి. బదులుగా అవే పనులు MCP టూల్స్గా నడుస్తాయి, Claude, ChatGPT లేదా మరో MCP క్లయింట్ ద్వారా, మరియు పైన ఉన్న సహాయకులు మీ స్వంత Meta యాప్ టోకెన్పై మార్పు లేకుండా నడుస్తాయి.
{
"platform": "instagram",
"graph_api_base": "https://graph.instagram.com/<VERSION>",
"account_id_on_meta": "<IG_ID>",
"access_token": null,
"token_note": "Meta's terms do not allow handing this account's access token to other apps, so it is not shown. ..."
}అదే పనులను MCP కనెక్టర్ ద్వారా ఎలా చేయాలి?
అసిస్టెంట్ను అడగడం ద్వారా, లేదా టూల్స్ను మీరే పిలవడం ద్వారా. publish_instagram_post కంటైనర్ సృష్టించి ప్రచురిస్తుంది, వీడియో ప్రాసెస్ అయ్యే వరకు వేచి ఉంటుంది, లేదా scheduled_at తో 90 రోజుల వరకు ముందుగానే షెడ్యూల్ చేస్తుంది; reply_to_comment పబ్లిక్గా జవాబిస్తుంది, లేదా private ను true గా ఉంచితే DM ద్వారా ప్రైవేట్గా; get_social_insights మెట్రిక్ పేర్లను నేరుగా Meta కు పంపుతుంది; set_social_webhook_destination కామెంట్లు, మెన్షన్లు మరియు DMలను మీ ఎండ్పాయింట్కు X-EC-Signature తో సంతకం చేసి ఫార్వర్డ్ చేస్తుంది.
[
{
"name": "publish_instagram_post",
"arguments": {
"account_id": "<from list_social_accounts>",
"type": "REELS",
"video_url": "https://cdn.example.com/launch.mp4",
"caption": "Launch day.",
"scheduled_at": "2026-11-06T09:00:00-03:00"
}
},
{
"name": "list_social_comments",
"arguments": { "account_id": "<ACCOUNT_ID>", "post_id": "<IG_MEDIA_ID>" }
},
{
"name": "reply_to_comment",
"arguments": { "account_id": "<ACCOUNT_ID>", "comment_id": "<IG_COMMENT_ID>", "text": "Prices are in our bio link." }
},
{
"name": "get_social_insights",
"arguments": {
"account_id": "<ACCOUNT_ID>",
"metrics": ["reach", "views", "accounts_engaged"],
"period": "day",
"params": { "metric_type": "total_value" }
}
},
{
"name": "set_social_webhook_destination",
"arguments": { "account_id": "<ACCOUNT_ID>", "url": "https://hooks.example.com/instagram" }
}
]సాధారణ పొరపాట్లు
- పార్స్ చేసిన JSON ను హ్యాష్ చేయడం. Meta రా బైట్స్పై సంతకం చేస్తుంది, కాబట్టి ఫ్రేమ్వర్క్ యొక్క JSON బాడీ పార్సర్ X-Hub-Signature-256 తనిఖీని విరగ్గొడుతుంది; రా బాడీని ఉంచి, తర్వాత పార్స్ చేయండి.
- టైమ్అవుట్ తర్వాత చూడకుండా media_publish ను మళ్లీ పిలవడం. కంటైనర్ status_code PUBLISHED అని చదివితే, పోస్ట్ ఇప్పటికే లైవ్ లో ఉంది.
- subcode లేకుండా కోడ్ 4 ను థ్రాటిలింగ్ గా చదవడం. 2207051 తో అది Instagram స్పామ్ అనుమానిస్తోందని అర్థం, మరియు రీట్రై అది ఇప్పుడే పరిమితం చేసిన చర్యనే మళ్లీ చేస్తుంది.
- యాప్ సీక్రెట్ లేదా టోకెన్ ను బ్రౌజర్ లేదా మొబైల్ కోడ్ నుండి పంపడం. యాప్ సీక్రెట్ ఉన్న అభ్యర్థనలు సర్వర్-సైడ్ కోడ్లోనే ఉండాలని Meta చెబుతుంది.
ప్రతి కనెక్షన్కు నెలకు US$ 9 నుండి US$ 0.75 వరకు, మీరు కనెక్షన్లు జోడించే కొద్దీ తగ్గుతుంది, మొదటి 3 రోజులు ఉచితం.
తరచుగా అడిగే ప్రశ్నలు
Instagram API ను పిలవడానికి నాకు SDK కావాలా?
లేదు. ప్రతి కాల్ యాక్సెస్ టోకెన్తో కూడిన HTTPS అభ్యర్థన, కాబట్టి ఈ పేజీలోని ఉదాహరణలు చూపినట్లు Python లో requests లేదా Node.js లో fetch సరిపోతాయి.
Reel కంటైనర్ సృష్టించిన వెంటనే media_publish ఎందుకు విఫలమవుతుంది?
వీడియో ఇంకా ప్రాసెస్ అవుతోంది: లోపం 9007, subcode 2207027. కంటైనర్ status_code ను ప్రతి నిమిషానికి ఒకసారి తనిఖీ చేసి, FINISHED అని చదివినప్పుడు ప్రచురించండి.
కోడ్ ఏ API వెర్షన్ ఉపయోగించాలి?
Meta ఇప్పటికీ అందిస్తున్న వెర్షన్ను ఉపయోగించండి: v26.0 తాజాది, ప్రతి వెర్షన్ కనీసం రెండేళ్లు ఉంటుంది. తొలగించిన వెర్షన్కు చేసిన కాల్ ఇంకా అందుబాటులో ఉన్న తర్వాతి పాత వెర్షన్పై నడుస్తుంది.
Instagram ఖాతా కోసం easyCoexistence API యాక్సెస్ ఎంత ఖర్చు అవుతుంది?
ప్రతి Instagram ఖాతా ఒక కనెక్షన్: నెలకు ప్రతి కనెక్షన్కు US$ 9 నుండి US$ 0.75 వరకు, మీరు కనెక్షన్లు జోడించే కొద్దీ తగ్గుతుంది, మొదటి 3 రోజులు ఉచితం.
చదవడం కొనసాగించండి
మీ మొదటి ఛానెల్ను రెండు నిమిషాల్లో కనెక్ట్ చేయండి.
ప్లాట్ఫామ్ సమీక్షల కోసం ఎదురుచూడాల్సిన అవసరం లేదు. WhatsApp, Instagram, TikTok లేదా మరో ఛానెల్ను కనెక్ట్ చేయండి, ఆపై పోస్ట్ చేయమని, ప్రత్యుత్తరం ఇవ్వమని లేదా రిపోర్ట్ ఇవ్వమని మీ AIకి చెప్పండి, అది పని చేయడం చూడండి.
- 3 రోజులు ఉచితం
- ఎప్పుడైనా రద్దు చేయండి
- అధికారిక APIలు మాత్రమే
- 24/7 పర్యవేక్షణ
ధృవీకరించిన తేదీ