Support needed? Reach out! 📧

How to Scrape Instagram Post Details And Engagement

This tutorial shows how to use Instagram Post Details And Engagement API to scrape and crawl structured Instagram data in real-time.
Fetch detailed metadata for individual Instagram posts including like counts, comment totals, hashtags, and timestamps through our API for performance benchmarking.

Access Instagram Data in 3 Steps

Start crawling Instagram post details data. Follow these steps to extract social media data in minutes.

1

Create Your Account

Go to our registration page and make an account. It's free, no credit card, and you get credits right away to play around with.

2

Verify Your Email Address

You'll get a verification email, click the link in it. Once that's done, you can grab your API token from the dashboard.

3

Make Your First API Call

Copy the code snippet below, swap in your API key, and run it. You'll get Instagram data back as JSON within a few seconds.

Code Sample

Here's a JavaScript example to get you going. Swap out the token and you're good, works the same way in any language that can make HTTP requests. Start collecting post details data via our REST API!

javascript-logo JavaScript
Instagram Post Info & Comments
1 const root = 'https://ensembledata.com/apis'
2 const endpoint = '/instagram/post/details'
3 const params = {
4   "code""CjDN1tzMIjR",
5   "n_comments_to_fetch"0,
6   "token""YOUR-TOKEN-HERE"
7 }
8  
9 const queryString = new URLSearchParams(params).toString();
10 const url = `${root}${endpoint}?${queryString}`;
11  
12 await fetch(url)
13   .then(response => response.json())
14   .then(data => console.log(data))
15   .catch(error => console.error(error));
16  

Parameters

code (string) Shortcode of the post. REQUIRED
n_comments_to_fetch (integer) How many comments to fetch per post (max allowed is 50).
token (string) Private token assigned to each client to access the APIs. REQUIRED

Example Response

Explore the fields returned by this endpoint. Click a row to expand nested objects and arrays, hover a value to copy it, or use "Expand all" to see everything at once.

JSON
Instagram Post Info & Comments
dataobject36 fields
__typenamestring"GraphImage"
idstring"2937252247889807569"
shortcodestring"CjDN1tzMIjR"
dimensionsobject2 fields
heightnumber660
widthnumber640
gating_infonullnull
fact_check_overall_ratingnullnull
fact_check_informationnullnull
sensitivity_friction_infonullnull
sharing_friction_infoobject2 fields
should_have_sharing_frictionbooleanfalse
bloks_app_urlnullnull
media_overlay_infonullnull
media_previewstring"ACkq54DNWYovmAPemIhODg1eQY25HRv50ANuIAi7qzyc1tTNtePjdyRj3IrLul2SN0AJyM…"
display_urlstring"https://instagram.fadb1-1.fna.fbcdn.net/v/t51.2885-15/309432321_323089…"
display_resourcesarray3 items · schema from #0 3 items
srcstring"https://instagram.fadb1-1.fna.fbcdn.net/v/t51.2885-15/309432321_323089…"
config_widthnumber640
config_heightnumber660
accessibility_captionnullnull
is_videobooleanfalse
tracking_tokenstring"eyJ2ZXJzaW9uIjo1LCJwYXlsb2FkIjp7ImlzX2FuYWx5dGljc190cmFja2VkIjp0cnVlLC…"
edge_media_to_tagged_userobject1 field
edgesarray0 items
empty
edge_media_to_captionobject1 field
edgesarray1 item · schema from #0 1 item
nodeobject1 field
textstring"Hope this helps 💓 #spiritualjourney #positivequotes #loveyou #beyou …"
caption_is_editedbooleanfalse
has_ranked_commentsbooleanfalse
edge_media_to_commentobject3 fields
countnumber10
page_infoobject2 fields
has_next_pagebooleantrue
end_cursorstring""
edgesarray0 items
empty
comments_disabledbooleanfalse
commenting_disabled_for_viewerbooleanfalse
taken_at_timestampnumber1664367775
edge_media_preview_likeobject2 fields
countnumber57
edgesarray0 items
empty
edge_media_to_sponsor_userobject1 field
edgesarray0 items
empty
locationnullnull
viewer_has_likedbooleanfalse
viewer_has_savedbooleanfalse
viewer_has_saved_to_collectionbooleanfalse
viewer_in_photo_of_youbooleanfalse
viewer_can_resharebooleantrue
ownerobject15 fields
idstring"50939271479"
is_verifiedbooleanfalse
profile_pic_urlstring"https://instagram.fadb1-2.fna.fbcdn.net/v/t51.2885-19/268027453_262278…"
usernamestring"purple_unicorn_official"
blocked_by_viewerbooleanfalse
restricted_by_viewernullnull
followed_by_viewerbooleanfalse
full_namestring"Magical Purple Unicorn"
has_blocked_viewerbooleanfalse
is_privatebooleanfalse
is_unpublishedbooleanfalse
requested_by_viewerbooleanfalse
pass_tiering_recommendationbooleantrue
edge_owner_to_timeline_mediaobject1 field
countnumber1148
edge_followed_byobject1 field
countnumber1611
is_adbooleanfalse
edge_web_media_to_related_mediaobject1 field
edgesarray0 items
empty
edge_related_profilesobject1 field
edgesarray0 items
empty

Response Codes

Status codes this endpoint can return, so you can handle errors before they surprise you in production.

200SuccessSuccessful Response
422Client ErrorValidation Error
491Client ErrorToken not found
492Client ErrorEmail not verified
493Client ErrorSubscription expired
495Client ErrorAll daily units used
500Server ErrorSomething went wrong

API Pricing

2 + ceil(#comments_fetched / 5) units Cost per successful call to this endpoint.

Fetch Instagram Data at Scale

Access detailed post analytics including engagement breakdowns, comment volumes, and hashtag usage to sharpen your Instagram marketing strategy.

deco-icon

Single Post Stats

Get likes, comments, hashtags, and timestamp for one Instagram post.

deco-icon

Comments Included

Retrieve post metadata and comment data in a single API call.

deco-icon

Hashtag Data

See every hashtag used to measure campaign reach per post.