You need reliable post-level data from Instagram and you need it this week. By the end of this guide, you’ll be able to fetch rich Instagram post information (shortcode, media dimensions, image/video flags, captions, and more) from a single HTTP GET on Zyla API Hub, parse the JSON, and drop it into your pipeline or product.
What you can build with a real Instagram post data endpoint
The Instagram Data API on Zyla API Hub provides fast, structured access to Instagram content without spinning up scrapers. You supply:
- A post link to get post/publication data.
- A username to get account data.
- A shortcode to get detailed post information including media, caption, owner profile details, publication date, likes, and comments metadata.
Teams use this to enrich CMS entries, power link unfurling, automate reporting, and route moderation workflows. Because it’s on Zyla API Hub, you get one account, one API key, and a subscription + quota model across thousands of APIs—no per-call billing.
Getting started on Zyla API Hub
Open the Instagram Data API listing on Zyla API Hub and start a trial to obtain an API key. Authentication is via HTTP header Authorization: Bearer YOUR_API_KEY. The marketplace runs on subscription + quota (not pay-per-call). Check the API page for current access options and pricing; you can Start 7-day trial on Instagram Data API directly from the item page.
Endpoints you’ll use
1) Get Post Data
Provide a public Instagram post URL to retrieve the post/publication data.
- Method: GET
- URL: https://zylalabs.com/api/855/instagram-data-api/630/get-post-data
- Required query parameter:
- link (string): the Instagram post URL (URL-encoded). Example: https://www.instagram.com/p/BsOGulcndj-
Copy-paste cURL:
curl -s -X GET "https://zylalabs.com/api/855/instagram-data-api/630/get-post-data?link=https%3A%2F%2Fwww.instagram.com%2Fp%2FBsOGulcndj-" \
-H "Authorization: Bearer YOUR_API_KEY"
Official sample JSON response:
{
"status": true,
"__typename": "GraphImage",
"id": "1949525278281554174",
"shortcode": "BsOGulcndj-",
"dimensions": {
"height": 584,
"width": 584
},
"gating_info": null,
"fact_check_overall_rating": null,
"fact_check_information": null,
"sensitivity_friction_info": null,
"sharing_friction_info": {
"should_have_sharing_friction": false,
"bloks_app_url": null
},
"media_overlay_info": null,
"media_preview": null,
"display_url": "https://instagram.fbcn2-1.fna.fbcdn.net/v/t51.82787-15/625727639_18338153224242257_3827527793310630488_n.jpg?stp=dst-jpg_e15_tt6&_nc_ht=instagram.fbcn2-1.fna.fbcdn.net&_nc_cat=105&_nc_oc=Q6cZ2gHBlHY2RHKNTgCNzMelAyz56Toi4DI7VUNsrK7XJAsoGT6ka4w7PVJ6IEqS7PD9Ulw&_nc_ohc=jwkKyc7eqGAQ7kNvwHmuCEW&_nc_gid=BiA9YpCodvi1HtqMj6W-Vg&edm=AOmX9WgBAAAA&ccb=7-5&ig_cache_key=MTk0OTUyNTI3ODI4MTU1NDE3NA%3D%3D.3-ccb7-5&oh=00_AQONRzWv-s9IPALJK9qeJ5FVyMcHbwpYaGsJhb7fdlV1nA&oe=6ACE9A40&_nc_sid=bfaa47",
"display_resources": [
{
"src": "https://instagram.fbcn2-1.fna.fbcdn.net/v/t51.82787-15/625727639_18338153224242257_3827527793310630488_n.jpg?stp=dst-jpg_e35_s360x360_sh2.08_tt6&_nc_cat=104&_nc_map=urlgen_bucketless&ig_cache_key=MTk0OTUyNTI3ODI4MTU1NDE3NA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkZFRUQueHBpZHMuNTg0LnNkci5yZWd1bGFyX3Bob3RvLkMzIn0%3D&_nc_ohc=53XaOqCZWBYQ7kNvwFfkQTV&_nc_oc=AdprbrBLkElSfmNNOrQHEYQuCIz8F8lIlYN7TENXKNGCcZVnybmvx0uXH6fzElyfwak&_nc_ad=z-m&_nc_cid=0&_nc_zt=23&_nc_ht=instagram.fbcn2-1.fna&_nc_gid=BiA9YpCodvi1HtqMj6W-Vg&_nc_ss=7a3ba&oh=00_AQNBRrpvxf3JGSktIaicSqaD4UtCuDo9I8feI6acpRs9Eg&oe=6ACE9A40",
"config_width": 360,
"config_height": 360
},
{
"src": "https://instagram.fbcn2-1.fna.fbcdn.net/v/t51.82787-15/625727639_18338153224242257_3827527793310630488_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=104&_nc_map=urlgen_bucketless&ig_cache_key=MTk0OTUyNTI3ODI4MTU1NDE3NA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkZFRUQueHBpZHMuNTg0LnNkci5yZWd1bGFyX3Bob3RvLkMzIn0%3D&_nc_ohc=53XaOqCZWBYQ7kNvwFfkQTV&_nc_oc=AdprbrBLkElSfmNNOrQHEYQuCIz8F8lIlYN7TENXKNGCcZVnybmvx0uXH6fzElyfwak&_nc_ad=z-m&_nc_cid=0&_nc_zt=23&_nc_ht=instagram.fbcn2-1.fna&_nc_gid=BiA9YpCodvi1HtqMj6W-Vg&_nc_ss=7a3ba&oh=00_AQMhFQizLfIe4bAcskLHhT2nCDcjFGyldOq2Cp7IMLuVxg&oe=6ACE9A40",
"config_width": 584,
"config_height": 584
}
],
"accessibility_caption…
What you’ll actually use here:
- status: indicates a successful lookup.
- shortcode: the unique code you can use elsewhere.
- dimensions: size of the media asset (pixels).
- display_url: the direct image URL for previews or caching.
- display_resources: size-variant URLs if you need different resolutions.
2) Get Account Data
Provide a public Instagram username to retrieve the account data.
- Method: GET
- URL: https://zylalabs.com/api/855/instagram-data-api/631/get-account-data
- Required query parameter:
- username (string): e.g., cristiano
Copy-paste cURL:
The response includes profile metadata and external links. Use it to hydrate author information for posts you fetch, or to validate that a handle exists before queuing post crawling.
3) Post Information
Retrieve detailed Instagram post data using the shortcode.
- Method: GET
- URL: https://zylalabs.com/api/855/instagram-data-api/37566/post-information
- Required query parameter:
- code (string): e.g., DfI02-LTwkc
Copy-paste cURL:
Example response (abridged to fields shown in the listing):
What you’ll actually use here:
- __typename: tells you if it’s an image, video, etc.
- is_video: boolean to branch your renderer and CDN behavior.
- display_url and display_resources: URLs to fetch or cache media.
- accessibility_caption: text useful for alt text or summaries.
- dimensions: guide aspect-ratio handling in your UI.
One working example in Python
This Python snippet calls the Post Information endpoint using a shortcode and extracts the fields you’re likely to map into your models.
import os
import requests
API_KEY = os.getenv("ZYLALABS_API_KEY", "YOUR_API_KEY")
SHORTCODE = "DfI02-LTwkc"
url = "https://zylalabs.com/api/855/instagram-data-api/37566/post-information"
params = {"code": SHORTCODE}
headers = {"Authorization": f"Bearer {API_KEY}"}
resp = requests.get(url, params=params, headers=headers, timeout=20)
resp.raise_for_status()
data = resp.json()
if data.get("status") == "ok" and "data" in data and "post" in data["data"]:
post = data["data"]["post"]
out = {
"id": post.get("id"),
"shortcode": post.get("shortcode"),
"type": post.get("__typename"),
"is_video": post.get("is_video"),
"width": (post.get("dimensions") or {}).get("width"),
"height": (post.get("dimensions") or {}).get("height"),
"display_url": post.get("display_url"),
"accessibility_caption": post.get("accessibility_caption"),
}
print(out)
else:
print("Lookup failed or no post payload:", data)
Notes:
- Authorization header is required: Bearer YOUR_API_KEY.
- Use timeouts on HTTP clients. Cache responses on your side to avoid re-fetching static posts.
- Shortcodes are opaque strings; do not assume format beyond what you receive.
Practical implementation details that save time
- URL-encoding: When using Get Post Data, encode the link parameter. The official cURL shows an encoded URL value.
- Media variants: display_resources may include multiple sizes. Pick the size closest to your target display to reduce bandwidth.
- Accessibility: accessibility_caption can serve as alt text and improve screen-reader support.
- Branch by type: Use __typename and is_video to decide whether to render an image component, video player, or carousel logic in your app.
- Stability: Post-level metadata is relatively stable for public posts. Implement basic caching with an expiry appropriate for your product (for example, hours to days) and only refresh if you detect changes you care about.
- Quotas and access: Zyla APIs run on subscription + quota. Check the listing page for your current limits. The first step is the 7-day trial on the item page.
End-to-end: choosing the right endpoint for your flow
- If you start with a full Instagram URL: use Get Post Data. You’ll receive the shortcode and media URLs directly from the link.
- If you start with just a shortcode: call Post Information. You’ll get richer post details suitable for rendering and analytics.
- If you need author context: call Get Account Data with the username to pull profile metadata and links for attribution or profile cards.
Real-world use cases
- Link unfurling in chat/support tools: On paste of an Instagram URL, call Get Post Data, grab display_url and dimensions, and render a compact preview with alt text from accessibility_caption.
- Editorial pipelines: When editors add a shortcode to your CMS, use Post Information to fetch canonical media, type, and captions; store width/height for responsive layout.
- Creator analytics: Combine Post Information with your internal metrics to report on content mix (image vs. video) and maintain a media archive with proper sizing.
- Moderation: Use Post Information to quickly fetch a post’s media metadata and captions and route for review without loading the full web page.
Calling the API from AI agents via MCP
You can invoke APIs on Zyla through an MCP-compatible client (e.g., Claude Code, Cursor, Windsurf). Configure your client with the MCP endpoint and your key; calls are routed using your Zyla API credentials.
- MCP endpoint: MCP
- API key: use the same Authorization: Bearer YOUR_API_KEY credential you obtained from the Instagram Data API listing.
From there, instruct your agent to request the Instagram Data API endpoints documented above by supplying the required query parameters (link, username, or code). This lets you chain retrieval and transformation tasks inside the agent with minimal glue code.
Operational checklist
- Authentication: Always send Authorization: Bearer YOUR_API_KEY.
- Encoding: URL-encode the link parameter for Get Post Data.
- Timeouts and retries: Use client timeouts; implement retries with backoff on transient network issues.
- Caching: Cache static post results to reduce latency and quota usage.
- Monitoring: Log endpoint path, query values (minus secrets), status, and latency to spot regressions early.
Why ship on Zyla API Hub
- One account and one API key across more than 10,000 public APIs in categories like social, finance, enrichment, AI, geolocation, and utilities.
- Subscription + quota model instead of pay-per-call.
- MCP endpoint for agent-driven workflows.
You can start directly from the Instagram Data API listing: Start 7-day trial on Instagram Data API.
FAQ
What authentication does this API use?
Send the HTTP header Authorization: Bearer YOUR_API_KEY with every request.
Which endpoint should I use if I only have the Instagram URL?
Use GET https://zylalabs.com/api/855/instagram-data-api/630/get-post-data with the link query parameter. Ensure the URL is URL-encoded.
How do I get richer media details once I have a shortcode?
Call GET https://zylalabs.com/api/855/instagram-data-api/37566/post-information with code set to the shortcode. You’ll receive fields such as __typename, is_video, dimensions, display_url, accessibility_caption, and more.
Can I look up account information for a username?
Yes. Use GET https://zylalabs.com/api/855/instagram-data-api/631/get-account-data with username set to the handle.
Is there a free plan?
Access runs on a subscription + quota model. Check the API page for current access options; a 7-day trial starts from the item page.
Ready to ship your integration? Get your key and start calling the endpoints from the Instagram Data API listing: Start 7-day trial on Instagram Data API.