You need an API to pull Instagram profile details you can ship this week. By the end of this guide, you’ll fetch a user’s profile (id, username, counts, verification, privacy), and you’ll know how to read reels, posts, and highlight stories using production-ready endpoints on Zyla API Hub.
What you get from this API
The Instagram Profile And Media Data API exposes read-only endpoints to retrieve:
- Profile details by username: id, avatar, bio, follower/following counts, verification and privacy flags, and total posts.
- Post details by URL or id: title, author, counts, media list, and download links.
- Reel details by URL or id: author, counts, title, creation time, and a download URL.
- Highlight story details by highlight id: title, total stories, and each story’s media type, timestamps, thumbnails, and download links.
These endpoints power user-facing profiles, CRM and enrichment dashboards, content moderation/review tools, and media ingestion workflows where you must resolve a public Instagram resource into structured fields you can cache and index.
Getting started on Zyla API Hub
Open the marketplace page for the API, subscribe, and get your key. The first API offers a 7-day trial or 50 requests—check the API page for current access options and pricing. Authentication is via HTTP header: Authorization: Bearer YOUR_API_KEY.
- Start 7-day trial on Instagram Profile And Media Data API
- Browse more than 10,000 public APIs on Zyla API Hub
Endpoint: Get Profile Details
Retrieve profile data for a given Instagram username.
- Method: GET
- URL: https://zylalabs.com/api/12390/instagram-profile-and-media-data-api/23416/get-profile-details
- Required query parameters:
- username (string) — the Instagram handle to resolve
cURL example
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 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
}
}
Notes:
- Counts are integers you can display directly.
- isPrivateAccount controls whether you should attempt to fetch media for UI previews.
- avatarUrl is a CDN URL suitable for direct rendering; consider caching.
Python example
This sample calls the same endpoint and extracts the fields you’ll typically store.
import os
import requests
API_KEY = os.getenv("ZYLA_API_KEY", "YOUR_API_KEY")
USERNAME = "a92_mm"
url = "https://zylalabs.com/api/12390/instagram-profile-and-media-data-api/23416/get-profile-details"
params = {"username": USERNAME}
headers = {"Authorization": f"Bearer {API_KEY}"}
resp = requests.get(url, params=params, headers=headers, timeout=20)
resp.raise_for_status()
data = resp.json().get("data", {})
profile = {
"id": data.get("id"),
"username": data.get("username"),
"full_name": data.get("fullName"),
"avatar_url": data.get("avatarUrl"),
"bio": data.get("biography"),
"followers": data.get("followerCount"),
"following": data.get("followingCount"),
"is_private": data.get("isPrivateAccount"),
"is_verified": data.get("isVerified"),
"total_posts": data.get("totalPosts"),
}
print(profile)
Endpoint: Get Post Details
Retrieve detailed information about a specific post using an id or a canonical Instagram URL.
- Method: GET
- URL: https://zylalabs.com/api/12390/instagram-profile-and-media-data-api/23420/get-post-details
- Required query parameters:
- idOrUrl (string) — e.g. https://www.instagram.com/p/DfALy1PTBSa/
cURL example
The response returns fields like id, code, title, createdAt (Unix epoch seconds), author (id, username, fullName, isVerified, profilePictureUrl), totalMedia, statistics (likeCount, commentCount), and mediaList with downloadUrl entries.
Endpoint: Get Reel Details
Retrieve detailed information about a specific Instagram reel by id or URL.
- Method: GET
- URL: https://zylalabs.com/api/12390/instagram-profile-and-media-data-api/23421/get-reel-details
- Required query parameters:
- idOrUrl (string) — e.g. https://www.instagram.com/reel/DctYV2qt6S5/
cURL example
The response includes top-level fields like id, code, createdAt (Unix epoch seconds), title, statistics (commentCount, likeCount), author (id, username, fullName, isVerified, profilePictureUrl), and a downloadUrl.
Endpoint: Get Highlight Story Details
Retrieve all stories inside a specific Instagram highlight using the highlight id.
- Method: GET
- URL: https://zylalabs.com/api/12390/instagram-profile-and-media-data-api/23422/get-highlight-story-details
- Required query parameters:
- id (string) — the highlight id, e.g. 17910014403011985
cURL example
The response returns highlight-level fields like id, title, totalStories, and a stories array with each story’s id, mediaType (IMAGE or VIDEO), createdAt (Unix epoch seconds), thumbnailUrl, and downloadUrl.
Practical implementation notes
- Timestamps: createdAt values are Unix epoch seconds. Convert to your app’s timezone on display.
- Caching: profile fields and author avatars change infrequently; cache for minutes to hours. Media URLs are CDN links and may expire; refresh as needed.
- Privacy: if isPrivateAccount is true, do not assume you can access media via other endpoints. Guard your UI and background jobs accordingly.
- Media handling: downloadUrl fields are direct links. Stream to storage instead of proxying through your API to reduce egress.
- Error handling: treat non-2xx as transient unless you validate the username/URL beforehand. Log the requested username or idOrUrl and the HTTP status.
- Quotas: billing is subscription + quota, not pay-per-call. Track your call counts and use caching to stay within plan limits.
End-to-end workflow examples
Profile enrichment for a sign-up form
- User enters an Instagram handle in your product.
- Call Get Profile Details with the username and store id, followerCount, isPrivateAccount, isVerified, and avatarUrl.
- Render the avatar and verification badge in your UI. Disable media previews when isPrivateAccount is true.
Editorial ingestion pipeline
- Editor pastes a post URL into your CMS.
- Call Get Post Details with idOrUrl and extract title, author.username, statistics.likeCount, and mediaList[0].downloadUrl.
- Queue a downloader to fetch the media via downloadUrl and store it in your CDN. Cache post metadata for quick page load.
Reel analytics snapshot
- Nightly job iterates a list of reel URLs.
- Call Get Reel Details for each and save statistics.commentCount and statistics.likeCount with a timestamp for trend charts.
Highlight gallery
- Given a known highlight id, call Get Highlight Story Details.
- List stories in chronological order by createdAt. Use thumbnailUrl for grid preview and gate full-size requests behind a click.
Call the API from AI agents via MCP
Every Zyla API is accessible from MCP-compatible developer tools (Claude Code, Cursor, Windsurf, etc.) using the MCP endpoint at: https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY. This lets you wire an agent to call the same Instagram endpoints you saw above without rolling custom network code inside the agent.
Learn more and plug your key into the MCP endpoint here: MCP.
Why ship this with Zyla
- One account, one key, one subscription for every API you add to your stack.
- Consistent Bearer auth and hub-hosted endpoints, so you don’t juggle per-vendor SDKs.
- Add more capabilities any time by browsing Zyla API Hub and subscribing with the same billing identity.
Field mapping cheat sheet
- Profiles: id, username, fullName, avatarUrl, biography, followerCount, followingCount, isPrivateAccount, isVerified, totalPosts.
- Posts: id, code, title, createdAt, author{ id, username, fullName, isVerified, profilePictureUrl }, totalMedia, statistics{ likeCount, commentCount }, mediaList[ ].
- Reels: id, code, createdAt, title, statistics{ commentCount, likeCount }, author{ ... }, downloadUrl.
- Highlight stories: id, title, totalStories, stories[ { id, mediaType, createdAt, thumbnailUrl, downloadUrl } ].
Shipping checklist
- Store the profile id alongside the username for stable foreign keys.
- Normalize timestamps to UTC and format on the client.
- Backoff and retry on transient HTTP errors; short-circuit on 4xx with validation.
- Cache profile details and author pictures; set a TTL that fits your quota.
- Guard media fetches with isPrivateAccount and handle empty media arrays safely.
FAQ
What authentication does this API use?
Use the header Authorization: Bearer YOUR_API_KEY on every request.
Can I query by username for profiles and by URL for media?
Yes. Get Profile Details uses username. Get Post Details and Get Reel Details accept idOrUrl, so you can pass a canonical Instagram URL.
What timezone are dates in?
createdAt fields are Unix epoch seconds (UTC). Convert client-side to your user’s timezone.
How is billing handled?
Zyla uses subscription + quota, not pay-per-call. The first API offers a 7-day trial or 50 requests; check the API page for current access options and pricing.
Can I invoke these endpoints from an AI coding agent?
Yes. Use the MCP endpoint at https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY. See: MCP.
Ready to implement profile lookups and media fetches? Create your account, get an API key, and start your 7-day trial on the listing page: Start 7-day trial on Instagram Profile And Media Data API.