Meta का official Instagram Graph API सिर्फ आपके अपने Business या Creator accounts को manage करता है और इसके लिए linked Facebook Page के साथ Meta App Review ज़रूरी होता है—जिससे external public profiles या unowned hashtags का bulk collection ब्लॉक हो जाता है। API Hop Instagram Data API के ज़रिए 93 synchronous GET endpoints मात्र $0.001 (V1), $0.002 (V2) और $0.008 (V3) प्रति successful call से शुरू होते हैं, जिससे आप 10 मिनट से कम में Python से profiles, posts, Reels, Stories और comments fetch कर सकते हैं।
मुख्य बातें
- Official free access से external public scraping नहीं हो सकती: Meta का Instagram Graph API प्रति call $0 है, लेकिन इसमें Professional account, linked Facebook Page और App Review अनिवार्य है। इसका dynamic
4,800 × impressionsrolling 24-hour budget आपको competitor profiles या मनचाहे hashtags scrape करने की आज़ादी नहीं देता। - तीन version tiers से प्रति-call खर्च में 8x तक बचत: API Hop ने endpoints को V1 (29 endpoints $0.001/call पर), V2 (30 endpoints $0.002/call पर) और V3 (31 endpoints $0.008/call पर, साथ में 3 shortcode utilities $0.002/call पर) में बाँटा है, जो सभी standard
GETपर native JSON return करते हैं। - Failed calls पर credit release होता है; empty results billable हैं: Upstream request fail होने पर आपका credit reservation अपने आप release हो जाता है। लेकिन
code=200के साथ empty list भी एक billable call गिनी जाती है, इसलिए results या cursor खत्म होते ही pagination loop break कर दें। - IDs और cursors को हमेशा strings की तरह रखें: Instagram की
user_idऔरmedia_idvalues अक्सर JavaScript की safe integer range से बड़ी होती हैं, और V1, V2 व V3 में pagination parameter names अलग-अलग हैं। Unknown या duplicate fields भेजने पर तुरंत400error आता है। - $10 minimum top-up में crypto और regional wallets का support: API Hop Pricing page पर $10 का pay-as-you-go balance 10,000 V1 calls या 5,000 V2 calls तक cover करता है—जीरो monthly fee, non-expiring credits और USDT/USDC व local wallets के साथ।
2026 में Instagram Data Access के तीन तरीके
Instagram data के तीनों प्रमुख रास्तों की real approval barriers, pricing models और operational tradeoffs की तुलना देखें (2026-11-26 को verified):
| Access Route | Approval और Account Barrier | Billing Model | 10,000 Calls की अनुमानित लागत | मुख्य सीमा |
|---|---|---|---|---|
| Meta Official Instagram Graph API | Business/Creator account + Facebook Page + App Review | $0/call (higher scope के लिए कोई paid tier नहीं) | $0 (scope-restricted) | केवल authorized owned-account insights और publishing तक सीमित; public competitor feeds scrape नहीं कर सकते |
| Apify Instagram Scraper | Self-serve | Pay-per-event ($2.70/1K results Free, ~$2.30/1K Starter) + plan व proxies | ~$23–$27 + monthly plan | Async container cold starts से latency बढ़ती है; heavy runs में अलग residential proxy खर्च जुड़ता है |
| API Hop Instagram Data API | Self-serve, instant Bearer key | Pay-as-you-go: $0.001 (V1) / $0.002 (V2) / $0.008 (V3) प्रति successful call | $10.00 (V1) / $20.00 (V2) | Client को pagination loops, per-version parameter names और string ID parsing खुद संभालनी होती है |
शुरू करने से पहले की तैयारी
पहली request चलाने से पहले तीन चीज़ें तैयार कर लें:
- API Hop Key: API Hop Pricing page पर account बनाकर key generate करें। Billing prepaid pay-as-you-go ($10 minimum top-up, non-expiring credits) है, जिसमें किसी overseas USD credit card या corporate KYC की ज़रूरत नहीं—USDT/USDC crypto के साथ Brazil PIX और Indonesia QRIS, GoPay, DANA जैसे regional wallets supported हैं।
- Local Runtime:
requestsinstalled वाला Python 3.9+, या standardcurl। - Reference Bookmarks: सभी 93 endpoints के exact field contracts के लिए Instagram API Overview और Instagram Endpoint Reference खुले रखें।
pip install -U requests
export APIHOP_API_KEY="sk-your-apihop-key"
Quickstart: 2 मिनट में पहला V1 Profile Lookup
सभी API Hop Instagram endpoints बिना request body के GET query parameters accept करते हैं और Authorization: Bearer से authenticate होते हैं। @instagram के लिए सबसे सस्ते V1 profile endpoint ($0.001/request) से शुरुआत करें:
curl --get "https://api.apihop.ai/v1/instagram/v1/users/profile/by-username" \
-H "Authorization: Bearer $APIHOP_API_KEY" \
--data-urlencode "username=instagram"
अपेक्षित response envelope native code/data structure को बरकरार रखता है (उदाहरण स्वरूप; live fields upstream payload पर निर्भर करते हैं):
{
"code": 200,
"data": {
"user": {
"id": "25025320",
"username": "instagram",
"follower_count": 670000000
}
}
}
छोटा Python उदाहरण
import os
import requests
resp = requests.get(
"https://api.apihop.ai/v1/instagram/v1/users/profile/by-username",
headers={"Authorization": f"Bearer {os.environ['APIHOP_API_KEY']}"},
params={"username": "instagram"},
timeout=60,
)
resp.raise_for_status()
payload = resp.json()
print("code:", payload.get("code"), "user_id:", str(payload.get("data", {}).get("user", {}).get("id", "")))
अपेक्षित output: code: 200 user_id: 25025320। id को तुरंत str में cast करें ताकि आगे के V1 post और Reels calls को सटीक string user_id मिले।
Step-by-Step Guide: 8x तक बचाने के लिए V1, V2 या V3 चुनें
API Hop अपने 93 Instagram endpoints को तीन version segments में बाँटता है, जहाँ V1 और V3 के बीच 8x का price अंतर है। डिफ़ॉल्ट रूप से V1 चुनें, Stories या likes के लिए V2 पर जाएँ, और comment translation या forward/backward cursors के लिए ही V3 का उपयोग करें:
| Version Tier | Endpoints | Default Price प्रति Call | सबसे सही Use Cases | Pagination Cursor Param |
|---|---|---|---|---|
V1 (/v1/instagram/v1/*) | 29 | $0.001 (1,000 credits) | Profiles, user posts, Reels, hashtag feeds, general search, post-by-URL, shortcode tools | max_id (posts/Reels), min_id (comments), end_cursor (hashtags) |
V2 (/v1/instagram/v2/*) | 30 | $0.002 (2,000 credits) | Flexible username या user_id lookups, Stories, followers/following lists, post likes | pagination_token |
V3 (/v1/instagram/v3/*) | 34 | $0.008 (31 core endpoints) $0.002 (3 shortcode tools) | Direct username posts/Reels/Stories, single & bulk comment translation, oEmbed, bi-directional cursors | after / before (posts/Reels), min_id (comments) |
चरण 1: V1 पर User Posts और Reels Fetch करें
String user_id मिलने के बाद $0.001/request की दर से GET /v1/instagram/v1/users/posts या GET /v1/instagram/v1/users/reels call करें। दोनों में user_id ज़रूरी है और count व max_id optional हैं:
import os
import requests
headers = {"Authorization": f"Bearer {os.environ['APIHOP_API_KEY']}"}
resp = requests.get(
"https://api.apihop.ai/v1/instagram/v1/users/posts",
headers=headers,
params={"user_id": "25025320", "count": 12},
timeout=60,
)
resp.raise_for_status()
data = resp.json()
assert data.get("code") == 200 and data.get("data") is not None, f"Upstream error: {data}"
print("Posts payload keys:", list(data["data"].keys()))
अपेक्षित output: Posts payload keys: [...]। पिछले response से सीधे अगला cursor निकालें और अगले पेज के लिए max_id में pass करें।
चरण 2: V2 और V3 पर Stories, Comments और Shortcodes निकालें
V1 में Stories endpoint नहीं है, इसलिए active 24-hour Stories लेने के लिए V2 ($0.002/call) इस्तेमाल करें। अगर आपके पास केवल post URL है, तो पहले GET /v1/instagram/v3/shortcodes/from-url से shortcode निकालें (जिसकी कीमत $0.008 नहीं बल्कि $0.002/call है):
import os
import requests
headers = {"Authorization": f"Bearer {os.environ['APIHOP_API_KEY']}"}
# 1. Extract shortcode from a post URL ($0.002)
sc_resp = requests.get(
"https://api.apihop.ai/v1/instagram/v3/shortcodes/from-url",
headers=headers,
params={"url": "https://www.instagram.com/p/DRhvwVLAHAG/"},
timeout=60,
)
sc_resp.raise_for_status()
print("Shortcode extract:", sc_resp.json().get("code"))
# 2. Fetch active Stories on V2 ($0.002, accepts username or user_id)
st_resp = requests.get(
"https://api.apihop.ai/v1/instagram/v2/users/stories",
headers=headers,
params={"username": "instagram"},
timeout=60,
)
st_resp.raise_for_status()
print("Stories status:", st_resp.json().get("code"))
अपेक्षित output: Shortcode extract: 200 और Stories status: 200। ध्यान दें कि GET /v1/instagram/v2/users/stories और GET /v1/instagram/v2/users/profile anyOf contract पर काम करते हैं—username या user_id में से कोई एक ज़रूर दें।
चरण 3: V1 पर Hashtag Posts और Users Search करें
Trend tracking या hashtag discovery के लिए GET /v1/instagram/v1/hashtags/posts (बिना # prefix के) या GET /v1/instagram/v1/search (select=users, hashtags या places filter के साथ) call करें:
import os
import requests
headers = {"Authorization": f"Bearer {os.environ['APIHOP_API_KEY']}"}
tag_resp = requests.get(
"https://api.apihop.ai/v1/instagram/v1/hashtags/posts",
headers=headers,
params={"hashtag": "cat"},
timeout=60,
)
tag_resp.raise_for_status()
print("Hashtag code:", tag_resp.json().get("code"), "X-Request-Id:", tag_resp.headers.get("X-Request-Id"))
अपेक्षित output: Hashtag code: 200 X-Request-Id: ...। अगले hashtag pages के लिए returned pagination token को end_cursor में pass करें और सटीक field constraints के लिए Instagram Endpoint Reference देखें।
Complete Working Example: Backoff के साथ Paginated Scraper
क्योंकि gateway खुद auto-paginate नहीं करता, यह production script username को string user_id में resolve करती है, max_id से posts paginate करती है, HTTP 200 business errors चेक करती है, 429/5xx पर exponential backoff लगाती है और कुल request खर्च प्रिंट करती है:
import json
import os
import time
import requests
API_KEY = os.environ["APIHOP_API_KEY"]
BASE_URL = "https://api.apihop.ai"
def call_ig(path: str, params: dict, max_retries: int = 3):
url = f"{BASE_URL}{path}"
for attempt in range(max_retries):
resp = requests.get(
url,
headers={"Authorization": f"Bearer {API_KEY}"},
params=params,
timeout=60,
)
req_id = resp.headers.get("X-Request-Id")
if resp.status_code == 200:
body = resp.json()
if body.get("code") == 200 and body.get("data") is not None:
return body["data"], req_id
raise RuntimeError(f"Business error on {path}: code={body.get('code')} req={req_id}")
if resp.status_code in (429, 500, 502, 503, 504) and attempt < max_retries - 1:
wait = 2 ** (attempt + 1)
print(f"[Retry {attempt + 1}] HTTP {resp.status_code}, sleep {wait}s (req={req_id})")
time.sleep(wait)
continue
resp.raise_for_status()
raise RuntimeError("Max retries exceeded")
def collect_user_posts(username: str, max_pages: int = 3, out_file: str = "ig_posts.json"):
requests_used = 0
profile_data, req_id = call_ig("/v1/instagram/v1/users/profile/by-username", {"username": username})
requests_used += 1
user_obj = profile_data.get("user") or profile_data
user_id = str(user_obj.get("id") or user_obj.get("pk") or "")
if not user_id:
raise ValueError(f"Cannot resolve user_id for @{username}")
print(f"Resolved @{username} -> user_id={user_id} (req={req_id})")
collected = []
cursor = None
for page in range(1, max_pages + 1):
query = {"user_id": user_id, "count": 12}
if cursor:
query["max_id"] = str(cursor)
page_data, p_req_id = call_ig("/v1/instagram/v1/users/posts", query)
requests_used += 1
items = page_data.get("items") or page_data.get("edges") or []
print(f"Page {page}: {len(items)} items (req={p_req_id})")
if not items:
break
collected.extend(items)
cursor = page_data.get("next_max_id") or page_data.get("max_id")
if not cursor or page_data.get("more_available") is False:
break
time.sleep(0.5)
with open(out_file, "w", encoding="utf-8") as f:
json.dump(collected, f, ensure_ascii=False, indent=2)
cost = requests_used * 0.001
print(f"Saved {len(collected)} items to {out_file} | Requests: {requests_used} | Est. Cost: ${cost:.4f}")
if __name__ == "__main__":
collect_user_posts("instagram", max_pages=3)
अपेक्षित output: resolved string user_id और हर पेज की गिनती लॉग करता है, और अंत में Saved ... items to ig_posts.json | Requests: 4 | Est. Cost: $0.0040 दिखाता है।
Error Handling और Troubleshooting
हर response से X-Request-Id header हमेशा log करें ताकि call fail होने पर support team upstream logs तुरंत trace कर सके:
| HTTP Status / स्थिति | सामान्य कारण | सुझाया गया समाधान |
|---|---|---|
400 | Unknown या duplicate query field, या ज़रूरी anyOf field गायब होना | Query keys को Endpoint Reference के अनुसार ही भेजें |
401 | Authorization: Bearer API key missing या invalid होना | अपना environment variable और key status जाँचें |
402 | Prepaid credit balance कम होना | API Hop Pricing page पर credits top up करें |
403 | Gateway disabled होना या key के पास endpoint permission न होना | Console में API key scopes चेक करें |
429 | Rate या concurrency limit पार होना | 0.5s delay और 2s / 4s backoff के साथ calls भेजें |
5xx / 60s Timeout | Upstream timeout या अस्थायी error (reservation release हो जाता है; कोई शुल्क नहीं) | 1–2 बार retry करें और X-Request-Id सहेजें |
HTTP 200 जिसमें code != 200 | Upstream business error (जैसे private या missing account) | इसे कभी success न मानें—parse करने से पहले code == 200 and data is not None assert करें |
आम समस्याएं और सावधानियां
- JavaScript में 19-digit IDs पर precision loss:
3774507992167247878जैसी Instagrammedia_idvalues JSNumber.MAX_SAFE_INTEGERसे बड़ी होती हैं। इन्हें number की तरह parse करने से आखिरी digits बिगड़ जाते हैं और आगे comment lookups400से fail होते हैं। IDs और cursors को हमेशा strings रखें। - HTTP
200को data success मान लेना: Upstream business errors HTTP200envelope के अंदर आ सकते हैं। हमेशाbody["code"] == 200औरbody["data"] is not Noneverify करें। - Versions के बीच pagination parameter names मिलाना: V1 posts में
max_id, V1 hashtags मेंend_cursor, V2 मेंpagination_tokenऔर V3 posts मेंafterइस्तेमाल होता है। V1 कोpagination_tokenभेजने पर तुरंत400मिलता है। - Empty pages के लिए पैसे देना: Successful empty results भी credits खर्च करते हैं, जबकि failed calls नहीं करते।
itemsखाली होते ही या next cursor न मिलने पर pagination loop तुरंत break कर दें।
Cost Estimation और Real Workload Bills
API Hop की default per-request rates (V1 के लिए $0.001, V2 के लिए $0.002, V3 के लिए $0.008 और V3 shortcode utilities के लिए $0.002) पर अपना exact pipeline खर्च इस सूत्र से निकालें:
$$\text{Workload Bill} = (N_{V1} \times $0.001) + (N_{V2} \times $0.002) + (N_{V3} \times $0.008)$$
| Workload Scenario | Request Volume | API Hop की वास्तविक लागत | Apify अनुमानित लागत (~$2.30–$2.70/1K results + plan) |
|---|---|---|---|
| इस गाइड के सभी code examples चलाना | 8 V1 calls + 2 V2/utility calls | $0.012 (~1.2 cents) | Platform credit और container cold start ज़रूरी |
| 100 creator audits (profile + 3 post pages) | 100 V1 profiles + 300 V1 posts | $0.40 | ~3,600 posts के लिए ~$8.28–$9.72 + plan fee |
| 50 hashtags + comments की रोज़ाना tracking (मासिक) | 1,500 V1 hashtags + 1,500 V2 comments | $4.50 / माह | केवल Starter plan ही $19–$39/माह से शुरू होता है |
| Live SaaS profile और Stories lookups | 5,000 V1 profiles + 2,500 V2 Stories | $10.00 / माह | Async containers live user latency में पिछड़ते हैं |
API Hop Pricing page पर $10 minimum top-up से 10,000 V1 requests या 5,000 V2 requests चलती हैं। यही non-expiring balance API Hop Data APIs catalog में Threads, YouTube और Amazon के साथ-साथ Claude, GPT और DeepSeek LLMs पर भी काम करता है—ताकि एक ही key से creator comments scrape करके product insights summarize किए जा सकें।
आगे क्या देखें
- Account-specific pricing overrides: Official docs के अनुसार account-level rate overrides public list prices से ऊपर लागू होते हैं; बड़े batch runs से पहले अपने console में active credit rates देख लें।
- Per-version payload schemas: Upstream endpoints बदलने पर V1, V2 और V3 के अंदरूनी
datafields बदलते रहते हैं, इसलिए अपने parsers में defensive.get()lookups बनाए रखें।
अक्सर पूछे जाने वाले प्रश्न
क्या 2026 में कोई free Instagram API उपलब्ध है?
Meta का official Instagram Graph API प्रति call free ($0) है, लेकिन इसमें दो सख्त शर्तें हैं: आपको एक Instagram Business या Creator account को Facebook Page से link करके Meta App Review पास करना होगा, और आप केवल अपने या authorized client accounts के analytics पढ़ सकते हैं—मनचाहे public profiles या hashtags नहीं। बिना App Review के self-serve public data के लिए API Hop में permanent free tier नहीं है, लेकिन कोई monthly fee भी नहीं है: API Hop Pricing page पर $10 का top-up 10,000 V1 requests तक cover करता है, और इस पूरी गाइड को चलाने का खर्च $0.012 आता है।
API Hop Instagram API की pricing कैसे काम करती है?
API Hop प्रति successful request बिल करता है—returned posts या items के हिसाब से नहीं—और इसमें जीरो monthly subscription है: V1 endpoints $0.001/call (1,000 credits), V2 endpoints $0.002/call (2,000 credits), V3 core endpoints $0.008/call (8,000 credits) और V3 के तीन shortcode utilities $0.002/call के हैं। हर paginated page एक request गिना जाता है, और failed upstream calls अपना credit reservation अपने आप release कर देते हैं।
Public Instagram API क्या है, और क्या इसके लिए target-account OAuth ज़रूरी है?
public instagram api developers को target creator से OAuth consent लिए बिना publicly visible profiles, posts, Reels, hashtags और comments पढ़ने की सुविधा देता है। Meta का official Graph API unowned public scraping की अनुमति नहीं देता, जबकि API Hop Instagram Data API 93 GET endpoints देता है जो केवल आपकी अपनी API Hop Bearer key से authenticate होते हैं।
V1, V2 और V3 endpoints में से किसे कब चुनें?
जब आपके पास user_id हो या profiles, posts, Reels, hashtags और search चाहिए, तो हमेशा V1 ($0.001/call) से शुरू करें—यह V3 से 8x सस्ता है। Stories, follower/following lists, likes या flexible username/user_id parameters के लिए V2 ($0.002/call) चुनें। V3 ($0.008/call) केवल comment translation, oEmbed या V3-exclusive forward/backward pagination cursors के लिए रखें।
क्या मैं बिना U.S. या international credit card के pay कर सकता हूँ?
हाँ। API Hop उन global developers के लिए बना है जिनके पास international USD credit card या corporate KYC नहीं है। API Hop Pricing page पर आप USDT/USDC crypto के साथ-साथ Brazil PIX और Indonesia QRIS, GoPay, DANA जैसे regional wallets से pay-as-you-go balance top up कर सकते हैं, और ये credits कभी expire नहीं होते।
सत्यापन नोट: सभी 93 Instagram endpoint paths, V1/V2/V3 pricing tiers और parameter contracts की जाँच 2026-11-26 को live API Hop documentation और public Meta developer specifications के आधार पर की गई है (console में account-specific rates लागू होते हैं)।