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 அளவீடுகளைத் தருகிறது; ஒரு வெப்ஹூக் கோரிக்கை, raw body-இன் 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 பதிப்பு 29 July 2026 அன்று அறிமுகமானது; v25.0 29 July 2028 வரை கிடைக்கும்.
வீடியோ கன்டெய்னரின் status_code-ஐ Meta எவ்வளவு அடிக்கடி சரிபார்க்கச் சொல்கிறது, அதிகபட்சம் 5 நிமிடங்கள் வரை.
ஒரே GET /<IG_MEDIA_ID>/comments கோரிக்கை தரக்கூடிய அதிகபட்ச கருத்துகள்; பதில்கள் field expansion வழியாக மட்டுமே வரும்.
தற்காலிக வெளியீட்டுப் பிழை; இதற்கு Meta 30 வினாடியிலிருந்து 2 நிமிடத்திற்குள் 1 முதல் 2 முறை மீண்டும் முயல வேண்டும் என்கிறது.
X-Hub-Signature-256-இல் உள்ள முன்னொட்டு; இது app secret-ஐப் பயன்படுத்தி பேலோட்டின் HMAC-SHA256-க்கு முன் வருகிறது.
எடுத்துக்காட்டுகளுக்கு என்ன தேவை?
ஒரு runtime, ஒரு டோக்கன் மற்றும் நான்கு மதிப்புகள் தேவை. எடுத்துக்காட்டுகள் graph.instagram.com-இல் Instagram Login மூலம் Instagram API-ஐ அழைக்கின்றன; Unified Login ஆப் அதே பாதைகளை, கணக்கின் ID-உடன், Facebook Login-இன் Graph host-இல், அதன் Business Integration System User டோக்கனுடன் பயன்படுத்துகிறது. Python-க்கு requests தொகுப்பும், வெப்ஹூக்கிற்கு Flask-உம் தேவை; Node.js-க்கு அதன் உள்ளமைந்த fetch-க்காக பதிப்பு 18 அல்லது அதற்கு மேல் தேவை.
- GRAPH: https://graph.instagram.com/v26.0, host மற்றும் API பதிப்பு.
IG_ID: தொழில்முறை கணக்கின் ID; GET /me திருப்பித் தரும்user_idஇது.- TOKEN: நீண்ட கால Instagram User access டோக்கன்; சர்வரில் வைக்கப்படும்.
APP_SECRETமற்றும்VERIFY_TOKEN: வெப்ஹூக் கோரிக்கைகளைச் சரிபார்க்க.
Python-இல் API-ஐ எவ்வாறு அழைத்து பிழைகளைக் கையாள்வது?
ஒரே ஒரு உதவிச் செயல்பாட்டின் மூலம், Python எடுத்துக்காட்டுகள் அனைத்தும் இதைப் பகிர்ந்து கொள்கின்றன. அது டோக்கனை access_token ஆக அனுப்புகிறது, Meta-வின் code, subcode மற்றும் fbtrace_id-உடன் MetaError-ஐ எழுப்புகிறது, மேலும் Meta தற்காலிகமானது என்று சொல்பவற்றை மட்டுமே மீண்டும் முயல்கிறது: code 1 மற்றும் 2, throttling code-கள் 4, 17 மற்றும் 80002, subcode-கள் 2207001, 2207003, 2207008 மற்றும் 2207032. Code 4 உடன் subcode 2207051 இருந்தால் அது சந்தேகிக்கப்படும் spam என்று பொருள், எனவே உடனே நிறுத்தப்படும்.
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-ஐப் பயன்படுத்தி, எந்த dependencies-உம் இல்லாமல். வேகவரம்புக்கு உட்பட்ட அழைப்பு, estimated_time_to_regain_access காட்டும் நிமிடங்கள் வரை காத்திருக்கும்; அது X-Business-Use-Case-Usage தலைப்பில் Meta அறிவிக்கும் நிமிடங்கள், இல்லையெனில் 60 வினாடிகள். ஏனெனில் வேகவரம்பின்போது செய்யப்படும் அழைப்புகளையும் Meta கணக்கில் கொள்கிறது. needsNewToken, எந்த மறுமுயற்சியாலும் சரிசெய்ய முடியாத 190 மற்றும் 102 code-களைக் குறிக்கிறது.
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-ஐயும் எவ்வாறு வெளியிடுவது?
அதே இரண்டு செயல்பாடுகள், ஒவ்வொன்றும் புதிய media 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 ஒன்றுக்குப் பொதுப் பதிலை இடும். செயல்பாடு ஒவ்வொரு பதிலின் உரைக்காக உங்கள் callback-ஐக் கேட்கிறது, எதுவும் திருப்பி வராத கருத்துகளைத் தவிர்க்கிறது. மறைக்கப்பட்ட கருத்துகளுக்குப் பதிலளிக்க முடியாது; பதிலுக்குப் பதில் மேல்நிலைக் கருத்தின் கீழேயே சேரும்.
# 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 புலத்திற்கு இரண்டாவது தேவை. அதற்குப் பதில் தனிப்பட்ட முறையில் பதிலளிக்க, recipient.comment_id-உடன் POST /<IG_ID>/messages அனுப்பினால், கருத்துரைப்பவருக்கு ஒரு 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-இல் insights-ஐ எவ்வாறு படிப்பது?
கணக்கின் insights, period=day மற்றும் metric_type=total_value உடன் எடுக்கப்படும்; அப்போது ஒவ்வொரு அளவீடும் total_value.value-வைத் தரும். ஒரு பதிவின் insights, 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-இல் insights-ஐ எவ்வாறு படிப்பது?
Node.js-இல் அதே இரண்டு கோரிக்கைகள், ஒவ்வொன்றும் அளவீட்டுப் பெயரால் குறிக்கப்பட்ட ஒரு object-ஐத் திருப்பும். இரண்டிலும் breakdown அனுப்பப்படுவதில்லை: ஒரு அளவீடு ஆதரிக்காத breakdown-ஐக் கேட்டால் கோரிக்கை unknown error-உடன் தோல்வியடையும் என்று Meta எச்சரிக்கிறது; insights தரவு 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 உடன், ஒரே பாதையில் இரண்டு routes மூலம். GET, Meta-வின் சரிபார்ப்புக் கோரிக்கைக்குப் பதிலளிக்கிறது: hub.mode subscribe ஆகவும் hub.verify_token பொருந்தினாலும், hub.challenge-ஐ எளிய உரையாகத் திருப்பும்; இல்லையெனில் 403. POST, raw body-இன் HMAC-SHA256-ஐ app secret கொண்டு கணக்கிட்டு, sha256= முன்னொட்டுடன் சேர்த்து, X-Hub-Signature-256-உடன் constant time-இல் ஒப்பிடுகிறது; மெதுவான வேலை தொடங்குவதற்கு முன்பே 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-இல் வெப்ஹூக்கைச் சரிபார்ப்பது எப்படி?
கட்டமைப்பு (framework) இல்லாமல், உள்ளமைந்த http module-ஐக் கொண்டு. எதையும் பாகுபடுத்துவதற்கு முன்பே body மூல bytes ஆகச் சேகரிக்கப்படுகிறது; ஏனெனில் பாகுபடுத்தி மீண்டும் தொடர்வரிசைப்படுத்திய body, 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 பிழைகளுக்கு code மீண்டும் முயல வேண்டும்?
தற்காலிகமானவற்றுக்கு மட்டுமே, ஏனெனில் மற்றவை எதுவும் மாறும் வரை அதே பதிலையே தரும்: கோப்பு, URL, அனுமதி அல்லது கணக்கின் நிலை. மேலுள்ள உதவிச் செயல்பாடுகள் வேறுபடுத்தும் ஒவ்வொரு code-க்கும் Meta-வின் பிழைக் குறிப்புகள் எடுக்க வேண்டிய நடவடிக்கையைத் தருகின்றன:
easyCoexistence-இன் credentials-இல் அதே குறியீட்டை எவ்வாறு இயக்குவது?
easyCoexistence-இன் டோக்கனில் இதை இயக்க முடியாது: Instagram டோக்கன்கள் ஒருபோதும் வழங்கப்படுவதில்லை (Meta-வின் விதிமுறைகள்), எனவே get_social_credentials மற்றும் Partner API-இன் GET /api/v1/channels/:id?credentials=1 கணக்கின் ID மற்றும் API base-ஐ டோக்கன் இல்லாமல் திருப்புகின்றன. அதற்குப் பதிலாக அதே வேலைகளை Claude, ChatGPT அல்லது வேறு MCP client வழியாக 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 connector மூலம் எவ்வாறு செய்வது?
உதவியாளரிடம் கேட்பதன் மூலம், அல்லது கருவிகளை நீங்களே அழைப்பதன் மூலம். publish_instagram_post கன்டெய்னரை உருவாக்கி வெளியிடுகிறது, வீடியோ செயலாகும்போது காத்திருக்கிறது, அல்லது 90 நாட்கள் வரை முன்னதாக scheduled_at-உடன் திட்டமிடுகிறது; 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-ஐ hash செய்தல். Meta மூல bytes-ஐ கையொப்பமிடுகிறது, எனவே கட்டமைப்பின் JSON body parser X-Hub-Signature-256 சரிபார்ப்பை முறிக்கும்; மூல body-ஐ வைத்து, பிறகு பாகுபடுத்துங்கள்.
- நேரம் முடிந்த பிறகு பார்க்காமல் media_publish-ஐ மீண்டும் அழைத்தல். கன்டெய்னரின் status_code PUBLISHED எனக் காட்டினால், பதிவு ஏற்கனவே நேரலையில் உள்ளது.
- subcode இல்லாமல் code 4-ஐ throttling என்று படித்தல். 2207051 உடன் அது Instagram சந்தேகிக்கும் spam என்று பொருள்; மீண்டும் முயன்றால், அது இப்போதுதான் கட்டுப்படுத்திய செயலையே மீண்டும் செய்யும்.
- உலாவி அல்லது மொபைல் குறியீட்டிலிருந்து app secret அல்லது டோக்கனை அனுப்புதல். app secret கொண்ட கோரிக்கைகள் சர்வர் பக்க குறியீட்டில் மட்டுமே இருக்க வேண்டும் என்று Meta சொல்கிறது.
ஒரு இணைப்புக்கு மாதம் US$ 9 முதல் US$ 0.75 வரை, இணைப்புகளைச் சேர்க்கச் சேர்க்கக் குறைகிறது; முதல் 3 நாட்கள் இலவச ட்ரையல்.
அடிக்கடி கேட்கப்படும் கேள்விகள்
Instagram API-ஐ அழைக்க SDK தேவையா?
இல்லை. ஒவ்வொரு அழைப்பும் ஒரு access டோக்கனுடன் கூடிய HTTPS கோரிக்கை; இந்தப் பக்கத்தில் உள்ள எடுத்துக்காட்டுகள் காட்டுவது போல, Python-இல் requests அல்லது Node.js-இல் fetch போதும்.
Reel கன்டெய்னர் உருவாக்கிய உடனேயே media_publish ஏன் தோல்வியடைகிறது?
வீடியோ இன்னும் செயலாகிக்கொண்டிருக்கிறது: பிழை 9007, subcode 2207027. கன்டெய்னரின் status_code-ஐ ஒவ்வொரு நிமிடமும் சரிபார்த்து, FINISHED எனக் காட்டும்போது வெளியிடுங்கள்.
குறியீடு எந்த API பதிப்பைப் பயன்படுத்த வேண்டும்?
Meta இன்னும் வழங்கும் ஒன்று: v26.0 சமீபத்தியது, ஒவ்வொரு பதிப்பும் குறைந்தது இரண்டு ஆண்டுகள் நீடிக்கும். நீக்கப்பட்ட பதிப்புக்கான அழைப்பு, இன்னும் கிடைக்கும் அடுத்த பழைய பதிப்பில் இயங்கும்.
Instagram கணக்கின் API அணுகலுக்கு easyCoexistence எவ்வளவு செலவாகும்?
ஒவ்வொரு Instagram கணக்கும் ஒரு இணைப்பு: ஒரு இணைப்புக்கு மாதம் US$ 9 முதல் US$ 0.75 வரை, இணைப்புகளைச் சேர்க்கச் சேர்க்கக் குறையும்; முதல் 3 நாட்கள் இலவச ட்ரையல்.
தொடர்ந்து படிக்கவும்
உங்கள் முதல் சேனலை இரண்டு நிமிடங்களில் இணையுங்கள்.
காத்திருக்க வேண்டிய தளச் மதிப்பாய்வுகள் எதுவும் இல்லை. WhatsApp, Instagram, TikTok அல்லது வேறொரு சேனலை இணையுங்கள். பிறகு போஸ்ட் செய்ய, பதிலளிக்க அல்லது ரிப்போர்ட் தர உங்கள் AI-யிடம் கேளுங்கள், அது செயல்படுவதைப் பாருங்கள்.
- 3 நாட்கள் இலவசம்
- எப்போது வேண்டுமானாலும் ரத்து செய்யலாம்
- அதிகாரப்பூர்வ API-கள் மட்டுமே
- 24/7 கண்காணிப்பு
இதில் சரிபார்க்கப்பட்டது: