POST COMMENTS API

Every Comment on a Post, With Who Wrote It

Send a post URL and get its comments as JSON: the commenter, the text, the time, reaction counts and the replies under each one. Sort newest first or by relevance, and page through with a cursor.

POST/api/v1/post/comments

{
  "cursor": null,
  "message": {
    "comments": [
      {
        "commenter": { "title": "Example Co", ... },
        "text": "Awesome work Pratik Dani",
        "replies_count": 0
      }
    ],
    "total": 2
  }
}

What is the Datamagnet Post Comments API?

The Datamagnet Post Comments API returns the comments on a post as structured JSON, from the post URL. Each comment includes the commenter’s name, headline and profile link, the text, the time it was posted, reaction counts, and the replies under it. Comments come newest first or by relevance, and a page cursor walks the full list.

Input
Post URL
Cost
10 credits per page
Freshness
Live at request time

One request

Authenticate with your API key as a bearer token and send a JSON body. This is the request behind the sample response.

  • POST /api/v1/post/comments
  • Input: Post URL
  • Cost: 10 credits per page
POST /api/v1/post/comments
curl -X POST \
  "https://api.datamagnet.co/api/v1/post/comments" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://www.linkedin.com/feed/update/urn:li:activity:7321383686006882304", "sort": "recent"}'

→ 200 OK · 10 credits

{  "cursor": null,  "message": {    "comments": [      {        "commenter": {          "title": "Example Co",          "subtitle": "22,134 followers",          "navigation_url": "https://www.linkedin.com/company/example-co/posts"        },        "text": "Awesome work Pratik Dani",        "timestamp": 1745566104897,        "pinned": false,        "replies_count": 0,        "top_replies": []      }    ],    "total": 2  }}

What you get

The main fields in the response. The Post Comments reference documents every field.

FieldTypeDescription
commenter.titlestringName of the person or page that commented.
commenter.subtitlestringThe commenter’s headline.
commenter.navigation_urlstringLink to the commenter’s profile or page (/in/, /company/ or /school/).
commenter.is_post_authorboolean | nulltrue when the commenter wrote the post.
textstringText of the comment.
timesstringISO 8601 time the comment was posted. timestamp holds the same in milliseconds.
permalinkstringDirect link to the comment.
reactions_countinteger | nullTotal reactions on the comment, with a by-type breakdown in reaction_type_counts.
replies_countintegerNumber of replies to the comment.
top_repliesarrayReplies to the comment, in the same shape as a comment.
mentionsarrayPeople and companies tagged in the comment.
totalintegerNumber of top-level comments on the post. Replies are not counted here.

Use cases

Lead lists from engagement

Everyone who commented on a competitor’s launch or an industry post, with a profile link you can pass to the People API for the full profile.

Read the conversation

Feed comment and reply text into analysis or an AI agent to find questions, objections and recurring themes under a post.

Track replies on your posts

Sort by recent to pick up new comments on your own posts, and use is_post_author to separate your replies from everyone else’s.

Frequently asked questions

10 credits per successful request, and each request returns one page of comments.

Make the first request without page. If cursor in the response is not null, send it as page in the next request, and repeat until cursor is null.

total counts top-level comments only. Replies are returned nested inside each comment under top_replies and counted by replies_count, while the count shown on a post includes replies.

Yes. Set sort to recent (newest first) or relevance. Without it, comments come back newest first. Any other value returns a 400.

Pull your first comments with 10 free credits

No credit card required. Get an API key and turn a post’s comments into a list in a few minutes.

  • 10 credits per page
  • Charged only on success
  • Replies nested under each comment

Interactive Demo

~15 minutes

1

Get your API key

1 min
2

POST a post URL

1 min
3

Page until cursor is null

Instant