You need reliable Instagram post and profile data you can ship into a production workflow this week. By the end of this article, you’ll be able to fetch post-level details (dimensions, media URLs, captions, engagement signals) and profile-level data (username, bio, verification, picture, links) using the Instagram Data API on Zyla API Hub, with copy-pasteable requests and integration-ready patterns.
What you can build with Instagram Data API
The Instagram Data API provides two high-signal read endpoints developers routinely need for social media features:
- Post Information: look up a post by its shortcode to retrieve media metadata (image/video flags, dimensions, URLs), caption text, owner profile summary, and engagement fields.
- Profile Details: look up a profile by username or ID to retrieve verification status, profile picture, follower context, bio, external links, and other account descriptors.
These endpoints are useful for social analytics dashboards, brand monitoring, automated content auditing, link enrichment, profile verification checks, and post-embedding pipelines where you need deterministic media attributes before rendering.
Getting started on Zyla API Hub
Open the API listing on Zyla API Hub and subscribe to get your key. The Hub runs on a subscription + quota model (not pay-per-call). For a first API, you can start a 7-day trial or 50 requests. Check the API page for current access options and pricing.
- Start 7-day trial on Instagram Data API
- Browse more than 10,000 public APIs on Zyla API Hub
Authentication is sent with every request using the HTTP header Authorization: Bearer YOUR_API_KEY.
Endpoints you’ll use
1) Post Information
Method: GET
URL: https://zylalabs.com/api/855/instagram-data-api/37566/post-information
Required query parameter:
- code (string): The Instagram post shortcode. Example: DfI02-LTwkc
What it returns: detailed Instagram post information including shortcode, media dimensions, image URLs, video flag, caption, owner profile details, publication date, likes, and comments.
Official curl example:
curl -s -X GET "https://zylalabs.com/api/855/instagram-data-api/37566/post-information?code=DfI02-LTwkc" \
-H "Authorization: Bearer YOUR_API_KEY"
Official JSON (verbatim) response example:
{
"status": "ok",
"data": {
"post": {
"__typename": "GraphVideo",
"id": "4019695143460210972",
"shortcode": "DfI02-LTwkc",
"dimensions": {
"height": 718,
"width": 1020
},
"display_url": "https://scontent-fra5-1.cdninstagram.com/v/t51.82787-15/874355210_18644578207004135_6009842855742675310_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=100&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=jiuH08gxR-UQ7kNvwEhFWEv&_nc_oc=AdpqckQyCQPV-2GIsLEePsnM3OkN0Qxd35INSdQRiEcG0k_ilHAVrX_UcfWw9cz9FMw&_nc_zt=23&_nc_ht=scontent-fra5-1.cdninstagram.com&_nc_gid=AurjIQpTzCx0zkhifUWrBg&_nc_ss=7020f&oh=00_AQSFeFgTX4qgUU-VPIinjkrZASMg4NkxlFyIzab67V5zow&oe=6AEB0083",
"is_video": true,
"accessibility_caption": "Video by Tesla on October 30, 2026. May be an image of limousine, minivan, night and text.",
"display_resources": [
{
"src": "https://scontent-fra5-1.cdninstagram.com/v/t51.82787-15/874355210_18644578207004135_6009842855742675310_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=100&ig_cache_key=NDAxOTY5NTE0MzQ2MDIxMDk3MjE4NjQ0NTc4MjA0MDA0MTM1.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNMSVBTLnhwaWRzLjcyMC5zZHIudmlkZW9fdXNlcl9zZWxlY3RlZF90aHVtYm5haWwuQzMifQ%3D%3D&_nc_ohc=jiuH08gxR-UQ7kNvwEhFWEv&_nc_oc=AdpqckQyCQPV-2GIsLEePsnM3OkN0Qxd35INSdQRiEcG0k_ilHAVrX_UcfWw9cz9FMw&_nc_zt=23&_nc_ht=scontent-fra5-1.cdninstagram.com&_nc_gid=AurjIQpTzCx0zkhifUWrBg&_nc_ss=7060f&oh=00_AQR9wbRhfpvbBzM62jt9275twGnXRdiKlpV7kHlOv-NxBw&oe=6AEB0083",
"config_width": 720,
"config_height": 506
},
{
"src": "https://scontent-fra5-1.cdninstagram.com/v/t51.82787-15/874355210_18644578207004135_6009842855742675310_n.jpg?stp=dst-jpg_e15_s640x640_tt6&_nc_cat=100&ig_cache_key=NDAxOTY5NTE0MzQ2MDIxMDk3MjE4NjQ0NTc4MjA0MDA0MTM1.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNMSVBTLnhwaWRzLjcyMC5zZHIudmlkZW9fdXNlcl9zZWxlY3RlZF90aHVtYm5haWwuQzMifQ%3D%3D&_nc_ohc=jiuH08gxR-UQ7kNvwEhFWEv&_nc_oc=AdpqckQyCQPV-2GIsLEePsnM3OkN0Qxd35INSdQRiEcG0k_ilHAVrX_UcfWw9cz9FMw&_nc_zt=23&_nc_ht=scontent-fra5-1.cdninstagram.com&_nc_gid=AurjIQpTzCx0zkhifUWrBg&_nc_ss=7060f&oh=00_AQS1dgCJVbPnKwyP9gf442dDrUD3XTZzXdzz-VZ9sltSKA&oe=6AEB0083",
"config_width": 640,
"config_h…
Fields you’ll commonly read in the response:
- post.shortcode: the unique post shortcode you queried.
- post.is_video: boolean flag that tells you if you should expect a video asset.
- post.dimensions.width/height: use to size containers or generate responsive placeholders.
- post.display_url and post.display_resources[i].src: media URLs you can store or cache as needed.
- post.accessibility_caption: useful for alt text or content auditing.
2) Profile Details
Method: GET
URL: https://zylalabs.com/api/855/instagram-data-api/37572/profile-details
Required query parameter:
- id_or_username (string): Instagram username or numeric ID. Example: cristiano
What it returns: detailed Instagram profile information, including username, biography, verification status, profile picture, follower and following counts, external links, story highlights, and account details.
Official curl example:
curl -s -X GET "https://zylalabs.com/api/855/instagram-data-api/37572/profile-details?id_or_username=cristiano" \
-H "Authorization: Bearer YOUR_API_KEY"
Official JSON (verbatim) response example:
{
"status": "ok",
"data": {
"user": {
"pk": "173560420",
"username": "cristiano",
"profile_pic_url": "https://scontent-fra5-1.cdninstagram.com/v/t51.2885-19/472007201_1142000150877579_994350541752907763_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ccb=7-5&_nc_sid=f7ccc5&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDgwLkMzIn0%3D&_nc_ohc=YjSGq_4F5PwQ7kNvwGAf5GW&_nc_oc=AdrE9TNJ3DCmDwEYUzm5V1uTncNAl5vdTNunoBb6plzuRC7AMBnUZ4VPbRqG3H4p4dc&_nc_zt=24&_nc_ht=scontent-fra5-1.cdninstagram.com&_nc_ss=7060f&oh=00_AQQkDdv_NHNUxezd5SGePgHmJXPwMrXfPk1NrU-e_bz62w&oe=6AEB1EDE",
"is_private": false,
"is_unpublished": false,
"latest_reel_media": 0,
"biography": "",
"full_name": "Cristiano Ronaldo",
"is_verified": true,
"text_post_app_badge_label": null,
"show_text_post_app_badge": false,
"account_badges": [],
"bio_links": [
{
"image_url": "",
"is_pinned": false,
"link_id": "18122242507586533",
"link_type": "external",…
Fields you’ll commonly read in the response:
- user.username and user.pk: canonical keys for your user store.
- user.is_verified and user.is_private: for verification checks and gating flows.
- user.profile_pic_url: show an avatar or store for CDN caching.
- user.full_name and user.biography: useful for enriched author cards next to embedded posts.
- user.bio_links: extract off-platform destinations for link analysis or partner attribution.
End-to-end examples you can paste
Python: Fetch Post Information and normalize for rendering
This Python example calls the Post Information endpoint, extracts media sizing, alt text, and a preferred display URL for your front-end.
import os
import requests
API_KEY = os.getenv("ZYLA_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()
post = data.get("data", {}).get("post", {})
is_video = post.get("is_video")
dims = post.get("dimensions", {})
width, height = dims.get("width"), dims.get("height")
# Choose a display resource: highest config_width if available, else display_url fallback
display_resources = post.get("display_resources", []) or []
best = None
if display_resources:
best = max(display_resources, key=lambda r: r.get("config_width", 0))
display_src = (best or {}).get("src") or post.get("display_url")
normalized = {
"shortcode": post.get("shortcode"),
"is_video": is_video,
"width": width,
"height": height,
"src": display_src,
"alt": post.get("accessibility_caption") or "",
}
print(normalized)
JavaScript (Node.js): Fetch Profile Details by username
This Node.js snippet requests a public profile by username and extracts verification and avatar metadata for an author badge component.
import fetch from "node-fetch";
const API_KEY = process.env.ZYLA_API_KEY || "YOUR_API_KEY";
const username = "cristiano";
const url = "https://zylalabs.com/api/855/instagram-data-api/37572/profile-details?id_or_username=" + encodeURIComponent(username);
const res = await fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
});
if (!res.ok) {
throw new Error(`Request failed: ${res.status} ${res.statusText}`);
}
const json = await res.json();
const user = (json.data && json.data.user) || {};
const author = {
username: user.username,
fullName: user.full_name,
verified: user.is_verified === true,
private: user.is_private === true,
avatar: user.profile_pic_url || null
};
console.log(author);
Practical implementation notes
- Shortcode input: The Post Information endpoint requires the post’s shortcode (not a full URL). Store shortcodes as your canonical key for post lookups.
- Choosing image variants: The response includes display_resources with multiple sizes. Pick the largest config_width you support to reduce layout shifts.
- Alt text: accessibility_caption is a strong default for alt text. Fall back gracefully if it’s missing.
- Caching: Media URLs can change; cache normalized payloads (shortcode → chosen image, width/height, alt) and implement refresh on a schedule suitable for your UI.
- Error handling: Always check for presence of data.data.post or data.data.user before dereferencing fields.
- Quotas: Zyla uses subscription + quota. Monitor your request usage and implement simple local caches to avoid duplicate lookups in hot paths.
Common social media use cases you can ship this week
1) Post preview cards in content editors
Let editors paste an Instagram post URL, parse the shortcode, and call Post Information to pre-fill a preview card with media, dimensions, and caption snippets. Store the normalized payload for immediate rendering and avoid layout jumps using the width/height.
2) Author badges with verification and avatar
When you render an Instagram post or quote, call Profile Details with the username to show an accurate avatar, the display name, and a verification badge conditionally on user.is_verified.
3) Brand monitoring pipelines
Keep a watchlist of usernames and periodically refresh Profile Details to track verification changes, username updates, or bio link changes. Downstream alerts can fire on changes to bio_links or is_private toggles.
4) Enriched link-out analytics
When a partner lists their Instagram handle, use Profile Details to confirm the handle exists and pull bio_links to discover their off-platform destinations before routing traffic or attributing conversions.
5) Content moderation and accessibility checks
Use accessibility_caption as a signal for automated alt tagging checks. Flag posts missing alt-like content in workflows where compliance or accessibility standards are required.
Calling the API from AI agents via MCP
You can wire the same endpoints into AI agents that support the Model Context Protocol (MCP), including Claude Code, Cursor, and Windsurf. Configure your agent to call Zyla’s MCP gateway:
- Endpoint: MCP
- API Key: pass YOUR_API_KEY as configured by your MCP-compatible client
At runtime, your agent can request the same URLs shown above. Keep authentication consistent: Authorization: Bearer YOUR_API_KEY.
Operational tips for production
- Normalize early: Convert responses into a stable internal shape (e.g., Post {shortcode, isVideo, w, h, src, alt}). Store that alongside timestamps for cache invalidation.
- Retry policy: Implement brief, bounded retries on 5xx network failures; log 4xx responses for visibility and avoid loops.
- Safe rendering: Always guard optional fields (e.g., display_resources may be absent; fall back to display_url).
- Batching patterns: When enriching a queue of usernames, stagger calls and de-duplicate within a time window to stay within your subscription quota.
Reference: Official examples (as returned by the Hub)
Post Information: cURL
curl -s -X GET "https://zylalabs.com/api/855/instagram-data-api/37566/post-information?code=DfI02-LTwkc" \
-H "Authorization: Bearer YOUR_API_KEY"
Post Information: JSON
{
"status": "ok",
"data": {
"post": {
"__typename": "GraphVideo",
"id": "4019695143460210972",
"shortcode": "DfI02-LTwkc",
"dimensions": {
"height": 718,
"width": 1020
},
"display_url": "https://scontent-fra5-1.cdninstagram.com/v/t51.82787-15/874355210_18644578207004135_6009842855742675310_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=100&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=jiuH08gxR-UQ7kNvwEhFWEv&_nc_oc=AdpqckQyCQPV-2GIsLEePsnM3OkN0Qxd35INSdQRiEcG0k_ilHAVrX_UcfWw9cz9FMw&_nc_zt=23&_nc_ht=scontent-fra5-1.cdninstagram.com&_nc_gid=AurjIQpTzCx0zkhifUWrBg&_nc_ss=7020f&oh=00_AQSFeFgTX4qgUU-VPIinjkrZASMg4NkxlFyIzab67V5zow&oe=6AEB0083",
"is_video": true,
"accessibility_caption": "Video by Tesla on October 30, 2026. May be an image of limousine, minivan, night and text.",
"display_resources": [
{
"src": "https://scontent-fra5-1.cdninstagram.com/v/t51.82787-15/874355210_18644578207004135_6009842855742675310_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=100&ig_cache_key=NDAxOTY5NTE0MzQ2MDIxMDk3MjE4NjQ0NTc4MjA0MDA0MTM1.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNMSVBTLnhwaWRzLjcyMC5zZHIudmlkZW9fdXNlcl9zZWxlY3RlZF90aHVtYm5haWwuQzMifQ%3D%3D&_nc_ohc=jiuH08gxR-UQ7kNvwEhFWEv&_nc_oc=AdpqckQyCQPV-2GIsLEePsnM3OkN0Qxd35INSdQRiEcG0k_ilHAVrX_UcfWw9cz9FMw&_nc_zt=23&_nc_ht=scontent-fra5-1.cdninstagram.com&_nc_gid=AurjIQpTzCx0zkhifUWrBg&_nc_ss=7060f&oh=00_AQR9wbRhfpvbBzM62jt9275twGnXRdiKlpV7kHlOv-NxBw&oe=6AEB0083",
"config_width": 720,
"config_height": 506
},
{
"src": "https://scontent-fra5-1.cdninstagram.com/v/t51.82787-15/874355210_18644578207004135_6009842855742675310_n.jpg?stp=dst-jpg_e15_s640x640_tt6&_nc_cat=100&ig_cache_key=NDAxOTY5NTE0MzQ2MDIxMDk3MjE4NjQ0NTc4MjA0MDA0MTM1.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNMSVBTLnhwaWRzLjcyMC5zZHIudmlkZW9fdXNlcl9zZWxlY3RlZF90aHVtYm5haWwuQzMifQ%3D%3D&_nc_ohc=jiuH08gxR-UQ7kNvwEhFWEv&_nc_oc=AdpqckQyCQPV-2GIsLEePsnM3OkN0Qxd35INSdQRiEcG0k_ilHAVrX_UcfWw9cz9FMw&_nc_zt=23&_nc_ht=scontent-fra5-1.cdninstagram.com&_nc_gid=AurjIQpTzCx0zkhifUWrBg&_nc_ss=7060f&oh=00_AQS1dgCJVbPnKwyP9gf442dDrUD3XTZzXdzz-VZ9sltSKA&oe=6AEB0083",
"config_width": 640,
"config_h…
Profile Details: cURL
curl -s -X GET "https://zylalabs.com/api/855/instagram-data-api/37572/profile-details?id_or_username=cristiano" \
-H "Authorization: Bearer YOUR_API_KEY"
Profile Details: JSON
{
"status": "ok",
"data": {
"user": {
"pk": "173560420",
"username": "cristiano",
"profile_pic_url": "https://scontent-fra5-1.cdninstagram.com/v/t51.2885-19/472007201_1142000150877579_994350541752907763_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ccb=7-5&_nc_sid=f7ccc5&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDgwLkMzIn0%3D&_nc_ohc=YjSGq_4F5PwQ7kNvwGAf5GW&_nc_oc=AdrE9TNJ3DCmDwEYUzm5V1uTncNAl5vdTNunoBb6plzuRC7AMBnUZ4VPbRqG3H4p4dc&_nc_zt=24&_nc_ht=scontent-fra5-1.cdninstagram.com&_nc_ss=7060f&oh=00_AQQkDdv_NHNUxezd5SGePgHmJXPwMrXfPk1NrU-e_bz62w&oe=6AEB1EDE",
"is_private": false,
"is_unpublished": false,
"latest_reel_media": 0,
"biography": "",
"full_name": "Cristiano Ronaldo",
"is_verified": true,
"text_post_app_badge_label": null,
"show_text_post_app_badge": false,
"account_badges": [],
"bio_links": [
{
"image_url": "",
"is_pinned": false,
"link_id": "18122242507586533",
"link_type": "external",…
Testing and monitoring
- Smoke tests: Add a CI step that requests a known shortcode and username and asserts presence of required fields before deploying UI changes.
- Observability: Log decode failures with the original request URL (no secrets) to debug parameter issues quickly.
- Backoff: On repeated non-200 responses, back off and surface a dashboard alert—don’t spin.
FAQ
Q: How do I authenticate?
A: Include the header Authorization: Bearer YOUR_API_KEY in every request.
Q: Where do I get an API key?
A: Open the marketplace listing and click Subscribe or Start Free Trial, then copy your key from the dashboard.
Q: What parameters are required for each endpoint?
A: Post Information requires code (the post shortcode). Profile Details requires id_or_username (a username or numeric ID).
Q: Can I call these endpoints from AI coding agents?
A: Yes. Use Zyla’s MCP gateway and configure your agent to forward the same URLs and Authorization header. See the MCP endpoint.
Q: Is there a free plan?
A: There is no free plan. The Hub uses subscription + quota, and for a first API you can start a 7-day trial or 50 requests. Check the listing for current access options.
Ready to ship your Instagram integration? Create an account, subscribe, and start building with the Instagram Data API on Zyla API Hub.