Instagram Data API
Start with a public profile lookup, then page through posts, Reels, comments, hashtags, locations and audio. Every read is a simple GET over publicly visible content; engagement counts are collection-time snapshots, not official account Insights.
Open the standalone Instagram demoYour first Instagram profile lookup
Replace <API_KEY> with an authorized platform API key from your dashboard. The query URL contains your key; keep it out of shared links, screenshots and logs.
The example resolves the public username instagram through the profile lookup. It is a long-standing public account, but any field can change between runs; a miss returns HTTP 200 with detail Not found, which is a business-level result rather than a profile.
Base URL https://api.opendata-api.com
curl -X GET 'https://api.opendata-api.com/api/project/instagram/user-info?key=<API_KEY>&username_or_id=instagram'import requests
response = requests.request(
"GET",
"https://api.opendata-api.com/api/project/instagram/user-info",
params={
"key": "<API_KEY>",
"username_or_id": "instagram",
},
timeout=30,
)
response.raise_for_status()
print(response.json())const url = new URL("https://api.opendata-api.com/api/project/instagram/user-info");
url.search = new URLSearchParams({
"key": "<API_KEY>",
"username_or_id": "instagram",
}).toString();
const response = await fetch(url, {
method: "GET",
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());Instagram request basics
- Continuation tokens are opaque strings returned per response. Omit pagination_token on the first request, pass the returned top-level token into the next one, and stop when no usable token comes back; discard a token that repeats unchanged. The hashtag-posts top feed and post-likes use next_page and end_cursor instead β never mix token kinds across endpoints.
- A missing username can return HTTP 200 with detail Not found. Check the gateway's code/message/data business status separately from HTTP status, then check payload-level detail before treating a lookup as a profile. Empty items lists in search endpoints are valid no-match results, not failures.
- Media links inside image_versions2, video_versions, carousel_media, Stories and highlight items are time-limited. Download or re-resolve promptly, record collection timestamps, and fetch fresh links instead of hard-coding old ones; url_embed_safe=true rewrites URLs for cross-origin embedding where supported.
- Reads cover publicly visible content only: private-account posts, Stories and lists stay inaccessible, follower and liker pages are samples rather than complete exports, and like, comment and play counts are collection-time snapshots, not official account Insights. Build deduplication and coverage notes into every dataset.
Check status before reading profile fields
Check HTTP status separately from the gateway's code/message/data business status: code 200 indicates gateway business success, but HTTP 200 alone does not. Inside a successful payload a profile lookup can still carry detail Not found for a missing username β treat that as a business-level miss, not as a partial profile.
Choose an Instagram workflow
- Resolve and enrich public profiles
-
Start from a handle with user-info or from a keyword with user-search, then reuse the returned numeric id across endpoints. user-followers and user-following page through accessible audience records with pagination_token; similar-users returns discovery leads to confirm through user-info.
- Collect posts, Reels and tags
-
user-posts, user-reels and user-tagged-posts take username_or_id and continue with the returned pagination_token; deduplicate pages by media id. post-detail resolves one code_or_url shortcode or full link into the numeric media id that joins items across endpoints.
- Research hashtags and topic Reels
-
search-hashtag expands a keyword into candidate tag names before any collection. hashtag-posts reads one tag's top, recent or Reels feed β recent and reels continue with pagination_token while top uses next_page. search-reels finds keyword-matched Reels and pages the same way.
- Read comments, replies and likers
-
post-comments needs a post's code_or_url and returns each comment's pk with its reply count. post-comment-replies consumes that pk as comment_id together with the same code_or_url. post-likes samples visible likers through end_cursor rather than pagination_token.
- Discover places and geotagged posts
-
search-location resolves a place name and search-coordinates resolves a latitude/longitude point into candidate location IDs; disambiguate with the returned address and coordinates. location-info enriches one location_id and posts-location collects its tagged posts. Geotags are author claims, not proof of presence.
- Capture Stories and highlights
-
user-stories and user-highlights take username_or_id; Stories reflect what is visible at collection time and cannot be recovered after expiry. user-highlight-detail needs a highlight_id from the highlights list and returns time-limited media URLs per item.
- Study sounds and their Reels
-
search-music-audio resolves a song or artist keyword into candidate audio records, music-audio-info enriches one audio_canonical_id, and posts-music lists Reels using it with pagination_token. A Reel's clips_metadata.audio_canonical_id is the other entry point.
Profiles
/api/project/instagram/user-info Get Instagram Profile by Username or ID
Full docs βDetails
Resolve a public Instagram account by username or numeric user ID. Pass username_or_id, e.g. the handle instagram or the ID 25025320; both forms resolve to the same record. The live-verified response wraps the profile in data: id, username, full_name, biography, follower_count, following_count, media_count, is_verified, is_private, profile_pic_url and profile_pic_url_hd, plus external_url, bio_links and account-category fields when present. Set include_about=true to add an about object with country and date_joined where the profile exposes them. A miss returns HTTP 200 with exactly {"detail":"Not found"} β treat it as a business-level not-found, not as a profile.
Test this Instagram endpoint 1 required Β· 2 optional
| Parameter | In | Value |
|---|---|---|
| query |
Optional inputs and continuation controls (2)
| Parameter | In | Value |
|---|---|---|
| query | ||
| query |
/api/project/instagram/user-search Search Instagram Accounts by Keyword
Full docs βDetails
Find public Instagram accounts matching a name or keyword. Pass keyword, e.g. instagram. The live-verified response returns data.count and data.items[], where each candidate carries id, username, full_name, is_verified, is_private, profile_pic_url and profile_pic_id; a search for instagram returned 47 accounts led by the verified official account (id 25025320). Results are relevance-ranked candidates β a search match is not proof of identity, so confirm a chosen account with the user info endpoint. An unmatched keyword returns an empty items list.
Test this Instagram endpoint 1 required Β· 0 optional
| Parameter | In | Value |
|---|---|---|
| query |
/api/project/instagram/user-followers Get Instagram Follower List by Username or ID
Full docs βDetails
Page through the accessible follower list of a public account. Pass username_or_id; leave pagination_token empty on the first request, then pass the top-level pagination_token from the previous response to continue. The live-verified response contains data.count (records in this page), data.total (the account's reported follower total) and data.items[] with id, username, full_name, is_private, is_verified, profile_pic_url and latest_story_ts per follower. A page for instagram returned 50 records against a reported total in the hundreds of millions. Treat each page as a sample: page count, reported total and collected records are three different numbers, and private accounts in the list do not expose their content.
Test this Instagram endpoint 1 required Β· 1 optional
| Parameter | In | Value |
|---|---|---|
| query |
Optional inputs and continuation controls (1)
| Parameter | In | Value |
|---|---|---|
| query | Optional continuation token: leave empty on the first request, then pass the top-level pagination_token from the previous response to fetch the next page. Tokens are opaque, short-lived and endpoint-specific; discard one that comes back unchanged. |
/api/project/instagram/user-following Get Accounts an Instagram User Follows
Full docs βDetails
List the accounts a public Instagram user follows. Pass username_or_id and optionally count (default and maximum 50 per page); continue with the pagination_token returned by the previous response. Records mirror the follower-list shape: id, username, full_name, is_private, is_verified and profile_pic_url. This is the outgoing-follow direction β a brand's following list is often a curated map of partners, sister accounts and organizations it endorses, complementing the follower list for relationship research.
Test this Instagram endpoint 1 required Β· 2 optional
| Parameter | In | Value |
|---|---|---|
| query |
Optional inputs and continuation controls (2)
| Parameter | In | Value |
|---|---|---|
| query | ||
| query | Optional continuation token: leave empty on the first request, then pass the top-level pagination_token from the previous response to fetch the next page. Tokens are opaque, short-lived and endpoint-specific; discard one that comes back unchanged. |
/api/project/instagram/similar-users Find Similar Instagram Accounts
Full docs βDetails
Suggest accounts similar to a given public Instagram username or user ID. Pass username_or_id, e.g. mrbeast or 2278169415. The documented response returns a list of related account records with the usual identity fields: id, username, full_name, verification flag and profile picture. Treat suggestions as discovery leads to review, not as a measured similarity score β the endpoint does not expose why two accounts were linked, so validate each suggestion with a profile lookup before shortlisting.
Test this Instagram endpoint 1 required Β· 0 optional
| Parameter | In | Value |
|---|---|---|
| query |
Posts & Reels
/api/project/instagram/user-posts Get Instagram User Posts by Username or ID
Full docs βDetails
Fetch the recent post feed of a public Instagram account. Pass username_or_id; leave pagination_token empty on the first request and pass the returned top-level pagination_token to continue. The live-verified response contains data.count, data.items[] and a data.user summary of the author (id, username, full_name, is_verified, is_private, profile_pic_url). Each item exposes id, code (the shortcode), taken_at (Unix seconds), caption.text with extracted hashtags and mentions, media_type (1=photo, 2=video, 8=carousel), like_count, comment_count, play_count on videos, plus image_versions2 / video_versions media URLs and carousel_media for albums. A call for instagram returned 12 recent posts, all owned by the account, with current timestamps. Treat page size as observed behavior rather than a contract, and deduplicate by media id when merging pages.
Test this Instagram endpoint 1 required Β· 2 optional
| Parameter | In | Value |
|---|---|---|
| query |
Optional inputs and continuation controls (2)
| Parameter | In | Value |
|---|---|---|
| query | Optional continuation token: leave empty on the first request, then pass the top-level pagination_token from the previous response to fetch the next page. Tokens are opaque, short-lived and endpoint-specific; discard one that comes back unchanged. | |
| query |
/api/project/instagram/post-detail Get Instagram Post or Reel Details
Full docs βDetails
Resolve a single post, Reel or IGTV item by shortcode or URL. Pass code_or_url β the segment after /p/, /reel/ or /tv/ (e.g. DeM-xDCA2W5) or a full instagram.com URL. The live-verified response returns data with id, code, taken_at, caption (text plus extracted hashtags and mentions), user (owner id, username and verification), media_type, like_count, comment_count, image_versions2 / video_versions media URLs, carousel_media for albums, location when tagged, and clips_metadata (audio_canonical_id, audio_type, reuse flags) for Reels. A lookup of shortcode DeM-xDCA2W5 returned media id 4002850218218579385 owned by instagram with matching caption and timestamp. Keep the returned numeric media id as your join key across endpoints.
Test this Instagram endpoint 1 required Β· 1 optional
| Parameter | In | Value |
|---|---|---|
| query |
Optional inputs and continuation controls (1)
| Parameter | In | Value |
|---|---|---|
| query |
/api/project/instagram/user-reels Get Instagram Reels by Username or ID
Full docs βDetails
Fetch only the Reels (short-form videos) published by a public account. Pass username_or_id; continue with the pagination_token from the previous response. Items follow the post shape β id, code, taken_at, caption, media_type=2 with video_versions and clips_metadata, like_count, comment_count and play_count β but are restricted to the account's Reels tab, so you do not need to filter mixed feed items yourself.
Test this Instagram endpoint 1 required Β· 2 optional
| Parameter | In | Value |
|---|---|---|
| query |
Optional inputs and continuation controls (2)
| Parameter | In | Value |
|---|---|---|
| query | Optional continuation token: leave empty on the first request, then pass the top-level pagination_token from the previous response to fetch the next page. Tokens are opaque, short-lived and endpoint-specific; discard one that comes back unchanged. | |
| query |
/api/project/instagram/user-tagged-posts Get Posts Tagging an Instagram User
Full docs βDetails
List public posts that tag a given Instagram account. Pass username_or_id; continue with the pagination_token from the previous response. Items follow the standard post shape β id, code, taken_at, caption, author user object, media_type and engagement counts β but the authors are other accounts that tagged the subject, which is a different signal from caption mentions or hashtags. Use it to review user-generated content involving a brand or creator.
Test this Instagram endpoint 1 required Β· 2 optional
| Parameter | In | Value |
|---|---|---|
| query |
Optional inputs and continuation controls (2)
| Parameter | In | Value |
|---|---|---|
| query | Optional continuation token: leave empty on the first request, then pass the top-level pagination_token from the previous response to fetch the next page. Tokens are opaque, short-lived and endpoint-specific; discard one that comes back unchanged. | |
| query |
Hashtags & Topics
/api/project/instagram/hashtag-posts Get Instagram Hashtag Posts
Full docs βDetails
Collect public posts tagged with a hashtag. Pass keyword without the leading '#', e.g. travel. feed_type selects top (the default), recent or reels; paginate the recent and reels feeds with pagination_token, and the top feed with the next_page value from the previous response. The live-verified response returns data.count and data.items[] in the standard post shape β id, code, taken_at, caption with hashtags, author user object, media_type, like_count and comment_count β plus a top-level continuation token. A call for travel with feed_type=recent returned 24 current posts whose captions all contained #travel. Deduplicate by media id, because successive collection windows overlap.
Test this Instagram endpoint 1 required Β· 4 optional
| Parameter | In | Value |
|---|---|---|
| query | ||
| query |
Optional inputs and continuation controls (3)
| Parameter | In | Value |
|---|---|---|
| query | Optional continuation token: leave empty on the first request, then pass the top-level pagination_token from the previous response to fetch the next page. Tokens are opaque, short-lived and endpoint-specific; discard one that comes back unchanged. | |
| query | ||
| query |
/api/project/instagram/search-hashtag Search Instagram Hashtags by Keyword
Full docs βDetails
Discover hashtag names matching a keyword. Pass keyword, e.g. travel. The documented response returns candidate tags with their names and media-use metadata where available, so you can expand a seed topic into a reviewed tag vocabulary before collecting posts. Hashtag discovery is a naming step β pair each chosen tag with the hashtag posts endpoint for content.
Test this Instagram endpoint 1 required Β· 0 optional
| Parameter | In | Value |
|---|---|---|
| query |
/api/project/instagram/search-reels Search Instagram Reels by Keyword
Full docs βDetails
Search public Reels by keyword. Pass keyword, e.g. travel; continue with the pagination_token from the previous response. Items follow the Reel post shape: id, code, taken_at, caption, author user object, video renditions, clips_metadata audio fields and engagement counts. Keyword matching only finds candidates β verify a Reel's author and fit with a profile lookup instead of assuming relevance from the match alone.
Test this Instagram endpoint 1 required Β· 2 optional
| Parameter | In | Value |
|---|---|---|
| query |
Optional inputs and continuation controls (2)
| Parameter | In | Value |
|---|---|---|
| query | Optional continuation token: leave empty on the first request, then pass the top-level pagination_token from the previous response to fetch the next page. Tokens are opaque, short-lived and endpoint-specific; discard one that comes back unchanged. | |
| query |
Engagement
/api/project/instagram/post-comments Get Instagram Post Comments
Full docs βDetails
Read comments on a public post, Reel or IGTV item. Pass code_or_url (shortcode or URL); optionally sort_by recent (default) or popular; continue with the pagination_token from the previous response. The documented response returns the post's caption record, comment_count and comments[], where each comment carries pk (the comment id), text, created_at, comment_like_count, child_comment_count and a user object with id, username, verification and privacy flags, and profile picture. Keep each comment's pk β it is the comment_id input for the comment replies endpoint.
Test this Instagram endpoint 1 required Β· 3 optional
| Parameter | In | Value |
|---|---|---|
| query |
Optional inputs and continuation controls (3)
| Parameter | In | Value |
|---|---|---|
| query | ||
| query | Optional continuation token: leave empty on the first request, then pass the top-level pagination_token from the previous response to fetch the next page. Tokens are opaque, short-lived and endpoint-specific; discard one that comes back unchanged. | |
| query |
/api/project/instagram/post-comment-replies Get Replies to an Instagram Comment
Full docs βDetails
Expand the reply thread under one comment. Pass code_or_url for the post plus comment_id β the pk of a comment returned by the post comments endpoint; continue with the pagination_token from the previous response. The documented response returns child_comment_count and child_comments[], where each reply carries pk, text, created_at, comment_like_count and an author user object. This is retrieval for analysis, not automated replying.
Test this Instagram endpoint 2 required Β· 1 optional
| Parameter | In | Value |
|---|---|---|
| query | ||
| query |
Optional inputs and continuation controls (1)
| Parameter | In | Value |
|---|---|---|
| query | Optional continuation token: leave empty on the first request, then pass the top-level pagination_token from the previous response to fetch the next page. Tokens are opaque, short-lived and endpoint-specific; discard one that comes back unchanged. |
/api/project/instagram/post-likes Get Instagram Post Liker List
Full docs βDetails
Sample the visible likers of a public post or Reel. Pass code_or_url; count selects up to 50 records per page (default 50); continue with the end_cursor value from the previous response. The documented response returns data.count (the post's total like count), an end_cursor and likes[], where each record carries id, username, full_name, is_private, is_verified and profile_pic_url. The accessible sample is not the complete liker list β compare samples by account id and avoid completeness claims.
Test this Instagram endpoint 1 required Β· 2 optional
| Parameter | In | Value |
|---|---|---|
| query |
Optional inputs and continuation controls (2)
| Parameter | In | Value |
|---|---|---|
| query | ||
| query |
Locations
/api/project/instagram/search-location Search Instagram Locations by Name
Full docs βDetails
Resolve a place name to candidate Instagram location records. Pass keyword, e.g. paris. The live-verified response returns data.count and data.items[] with id, name, short_name, address, city, latitude, longitude and facebook_places_id where available. A search for paris returned 30 locations including the Louvre Museum, the Eiffel Tower and Notre-Dame with plausible coordinates. Disambiguate same-name venues with the returned city, address and coordinates instead of picking the first result blindly.
Test this Instagram endpoint 1 required Β· 0 optional
| Parameter | In | Value |
|---|---|---|
| query |
/api/project/instagram/search-coordinates Find Instagram Places Near Coordinates
Full docs βDetails
Discover Instagram place records near a geographic point. Pass latitude (positive = north) and longitude (positive = east) as decimal strings, e.g. 40.7 and -74. The documented response returns nearby place candidates with the usual location fields, ready to resolve through the location info and location posts endpoints. Use it to find the place record for a venue whose coordinates you already know; the endpoint locates places, not people.
Test this Instagram endpoint 2 required Β· 0 optional
| Parameter | In | Value |
|---|---|---|
| query | ||
| query |
/api/project/instagram/location-info Get Instagram Location Details by ID
Full docs βDetails
Resolve an Instagram location ID to its place record. Pass location_id β found in search results or in a post's location data. The documented response returns data with id, name, slug, category, media_count and location_data (address_street, city_name, latitude, longitude, facebook_places_id); some venues also return hours, phone, price_range and website. Address or coordinate fields can be empty, so tolerate missing values when labeling a dataset.
Test this Instagram endpoint 1 required Β· 1 optional
| Parameter | In | Value |
|---|---|---|
| query |
Optional inputs and continuation controls (1)
| Parameter | In | Value |
|---|---|---|
| query |
/api/project/instagram/posts-location Get Instagram Posts at a Location
Full docs βDetails
Collect public posts tagged at an Instagram location. Pass location_id; continue with the pagination_token from the previous response. The documented response returns media items in the standard post shape β id, code, taken_at, caption, author user object, media_type and engagement counts β associated with the place. Geotags are content labels chosen by authors: treat them as claimed context, not proof of physical presence.
Test this Instagram endpoint 1 required Β· 1 optional
| Parameter | In | Value |
|---|---|---|
| query |
Optional inputs and continuation controls (1)
| Parameter | In | Value |
|---|---|---|
| query | Optional continuation token: leave empty on the first request, then pass the top-level pagination_token from the previous response to fetch the next page. Tokens are opaque, short-lived and endpoint-specific; discard one that comes back unchanged. |
Stories & Highlights
/api/project/instagram/user-stories Get Instagram Stories by Username or ID
Full docs βDetails
Fetch the currently available Stories of a public Instagram account. Pass username_or_id. Stories are ephemeral: the response reflects what is visible at collection time, items carry their own media URLs and timestamps, and expired or deleted Stories are not recoverable through this endpoint. Set url_embed_safe=true if returned media URLs must tolerate cross-origin embedding; media links are time-limited either way.
Test this Instagram endpoint 1 required Β· 1 optional
| Parameter | In | Value |
|---|---|---|
| query |
Optional inputs and continuation controls (1)
| Parameter | In | Value |
|---|---|---|
| query |
/api/project/instagram/user-highlights List Instagram Highlights by Username or ID
Full docs βDetails
List the highlight collections pinned on a public Instagram profile. Pass username_or_id. The documented response returns highlight records with id (in highlight:... form), title, cover media and item counts β the inventory step before fetching an individual highlight's contents. Pass a returned id to the highlight detail endpoint to read its media.
Test this Instagram endpoint 1 required Β· 1 optional
| Parameter | In | Value |
|---|---|---|
| query |
Optional inputs and continuation controls (1)
| Parameter | In | Value |
|---|---|---|
| query |
/api/project/instagram/user-highlight-detail Get Instagram Highlight Contents by ID
Full docs βDetails
Read the media inside one highlight collection. Pass highlight_id β an id from the highlights list (the numeric part, e.g. 17951474176899044). The documented response returns the highlight record with its items[]: each item carries media id, shortcode, timestamps and image or video renditions, alongside the collection's cover and title metadata. Item media URLs are time-limited; re-fetch when links expire.
Test this Instagram endpoint 1 required Β· 1 optional
| Parameter | In | Value |
|---|---|---|
| query |
Optional inputs and continuation controls (1)
| Parameter | In | Value |
|---|---|---|
| query |
Music & Audio
/api/project/instagram/search-music-audio Search Instagram Audio by Keyword
Full docs βDetails
Find audio records β licensed songs and original sounds β by keyword. Pass keyword, e.g. a song title or artist name. The documented response returns candidate audio records with title, artist and identifier fields. Confirm the intended record through the audio info endpoint, then list Reels using it via the audio posts endpoint. Discovery does not grant reuse rights for the underlying music.
Test this Instagram endpoint 1 required Β· 0 optional
| Parameter | In | Value |
|---|---|---|
| query |
/api/project/instagram/music-audio-info Get Instagram Audio Details by ID
Full docs βDetails
Resolve an audio canonical ID to its metadata record. Pass audio_canonical_id β found in a Reel's clips_metadata or through audio search. The documented response returns data with title, artist (id, username, verification, profile picture), duration_in_ms, audio_id, time_created, is_original_audio, is_reuse_disabled, total_reels and a download_url where exposed. Use the canonical ID, not the track title, as the dataset key β titles are ambiguous.
Test this Instagram endpoint 1 required Β· 0 optional
| Parameter | In | Value |
|---|---|---|
| query |
/api/project/instagram/posts-music Get Instagram Reels Using an Audio
Full docs βDetails
List public Reels that use a given audio record. Pass audio_canonical_id; continue with the pagination_token from the previous response. The documented response returns the audio page context (formatted_media_count and available tabs) plus items[] of Reels in the standard post shape: id, code, taken_at, caption, author user object, video renditions and engagement counts. Repeat collection for selected audio IDs to study creator participation over time β a page is a sample, not every use of the sound.
Test this Instagram endpoint 1 required Β· 2 optional
| Parameter | In | Value |
|---|---|---|
| query |
Optional inputs and continuation controls (2)
| Parameter | In | Value |
|---|---|---|
| query | Optional continuation token: leave empty on the first request, then pass the top-level pagination_token from the previous response to fetch the next page. Tokens are opaque, short-lived and endpoint-specific; discard one that comes back unchanged. | |
| query |
Coverage and public-content boundaries
Read public Instagram account and content data over simple GET requests: profiles, posts, Reels, Stories, highlights, comments, likes, hashtags, locations and audio.
- Profiles: resolve a username or numeric user ID to biography, follower/following/media counts, verification and privacy flags, and profile picture URLs
- Content feeds: pull a user's posts, Reels, tagged posts, Stories and highlight collections with opaque-token pagination
- Engagement: read post comments, comment reply threads and visible liker lists with cursors
- Discovery: search accounts, hashtags, Reels, locations and audio by keyword; look up similar accounts
- Places & sounds: resolve location IDs and audio canonical IDs, then fetch their details and associated posts
Built for creator discovery, competitor research, social listening and location-based content tools. JSON responses mirror the fields each public surface exposes; private-account content, complete follower exports, historical analytics and official account Insights are out of scope.