Social Media Comments API: Read the Comments on Any Public Post by URL

Published · 5 min read

Social Media Comments API: Read the Comments on Any Public Post by URL

SocialLens (sociallens.dev) has a social media comments API: send GET https://api.sociallens.dev/v1/post-comments with a platform and the post url, and you get the first page of public comments as JSON. It works on 5 networks only (TikTok, Instagram, YouTube, Facebook and Reddit), costs 1 credit per read, and uses the same Bearer-token request shape as the rest of the API.

If you need to read what people are saying under a specific public post, this is the endpoint. It is not a search tool and it does not walk the whole comment tree. This guide shows two real calls, explains every field, and is honest about the one thing that differs between networks: the replies count.

The request

Base URL is https://api.sociallens.dev/v1. Authentication is a Bearer header: Authorization: Bearer sk_live_.... The /post-comments endpoint reads the comments on one post, identified by its URL.

Supported values for platform on this endpoint: tiktok, instagram, youtube, facebook, reddit. The other networks SocialLens covers for profiles and posts are not available on /post-comments, so check the scope before you build on it.

Example 1: YouTube

curl "https://api.sociallens.dev/v1/post-comments?platform=youtube&url=https://www.youtube.com/watch?v=6C-xmYnZ_Rc&limit=2" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"
{
  "exists": true,
  "url": "https://www.youtube.com/watch?v=6C-xmYnZ_Rc",
  "platform": "youtube",
  "count": 2,
  "total": null,
  "has_more": true,
  "next_cursor": null,
  "comments": [
    {
      "id": "UgwW_NdxKqzP_ASFXf94AaABAg",
      "text": "Join my Whatnot stream tomorrow ...",
      "author": {
        "username": "MrBeast",
        "name": null,
        "verified": true
      },
      "likes": 10000,
      "replies": 978,
      "published_at": "2026-11-29T14:37:32Z"
    },
    {
      "id": "UgzeWOx47DRl2SzhJtF4AaABAg",
      "text": "...",
      "author": {
        "username": "fadiaklkl-l5v",
        "name": null,
        "verified": false
      },
      "likes": 11000,
      "replies": 28,
      "published_at": "2026-11-29T14:37:32Z"
    }
  ],
  "fetched_at": "2026-11-30T14:37:32Z"
}

(Comment text is shortened with "..." here for readability. The API returns the full text.)

Example 2: Instagram

curl "https://api.sociallens.dev/v1/post-comments?platform=instagram&url=https://www.instagram.com/p/Df-NlR0PjmN/&limit=2" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"
{
  "exists": true,
  "url": "https://www.instagram.com/p/Df-NlR0PjmN/",
  "platform": "instagram",
  "count": 2,
  "total": null,
  "has_more": false,
  "next_cursor": null,
  "comments": [
    {
      "id": "17908697133416929",
      "text": "Incredible beautiful!",
      "author": {
        "username": "myfriendwantstoknow2",
        "name": null,
        "verified": false
      },
      "likes": 0,
      "replies": null,
      "published_at": "2026-11-30T14:07:41Z"
    },
    {
      "id": "18111507292963658",
      "text": "...",
      "author": {
        "username": "selamariguia",
        "name": null,
        "verified": true
      },
      "likes": 0,
      "replies": null,
      "published_at": "2026-11-30T13:27:45Z"
    }
  ]
}

Both calls are the same request shape. Only platform and url change.

What each field means

Envelope. exists tells you whether the post was found. count is how many comments came back in this response. total was null in both examples above, so do not rely on it for a full comment count. has_more says whether more comments exist beyond this page. fetched_at is when the read happened.

text. The comment body as published.

author. An object with username, name and verified. In both examples name was null and the username was the identifier you get, so plan around username rather than a display name. verified is a boolean.

likes. The like count on the comment. Use it as reported by the network at read time.

replies. The number of replies under that comment, with an important caveat covered in the next section.

published_at. An ISO 8601 UTC timestamp for when the comment was posted.

id. The comment identifier on the network, useful for deduplicating if you re-read a post.

The replies field: a real number on YouTube and Facebook, null elsewhere

This is the part to read carefully if you are building anything on reply counts.

null means "this network's comment read does not give us a reply count", not "zero replies". The Instagram example above shows it: both comments have "replies": null. If you treat null as 0 you will undercount, so check for null explicitly in your code.

In practice: if your analysis needs per-comment reply counts, YouTube is the network where this endpoint delivers them. On the other networks, use likes and published_at as your signals.

Unknown or missing posts

If the post does not exist (deleted, private, or a wrong URL), the response is HTTP 200 with "exists": false instead of an error status. Branch on exists in your code rather than on the status code alone.

What it does not do

Being straight about the limits saves you time:

When another route is the better fit

SocialLens is built for small teams, solo developers and self-serve projects that want one request shape and pay-as-you-go pricing. It is not the right tool for everything:

If your job is "take this post URL, read the top comments, feed them into my dashboard, classifier or alert", the small self-serve route is usually all you need.

Cost

Each /post-comments read costs 1 credit. New accounts get 250 free reads with no card. Credits never expire, and packs start from about US$19. There is no monthly subscription to keep alive, so a project that reads comments once a week costs only what it reads. Full details are on the pricing page.

FAQ

Which networks does the comments endpoint support?

TikTok, Instagram, YouTube, Facebook and Reddit. Other networks are not available on /post-comments.

Why is replies null on Instagram?

On Instagram, TikTok and Reddit the comment read does not provide a reply count, so the field comes back as null. It does not mean zero. On YouTube and Facebook it is a real number.

Can I get every comment on a post?

No. You get the first page of comments per read, not the full tree with all nested replies. Use has_more to know whether more exist.

Can I search comments by keyword?

Not through the API. Read the post's comments and filter them in your own code.

What happens if the URL is wrong or the post was removed?

You get HTTP 200 with "exists": false. Handle that case in your code.

Last updated and data verified on November 30, 2026.

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