You need to programmatically fetch full Instagram post details (title/caption, author, counts, media URLs) for a URL you already have. By the end of this guide, you’ll retrieve those fields from a single endpoint, parse them in code, and know where to go for reels and highlight stories too—all using one API key on Zyla API Hub.
What you’ll build with this API
The Instagram Profile And Media Data API returns structured details for Instagram content you already know by URL or ID. You can:
- Resolve a post URL to its ID, caption/title, author info, like/comment counts, and media download URLs.
- Look up a reel by URL and read its author, engagement, and downloadable media link.
- Expand an Instagram highlight (by highlight ID) into its individual stories with media URLs.
Developers use this to power CMS imports, backlink previews, social proof widgets, feed mirroring, and automated archival flows.
Getting started on Zyla API Hub
Open the API listing on Zyla API Hub and start a 7‑day trial (or use the 50-request option when available) to get your key. Billing is subscription + quota, not pay‑per‑call, and there is no free plan. Your API key authorizes requests via an Authorization header.
Start 7-day trial on Instagram Profile And Media Data API
With one key from Zyla API Hub, you can call thousands of APIs across categories. The same subscription model and key apply across the marketplace.
Endpoint you came for: Get Post Details
Retrieve detailed information about a specific Instagram post using its URL (or ID you already have).
- Method: GET
- Request URL: https://zylalabs.com/api/12390/instagram-profile-and-media-data-api/23420/get-post-details
- Required query parameter: idOrUrl (string)
Example: pass the post URL.
curl -s -X GET "https://zylalabs.com/api/12390/instagram-profile-and-media-data-api/23416/get-profile-details?username=a92_mm" \
-H "Authorization: Bearer YOUR_API_KEY"
Official example response
{
"data": {
"id": "8640409651",
"username": "a92_mm",
"fullName": "",
"avatarUrl": "https://scontent-sea5-1.cdninstagram.com/v/t51.2885-19/117330532_764310710994941_3178952573818498232_n.jpg?_nc_cat=105&ig_cache_key=GGRS-gb9R230IrcCALjsQ_iF6B0sbkULAAAB0j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy42NTYuQzMifQ%3D%3D&_nc_ohc=UhqRB5XucjcQ7kNvwHzZrZa&_nc_oc=AdqQKMjA1CNJE2cZFGaOKLPAekcrEXjIih5fmtbyZIyBJ-ZZBqfAyZouTn139aCO8yM&_nc_zt=24&_nc_ht=scontent-sea5-1.cdninstagram.com&_nc_ss=7b62e&oh=00_AQSK1vbEqHI8iXnKTfwnP4mNcPHclgCyRAq7u5j4Lij_Pg&oe=6AE96358",
"biography": "",
"category": "",
"bioLinks": [],
"linkedFacebookInfo": null,
"followerCount": 5,
"followingCount": 34,
"isPrivateAccount": true,
"isVerified": false,
"totalPosts": 9
}
}
Field notes for implementers:
- data.id and data.code identify the post; code maps to the /p/{code} path.
- data.title is the post caption/title. Store it as UTF‑8.
- data.createdAt is a Unix timestamp (seconds). Convert as needed in your timezone handling.
- data.author includes canonical username, verification status, and avatar URL.
- data.statistics.likeCount and commentCount provide engagement metrics.
- data.mediaList contains downloadable media URLs you can fetch directly. Respect the destination host’s caching and link expiry policies; cache the resolved file on your side if you need stable assets.
Python example: get a post by URL and read key fields
import os
import requests
from datetime import datetime, timezone
API_KEY = os.getenv("ZYLA_API_KEY", "YOUR_API_KEY")
POST_URL = "https://www.instagram.com/p/DfALy1PTBSa/"
endpoint = "https://zylalabs.com/api/12390/instagram-profile-and-media-data-api/23420/get-post-details"
params = {"idOrUrl": POST_URL}
headers = {"Authorization": f"Bearer {API_KEY}"}
resp = requests.get(endpoint, params=params, headers=headers, timeout=20)
resp.raise_for_status()
data = resp.json().get("data", {})
post_id = data.get("id")
code = data.get("code")
title = data.get("title", "")
created_at = data.get("createdAt")
dt = datetime.fromtimestamp(created_at, tz=timezone.utc) if created_at else None
author = data.get("author", {})
username = author.get("username")
is_verified = author.get("isVerified")
stats = data.get("statistics", {})
likes = stats.get("likeCount")
comments = stats.get("commentCount")
media = data.get("mediaList", [])
first_download_url = media[0].get("downloadUrl") if media else None
print("Post:", post_id, code)
print("Author:", username, "(verified)" if is_verified else "")
print("Caption:", title)
print("Created at (UTC):", dt)
print("Engagement: likes =", likes, ", comments =", comments)
print("First media URL:", first_download_url)
Other available endpoints you may need next
If your integration expands beyond static posts, the same API covers reels and highlight stories.
Get Reel Details
- Method: GET
- Request URL: https://zylalabs.com/api/12390/instagram-profile-and-media-data-api/23421/get-reel-details
- Required query parameter: idOrUrl (string), e.g. a reel URL
This returns the reel’s id, code, author block, createdAt, title, statistics (like/comment counts), and a downloadUrl. Handle createdAt as a Unix epoch (seconds) and store author.username for attribution.
Get Highlight Story Details
- Method: GET
- Request URL: https://zylalabs.com/api/12390/instagram-profile-and-media-data-api/23422/get-highlight-story-details
- Required query parameter: id (string), which is the highlight ID
Use this when you already know a highlight ID and need all included stories. You’ll receive the highlight’s title, totalStories, and an array of stories with mediaType, createdAt, thumbnailUrl, and downloadUrl per story.
Official hub listing example (profile details)
The API also exposes a profile lookup. Below is the official example from the Zyla Hub listing for reference.
Store followerCount/totalPosts snapshots if you plan to trend metrics over time. isPrivateAccount may limit what downstream media endpoints can return for that user.
Practical implementation notes
- Authentication: send Authorization: Bearer YOUR_API_KEY on every request.
- Timestamps: createdAt fields are Unix epoch seconds. Convert using UTC, then format in the user’s timezone if needed.
- Media downloads: downloadUrl and thumbnailUrl point to CDN resources. These links can expire; if you need longevity, download and store assets in your own storage with cache validation.
- Error handling: treat empty data or missing fields as non-fatal; social content may be deleted or restricted.
- Request volume: the hub uses subscription + quota (not pay‑per‑call). First access options are a 7‑day trial or 50 requests when available. Check the API page for current access options and pricing.
Call these endpoints from AI agents via MCP
If you automate via AI coding tools (Claude Code, Cursor, Windsurf or any MCP‑compatible client), you can route requests through Zyla’s MCP endpoint:
- Endpoint for agents: https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY
- Tooling doc: MCP
Expose a tool in your agent that calls the exact hub URLs documented above, pass the Authorization header, and parse the same JSON structures. Keep the business logic (e.g., picking the first mediaList item) in your agent’s tool code to minimize model tokens.
End-to-end examples you can ship this week
- Auto-embed a post in a CMS: resolve idOrUrl to title, author.username, statistics.likeCount, and mediaList[0].downloadUrl; cache for 24 hours; revalidate on publish.
- Weekly engagement snapshot: periodically fetch posts you care about and record statistics.likeCount/commentCount and createdAt for trend charts.
- Reels feature rail: get-reel-details by URL, display author.profilePictureUrl, title, and a play button bound to downloadUrl.
- Highlight gallery: for a known highlight id, list stories[].thumbnailUrl in a grid; on click, stream stories[].downloadUrl.
Reference: real endpoints and parameters
- Get Post Details (GET): https://zylalabs.com/api/12390/instagram-profile-and-media-data-api/23420/get-post-details
- Required param: idOrUrl (string), e.g. https://www.instagram.com/p/DfALy1PTBSa/
- Get Reel Details (GET): https://zylalabs.com/api/12390/instagram-profile-and-media-data-api/23421/get-reel-details
- Required param: idOrUrl (string), e.g. https://www.instagram.com/reel/DctYV2qt6S5/
- Get Highlight Story Details (GET): https://zylalabs.com/api/12390/instagram-profile-and-media-data-api/23422/get-highlight-story-details
- Required param: id (string), e.g. 17910014403011985
- Get Profile Details (GET, listing example): https://zylalabs.com/api/12390/instagram-profile-and-media-data-api/23416/get-profile-details
- Required param: username (string)
Explore more categories on Zyla API Hub; the marketplace lists more than 10,000 public APIs under a single account and key.
FAQ
How do I authenticate?
Send an HTTP header: Authorization: Bearer YOUR_API_KEY on every request.
What format is createdAt?
Unix epoch seconds. Convert to a datetime in UTC, then format to your preferred timezone.
Do media URLs expire?
They can. If you need stable assets, fetch downloadUrl and store the content in your own storage, respecting source terms.
Is there a free plan?
No free plan. You can start with a 7‑day trial or 50 requests when available; check the API page for current access options and pricing.
Can I call these endpoints from an AI agent?
Yes. Use the MCP gateway at https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY and have the agent call the same hub URLs with the Authorization header.
Ready to ship? Grab your key and start calling the endpoints from the listing page: Start 7-day trial on Instagram Profile And Media Data API.