Your team needs Instagram post, reel, and account metadata in a format you can ship to production this week—counts, images, dimensions, and author info—without reverse engineering HTML or juggling multiple libraries. By the end of this guide, you’ll be able to call the Instagram Data API from Zyla API Hub to fetch public post data by URL, account data by username, and reel metrics by shortcode, and wire it into your service or AI agent.
What you can build with Instagram Data API
The Instagram Data API on Zyla returns structured information for public Instagram resources so you can integrate social content into your product without scraping. It supports:
- Post/publication data by URL, including media dimensions, display URLs, and related metadata.
- Account data by username, including biography and bio links.
- Reel data by shortcode, including like_count, comment_count, and video_view_count.
Typical use cases include social proof widgets, analytics dashboards, UGC moderation and enrichment, and content ingestion pipelines for marketing reports.
Zyla API Hub is a single account, single API key marketplace with a subscription + quota model (not pay-per-call) and a catalog of more than 10,000 public APIs across Social Media & Networking and other categories. You can browse the marketplace at zylalabs.com and subscribe to individual APIs as needed.
Getting started on Zyla API Hub
To integrate, open the Instagram Data API page, click Subscribe or Start Free Trial (when available), and copy your API key. Every request uses the Authorization header: Bearer YOUR_API_KEY.
Start here: Start 7-day trial on Instagram Data API. The first API typically offers a 7-day trial or 50 requests. Check the API page for current access options and pricing.
Endpoints overview
1) Get Post Data
Return Instagram post/publication data for a public post URL.
- Method: GET
- URL: https://zylalabs.com/api/855/instagram-data-api/630/get-post-data
- Required query parameter:
- link (string): Instagram post URL. Example: https://www.instagram.com/p/BsOGulcndj-
cURL example:
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"
Example response (official sample):
{
"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…
Key fields you’ll typically use:
- id and shortcode: stable identifiers for deduplication and linking.
- dimensions: height and width of the media.
- display_url and display_resources: URLs to media assets at different sizes.
- __typename: media type hint (e.g., GraphImage).
2) Get Account Data
Return public Instagram account data by username.
- Method: GET
- URL: https://zylalabs.com/api/855/instagram-data-api/631/get-account-data
- Required query parameter:
- username (string): Instagram username. Example: leomessi
cURL example:
The response returns account metadata such as the biography and bio_links for the specified username.
3) Get Reel Data
Return public Instagram reel/post metrics by shortcode. Includes counts for likes, comments, and views.
- Method: GET
- URL: https://zylalabs.com/api/855/instagram-data-api/32007/get-reel-data
- Required query parameter:
- shortcode (string): Instagram shortcode for the post/reel. Example: DctYV2qt6S5
cURL example:
Example response (official sample):
Key fields you’ll typically use:
- like_count and comment_count: engagement metrics for dashboards and alerts.
- video_view_count (and play_count): reel performance tracking.
- code: echo of the requested shortcode for correlation.
End-to-end example in Python
The snippet below fetches reel metrics by shortcode and prints engagement KPIs. It uses the same endpoint and parameters shown in the cURL example above.
import os
import requests
API_KEY = os.getenv("ZYLA_API_KEY", "YOUR_API_KEY")
SHORTCODE = "DctYV2qt6S5"
url = "https://zylalabs.com/api/855/instagram-data-api/32007/get-reel-data"
params = {"shortcode": SHORTCODE}
headers = {"Authorization": f"Bearer {API_KEY}"}
resp = requests.get(url, params=params, headers=headers, timeout=15)
resp.raise_for_status()
data = resp.json()
# Extract the fields your app likely needs
like_count = data.get("like_count")
comment_count = data.get("comment_count")
views = data.get("video_view_count")
print({
"shortcode": data.get("code"),
"likes": like_count,
"comments": comment_count,
"views": views
})
JSON you can expect (as shown above):
Implementation notes that save time
- Authorization header: Always include Authorization: Bearer YOUR_API_KEY. Do not send the key in query params.
- URL encoding: For Get Post Data, the link parameter must be URL-encoded. The provided cURL shows the correct form.
- Public data only: These endpoints return information for public Instagram resources.
- Caching: Engagement numbers on reels can change quickly. If you’re polling, cache responses briefly (e.g., 30–120 seconds) to avoid redundant calls while keeping dashboards fresh.
- Error handling: Handle non-200s and JSON parsing errors. Exponential backoff helps if you batch updates.
- Quotas: Zyla APIs use subscription + quota. The first API typically includes a 7-day trial or 50 requests; check the listing for current limits before running large backfills.
Real-world use cases
- Embed posts with verified metadata: Resolve a post URL to dimensions and a display_url, store the shortcode, and render with a consistent UI.
- Creator and brand pages: Use Get Account Data to show an account’s biography and outgoing links adjacent to campaigns or product pages.
- Reel performance tracking: Poll Get Reel Data for high-priority shortcodes every minute and push deltas (likes, comments, video_view_count) to your metrics store.
- Automated QA on UGC: Validate that a submitted Instagram URL actually resolves to an image or reel and meets your size requirements via dimensions.
Calling the API from AI agents (MCP)
You can call Zyla APIs from MCP-compatible clients through the MCP endpoint at https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY. This is useful for prototyping with AI coding tools or wiring checks into AI-runbooks. See MCP for details.
Copy-ready request collection
Use these exact requests with your key dropped into the Authorization header.
Get Post Data (by URL)
Get Account Data (by username)
Get Reel Data (by shortcode)
Operational checklist
- Keys in env: Store YOUR_API_KEY in your secrets manager or environment variable.
- Monitoring: Track non-200s and timeouts; retry transient failures.
- Data model: Persist shortcode for posts/reels to avoid duplicates and enable targeted refreshes.
- Rate of change: Reels update frequently; schedule tighter polling windows for priority items and longer windows for the rest.
- Marketplace management: Use your Zyla dashboard to monitor quota usage. You can always explore additional Social Media & Networking APIs at zylalabs.com when expanding features.
FAQ
Q: How do I authenticate requests?
A: Include the header Authorization: Bearer YOUR_API_KEY on every request.
Q: What input should I pass to Get Post Data?
A: Provide a URL-encoded Instagram post URL via the link parameter, for example link=https%3A%2F%2Fwww.instagram.com%2Fp%2FBsOGulcndj-.
Q: What input should I pass to Get Reel Data?
A: Provide the shortcode value of the target reel/post using the shortcode query parameter.
Q: Does the API return like and view counts?
A: Yes, Get Reel Data returns like_count, comment_count, play_count, and video_view_count.
Q: Is there a free plan?
A: Zyla uses subscription + quota. The first API typically includes a 7-day trial or 50 requests; check the listing for current access options and pricing.
Ready to wire this into your pipeline? Create your account and start the 7-day trial directly on the listing: Start 7-day trial on Instagram Data API. Your one Zyla API key works across any other APIs you add later.