Instagram Post Data API: Read Likes, Comments and Caption by URL
Instagram Post Data API: Read Likes, Comments and Caption by URL
An Instagram post data API lets you pass the URL of a public post and get back its likes, comments count and caption as JSON. With SocialLens (sociallens.dev) it is one request, GET https://api.sociallens.dev/v1/post?platform=instagram&url=<post URL>, and it costs 1 credit per read.
The request
You need an API key (it starts with sk_live_) and the URL of a public Instagram post. Send the key as a Bearer token:
curl "https://api.sociallens.dev/v1/post?platform=instagram&url=https://www.instagram.com/p/Df-NlR0PjmN/" \
-H "Authorization: Bearer sk_live_YOUR_KEY"
The base URL is https://api.sociallens.dev/v1. The request shape is the same on the other eight networks SocialLens reads: you change platform and url, nothing else.
The response
This is a real read of a public NASA photo post, made on November 30, 2026 (the caption is shortened here):
{
"exists": true,
"id": "Df-NlR0PjmN",
"url": "https://www.instagram.com/p/Df-NlR0PjmN/",
"platform": "instagram",
"author": {
"username": "nasa",
"name": "NASA",
"verified": true
},
"caption": "No such thing as \"too much glitter\" ...",
"published_at": "2026-11-20T18:11:14Z",
"likes": 778000,
"views": null,
"comments": 2499,
"shares": null,
"is_exact": true,
"likes_hidden": false,
"fetched_at": "2026-11-30T14:37:23Z"
}
What each field means
exists:truewhen the post was found. If the post is gone or not public, you still get an HTTP 200, with"exists": false. Check this field before reading the rest.caption: the full text the author wrote under the post. Store it as a plain string and expect line breaks, emoji and hashtags inside it.likes: the like count of the post, 778,000 in the example above. When the author hides likes,likes_hiddenistrueand you should not treat the count as a real zero.views: a number on video posts andnullon Instagram photos. The NASA photo above hasviews: null, while another NASA video post returnedviews: 4612036. Handlenullexplicitly in your code.comments: the number of comments on the post (2,499 in the example). This is a count, not the comment text.published_atandfetched_at: when the post went live, and when SocialLens read it. Both are UTC timestamps.author: username, display name and theverifiedflag of the account that posted.shares:nullin this read. Do not build logic that depends on it for Instagram.is_exact:truehere, meaning the numbers are exact and not rounded.
/post reads one post, /profile-posts lists many
Two routes cover most post work. /post reads one post, identified by its URL, which is what this guide shows. /profile-posts lists many posts from a profile, which is the route to use when you do not yet know which posts you want. A common pattern is to list with /profile-posts and then re-read specific posts with /post when you need a fresh number for one of them.
What it does not do
- It does not search by keyword or hashtag. You must already have the post URL (or list posts from a known profile).
- It does not give audience demographics (age, country, gender of followers or likers).
- It does not detect fake followers or fake engagement.
- It does not do identity checks (KYC).
- It does not backfill history. You get the post as it is at the moment of the read, so if you want a time series, call
/poston a schedule and store the results yourself. - It reads public posts only. Private accounts are out of scope.
- On Instagram,
viewscan benull(photos), and therepliesfield on comments isnull.
When another route is the better fit
If you need one profile's recent posts instead of a single post, use /profile-posts. If you only need an account's follower count, see the Instagram follower count API guide. For a wider comparison of Instagram data options, read best Instagram data API. If you want the same metrics across several networks in one shape, the unified social media data API guide explains how.
On scope: SocialLens is built for small and self-serve use, such as a developer, a small agency or a founder who wants a few thousand reads without a sales call. If you need audience demographics, fraud scoring, creator-discovery databases or a contracted enterprise SLA, a platform like Modash (influencer analytics) or a managed data provider such as Data365 or EnsembleData may fit better, and you should check their current terms.
Cost
Each read costs 1 credit. You get 250 free reads with no card, credits never expire, and paid packs start from about US$19. See pricing for the current packs. Reads that return "exists": false still count as a read, so validate URLs before you send them in bulk.
FAQ
Can I get the text of the comments?
/post returns the comment count (comments), not the comment text. This guide covers the count only.
Why is views null on some posts?
Instagram photos have no view count, so views is null. Video posts return a number.
What happens if the post was deleted or is private?
You get HTTP 200 with "exists": false. Branch on that field instead of relying on error codes.
Can I find posts by hashtag?
No. SocialLens has no keyword or hashtag search. You supply the URL, or list posts from a profile with /profile-posts.
Is there a free way to test it? Yes, 250 free reads with no card, enough to test several dozen URLs across your own use case.
Related guides
- Best Instagram data API
- Instagram follower count API
- Social media post metrics API
- Unified social media data API
Last updated and data verified on November 30, 2026.