How to Get Likes, Views and Comments for Any Post by URL

Published , updated · 10 min read

To get the likes, views and comments of a social media post through an API, send its URL to GET /v1/post?platform=...&url=... on SocialLens. It works for posts on TikTok, Instagram, YouTube, Facebook, X, Reddit, Threads and Pinterest and returns the same fields for all eight: likes, views, comments, shares, the author, the caption and the publication date. For a profile's recent posts, /v1/profile-posts returns a list with the same counters. This guide shows real responses, what each counter means on each network, how to compute engagement rate, and how to read comments.

One post by URL

curl -G "https://api.sociallens.dev/v1/post" \
  --data-urlencode "platform=tiktok" \
  --data-urlencode "url=https://www.tiktok.com/@tiktok/video/7710348513128828191" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"

Response read on November 22, 2026, complete:

{
  "exists": true,
  "id": "7710348513128828191",
  "url": "https://www.tiktok.com/@tiktok/video/7710348513128828191",
  "platform": "tiktok",
  "author": {
    "username": "tiktok",
    "name": "TikTok",
    "verified": true
  },
  "caption": "one TikTok DM sent @Chef Moe to the grocery store with $5 and gave his cooking a whole new purpose. 🍽️❤️",
  "published_at": "2026-11-20T20:10:17Z",
  "likes": 4422,
  "views": 292555,
  "comments": 2343,
  "shares": 430,
  "is_exact": true,
  "likes_hidden": false,
  "fetched_at": "2026-11-22T23:54:08Z",
  "cached": false,
  "source_cached": false,
  "credits": {
    "source": "free",
    "charged": 1,
    "balance": 0,
    "free_reads_total": 250,
    "free_reads_left": 235
  }
}

Every counter is an integer. fetched_at is the moment of the read in UTC, and each request reads the post at that moment, so two calls an hour apart give you two points of the post's curve.

Which URLs are accepted

platform has to match the domain of the URL. The accepted forms:

Network platform URL forms
TikTok tiktok Video and photo post URLs. Short links from vt.tiktok.com and vm.tiktok.com are resolved.
Instagram instagram /p/ and /reel/ URLs.
YouTube youtube watch?v=, youtu.be and Shorts URLs.
Facebook facebook Post, video and reel URLs.
X x Post URLs on x.com or twitter.com. platform=twitter works as an alias.
Reddit reddit Post permalinks, on www.reddit.com or old.reddit.com.
Threads threads Post URLs on threads.net or threads.com.
Pinterest pinterest Pin URLs in the form pinterest.com/pin/ID/.

Send the URL URL encoded, as curl --data-urlencode does above, so a query string inside it does not get mixed with the API's own parameters. If the URL does not belong to the platform you named, the answer is a 400 that costs nothing:

{
  "error": "bad_request",
  "message": "Parameter \"url\" does not look like a tiktok post URL."
}

What each counter means on each network

The keys are the same. What sits behind them is each network's own definition.

Network likes views comments shares
TikTok Exact Exact Exact Exact
Instagram Exact, unless hidden by the owner Reels and videos; null for photos Exact null
YouTube Exact Exact Rounded by YouTube null
Facebook Sum of all reactions Videos and reels Exact Exact
X Exact Exact Replies Reposts
Reddit Upvote score null Exact null
Threads Exact null Replies Reposts
Pinterest Total reactions null null Shares

Real reads of one post on each network, taken within the same hour:

Post likes views comments shares
TikTok video by @tiktok 4,422 292,555 2,343 430
Instagram post by @instagram 648,453 null 3,544 null
YouTube video by MrBeast 1,378,373 96,726,790 70,000 null
Facebook video by Microsoft 17,636 476,756 12,602 534
X post by @NASA 16,575 1,220,846 239 2,838
Reddit post in r/technology 3,872 null 529 null
Threads post by @zuck 58,699 null 369 531
Pinterest pin by Nike 54 null null 1

Some details that matter when you put these in one table:

The same call on X, Reddit, Threads and Pinterest

Nothing changes in the request for the other four networks. Only platform and the URL do. These are real responses, with the credits block left out.

An X post. platform=twitter is accepted as an alias of x, and URLs on twitter.com work the same as x.com.

curl -G "https://api.sociallens.dev/v1/post" \
  --data-urlencode "platform=x" \
  --data-urlencode "url=https://x.com/NASA/status/2123435938848067841" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"
{
  "exists": true,
  "id": "2123435938848067841",
  "url": "https://x.com/NASA/status/2123435938848067841",
  "platform": "x",
  "author": { "username": "NASA", "name": "NASA", "verified": true },
  "caption": "These baby stars are going straight to the top of the charts 🌟\n\nA new album from @ChandraXray collects snapshots of baby stars across the galaxy and beyond and transforms that data into sound.\n\nPress play: https://t.co/CY9PIlVZOq https://t.co/8LAIQWJfai",
  "published_at": "2026-11-19T15:19:14Z",
  "likes": 16575,
  "views": 1220846,
  "comments": 239,
  "shares": 2838,
  "is_exact": true,
  "likes_hidden": false,
  "fetched_at": "2026-11-23T00:32:18Z",
  "cached": false,
  "source_cached": false
}

A Reddit post, by its permalink. The author's username is replaced with a placeholder in this sample.

curl -G "https://api.sociallens.dev/v1/post" \
  --data-urlencode "platform=reddit" \
  --data-urlencode "url=https://www.reddit.com/r/technology/comments/1y2qawx/silicon_valley_is_suffering_from_model_collapse/" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"
{
  "exists": true,
  "id": "1y2qawx",
  "url": "https://www.reddit.com/r/technology/comments/1y2qawx/silicon_valley_is_suffering_from_model_collapse/",
  "platform": "reddit",
  "author": { "username": "example_user", "name": null, "verified": null },
  "caption": "Silicon Valley Is Suffering From Model Collapse",
  "published_at": "2026-11-22T14:15:02Z",
  "likes": 3872,
  "views": null,
  "comments": 529,
  "shares": null,
  "is_exact": true,
  "likes_hidden": false,
  "fetched_at": "2026-11-23T00:32:22Z",
  "cached": false,
  "source_cached": false
}

A Threads post. URLs on threads.net and threads.com are both accepted.

curl -G "https://api.sociallens.dev/v1/post" \
  --data-urlencode "platform=threads" \
  --data-urlencode "url=https://www.threads.net/@zuck/post/DgA_nk4kiBd" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"
{
  "exists": true,
  "id": "DgA_nk4kiBd",
  "url": "https://www.threads.net/@zuck/post/DgA_nk4kiBd",
  "platform": "threads",
  "author": { "username": "zuck", "name": "Mark Zuckerberg", "verified": true },
  "caption": "Top things I did today:\n1. Fixed roof\n2. Installed drywall\n3. Jet skied with a dog\n4. Pet Arugula",
  "published_at": "2026-11-21T19:35:13Z",
  "likes": 58699,
  "views": null,
  "comments": 369,
  "shares": 531,
  "is_exact": true,
  "likes_hidden": false,
  "fetched_at": "2026-11-23T00:32:29Z",
  "cached": false,
  "source_cached": false
}

A Pinterest pin. Send the pin URL in the form pinterest.com/pin/ID/. The response returns the canonical URL of the pin.

curl -G "https://api.sociallens.dev/v1/post" \
  --data-urlencode "platform=pinterest" \
  --data-urlencode "url=https://www.pinterest.com/pin/516084438594638728/" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"
{
  "exists": true,
  "id": "516084438594638728",
  "url": "https://www.pinterest.com/pin/yeat-x-solo-fleece--516084438594638728/",
  "platform": "pinterest",
  "author": { "username": "nike", "name": "Nike", "verified": null },
  "caption": "Yeat x Solo Fleece",
  "published_at": "2026-07-30T16:24:00Z",
  "likes": 54,
  "views": null,
  "comments": null,
  "shares": 1,
  "is_exact": true,
  "likes_hidden": false,
  "saves": 191,
  "fetched_at": "2026-11-23T00:51:58Z",
  "cached": false,
  "source_cached": false
}

Four networks, one parser. The only thing your code has to know is which counters each network publishes, which is what the tables above describe.

Hidden, missing and zero are three different things

A counter can be absent for two reasons, and neither of them is zero.

The network does not publish it. Instagram does not show shares. YouTube does not show shares. The field is null.

The owner hid it. Instagram lets account owners hide like counts. In that case likes is null and likes_hidden is true. Without that flag you could not tell a hidden counter from a missing one.

Zero is a real value. A post with likes: 0 and likes_hidden: false has no likes.

In code, this means you never write post["likes"] or 0 before deciding what the null means. Leave posts with unknown likes out of an average instead of counting them as zero, or the average is wrong.

A post that was deleted or is not public answers with HTTP 200 and {"exists": false, ...}. That answer is not charged: credits.charged comes back as 0. The same applies to an age restricted post and to an invalid post link. A not found answer can be temporary, so it does not prove the post was deleted: retry later if you expect it to exist. Reddit is different: the source answers a missing Reddit post as a normal read and bills it, so it comes back with exists: true, the caption Page not found and no author, and it is charged. The rule in one line: we charge when the source bills us for the read, and when the source does not bill (a post 404), we do not charge.

The recent posts of a profile, on nine networks

/v1/profile-posts takes a profile and returns its recent posts, each with the same counters. This endpoint covers all nine networks.

curl "https://api.sociallens.dev/v1/profile-posts?platform=threads&username=zuck&limit=2" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"
{
  "exists": true,
  "username": "zuck",
  "platform": "threads",
  "private": null,
  "count": 2,
  "has_more": false,
  "next_cursor": null,
  "is_exact": true,
  "posts": [
    {
      "id": "DgA_nk4kiBd",
      "url": "https://www.threads.net/@zuck/post/DgA_nk4kiBd",
      "caption": "Top things I did today:\n1. Fixed roof\n2. Installed drywall\n3. Jet skied with a dog\n4. Pet Arugula",
      "published_at": "2026-11-21T19:35:13Z",
      "likes": 58655,
      "views": null,
      "comments": 368,
      "shares": 530,
      "likes_hidden": false
    },
    {
      "id": "DfihFPxkaZ1",
      "url": "https://www.threads.net/@zuck/post/DfihFPxkaZ1",
      "caption": "Pavlova with Muse helping on our quest to go beyond beginner baking recipes!",
      "published_at": "2026-11-09T23:31:10Z",
      "likes": 1556,
      "views": null,
      "comments": 303,
      "shares": 52,
      "likes_hidden": false
    }
  ],
  "fetched_at": "2026-11-22T23:54:41Z"
}

One call is one page from the network, roughly 10 to 30 posts depending on the network, and costs one credit no matter how many posts are in it. limit (1 to 50) trims the page you receive. When the response includes a next_cursor, pass it back as cursor to get the next page.

How the list fills the counters on the five newest networks:

Network username to send likes views comments shares
X Handle Exact Exact Replies Reposts
Threads Handle Exact null Replies Reposts
Reddit Subreddit name Upvote score null Exact null
Pinterest Full URL of a board Reactions null null Saves
LinkedIn Company slug null null null null

Each post in the list has a url you can send to /v1/post later to read that post again, on every network, Pinterest included. One Pinterest detail: in the pins list shares carries the repin count of each pin, while a single pin read returns its share count in shares. Both endpoints return the pin's total saves in the separate saves field. LinkedIn returns the text, date and link of company posts with no counters, because LinkedIn does not expose post engagement publicly, and it has no single post read.

Single post or the list: which one to call

Use /v1/post when you already have the URL and care about that one post: a sponsored video you are reporting on, a competitor's launch post, a link a user pasted into your product. You get the author and, on YouTube, the description, which the list does not include.

Use /v1/profile-posts when the question is about the account: how its recent content performs, what its typical numbers are, whether it posted this week. One call returns a whole page of posts for one credit, so it is also the economical way to get counters for many posts of the same profile.

Computing engagement rate

Engagement rate has two common definitions, and the API gives you the inputs for both.

By followers: interactions divided by the follower count of the account. It answers "how much of the audience reacts". The follower count comes from /v1/profile.

By views: interactions divided by the views of the post. It answers "how much of the people who saw it reacted". It only exists where the network publishes views.

Using the real posts from the table above, by views:

And by followers for the Instagram post, with 685,313,695 followers: (648,453 + 3,544) / 685,313,695 = 0.095%.

This script computes both for the recent posts of any profile. It is complete and was run as shown.

import os
import time

import requests

BASE = "https://api.sociallens.dev/v1"
KEY = os.environ["SOCIALLENS_KEY"]


def get(path, **params):
    for _ in range(3):
        r = requests.get(f"{BASE}/{path}", params=params,
                         headers={"Authorization": f"Bearer {KEY}"}, timeout=60)
        if r.status_code in (409, 429, 503):
            time.sleep(int(r.headers.get("Retry-After", 5)))
            continue
        break
    r.raise_for_status()
    return r.json()


def engagement(platform, username, limit=12):
    profile = get("profile", platform=platform, username=username)
    page = get("profile-posts", platform=platform, username=username, limit=limit)
    followers = profile["followers"]

    by_followers, by_views = [], []
    for post in page["posts"]:
        if post["likes"] is None:  # hidden or not published: leave it out, do not count it as 0
            continue
        interactions = post["likes"] + (post["comments"] or 0) + (post["shares"] or 0)
        by_followers.append(100 * interactions / followers)
        if post["views"]:
            by_views.append(100 * interactions / post["views"])

    def mean(values):
        return round(sum(values) / len(values), 3) if values else None

    return {
        "platform": platform,
        "username": profile["username"],
        "followers": followers,
        "posts_used": len(by_followers),
        "engagement_by_followers_pct": mean(by_followers),
        "engagement_by_views_pct": mean(by_views),
    }


for platform, username in [("instagram", "instagram"), ("tiktok", "tiktok")]:
    print(engagement(platform, username))

Output:

{'platform': 'instagram', 'username': 'instagram', 'followers': 685313695, 'posts_used': 12, 'engagement_by_followers_pct': 0.076, 'engagement_by_views_pct': 0.636}
{'platform': 'tiktok', 'username': 'tiktok', 'followers': 97059250, 'posts_used': 10, 'engagement_by_followers_pct': 0.043, 'engagement_by_views_pct': 8.105}

Two calls per profile, so two credits. A few notes on using the result:

For a creator level rate, with the median over the last posts and the cost of vetting creators at volume, see Engagement Rate API for Indie Influencer Apps.

Comments of a post

/v1/post-comments returns the public comments of a post. It works for TikTok, Instagram, YouTube, Facebook and Reddit, with the same URL forms as /v1/post.

curl -G "https://api.sociallens.dev/v1/post-comments" \
  --data-urlencode "platform=youtube" \
  --data-urlencode "url=https://www.youtube.com/watch?v=q6fgVVmdpgY" \
  --data-urlencode "limit=1" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"
{
  "exists": true,
  "url": "https://www.youtube.com/watch?v=q6fgVVmdpgY",
  "platform": "youtube",
  "count": 1,
  "total": null,
  "has_more": true,
  "next_cursor": null,
  "comments": [
    {
      "id": "UgyaYyiLbOaT96FULFR4AaABAg",
      "text": "what should i recreate next?",
      "author": { "username": "MrBeast", "name": null, "verified": true },
      "likes": 29000,
      "replies": 966,
      "published_at": "2026-11-14T23:55:09Z"
    }
  ],
  "fetched_at": "2026-11-22T23:55:10Z"
}

Each comment has its text, author, like count, reply count and date. total is the post's total number of comments when the network sends it, which TikTok does, and null otherwise. limit goes from 1 to 100 and trims the page. One call is one page of comments and one credit. Comment likes on YouTube are rounded by YouTube (29,000 for "29K"), on Facebook they are the sum of reactions on the comment, and on Reddit they are the upvote score of the comment.

Typical uses are sentiment analysis on a campaign post, finding the questions people ask under a product video, and checking whether the comments under a creator's posts look like a real audience.

Tracking a post over time

Networks show the current counters of a post and no history. To see how a post performed hour by hour, read it on a schedule and store id, the four counters and fetched_at.

A reasonable schedule for a campaign post is every hour during the first two days and once a day after that, which is about 53 reads for the first week. Because every read is live and timestamped, the series is a true curve of the post, and the first hours are usually where the difference between an average post and a strong one shows up. Error responses are not charged, so a retry after a 503 does not cost extra.

The same two timestamped reads, one before and one after, are how an SMM panel verifies an order for likes or views. The workflow is in Social Media Followers Count API for SMM Panels.

Frequently asked questions

Which networks support reading a single post by URL?

TikTok, Instagram, YouTube, Facebook, X, Reddit, Threads and Pinterest, through /v1/post. LinkedIn is the exception: it has no single post read, and its company posts come without counters.

Can I get the view count of an Instagram photo?

No. Instagram publishes views for reels and videos only, so views is null for photos.

What happens when likes are hidden?

likes comes as null and likes_hidden is true. The API does not replace a hidden counter with zero or with an estimate.

Are the numbers exact?

Likes, views and shares are exact integers where the network publishes them. The one rounded figure is YouTube's comment count, which YouTube itself rounds.

How many posts does /v1/profile-posts return?

One page from the network per call, roughly 10 to 30 posts, for one credit. Use limit to trim it and cursor with the returned next_cursor to continue when there is one.

What does it cost to try?

One credit per successful read. A new account includes 250 free reads and no card is required. For the profile side of the same data, see Follower Count API, and for the schema across networks, Unified Social Media Data API.

Run these requests yourself

Every example on this page is a real call to the SocialLens API. A new account starts with 250 free reads, no card needed, and a read that fails is never charged.

Keep reading