Back to blog
8 min read

Post Comments and Reactions API: Build a Prospect List

By Kooperativa Engineering

Post Comments and Reactions API: Build a Prospect List

Under a good post there is a list of people who stopped and did something: wrote a comment or reacted. For a seller that list is worth more than a cold export, because every person on it showed interest in a topic you care about, in public, this week. The post can be a competitor announcement, a customer's case study, or a thread about the problem your product solves.

The difficulty has always been the last step. A name and a reaction do not tell you whether this is a VP at a target account or a student. This article builds the full path: take a post, list who commented and reacted, enrich every person, and keep the ones who match your buyer.

How to find who commented on or reacted to a post

Each stage is one endpoint, and the last two are covered by the license.

StageEndpointResultBilling
1. Find the postGET /v1/companies/posts or /v1/people/postsThe urn of the post$0.001 per call
2. List the audienceGET /v1/posts/reactions and GET /v1/people/post-commentsWho reacted and who replied$0.001 per call
3. Identify each personGET /v1/personTitle, seniority, employer, historyIncluded in the license
4. DecideYour own filter on seniority and companyThe short listNone

Stage two: the post comments API and the post reactions API

Take the urn from a posts response, or pass the post URL, and page through the comments from 1. Replies come nested under each comment. For reactions, one post serves up to 38 pages, and you can split a large audience by reaction type: call once per type and each call reads its own pages, so a post with thousands of reactions is still readable in full.

Comments and reactions on one postbash
KEY="Authorization: Bearer ik_live_..."
BASE="https://kooperativa.io/api/v1"
URN="urn:li:activity:1234567890123456789"

# The discussion, 50 per page, replies nested under each comment
curl "$BASE/companies/post-comments?urn=$URN&page=1" -H "$KEY"

# Who reacted, with the reaction type for each person
curl "$BASE/posts/reactions?urn=$URN&page=1" -H "$KEY"

# Only one type of reaction
curl "$BASE/posts/reactions?urn=$URN&page=1&reactionType=INTEREST" -H "$KEY"

Stage three: enrich the people who engaged

The person endpoints accept a profile URL, a username or a member id, so whatever identifier an item in the audience list carries can go straight into GET /v1/person. Because enrichment is covered by the license, it makes no difference to the cost whether you enrich 20 people or 2,000.

The script below goes from a post to a short list. It reads the first pages of reactions and comments, looks each person up and keeps the ones whose seniority matches. Which field in an item holds the profile reference is visible in a real response, so print one item first and adjust the line marked below.

From a post to a short list of buyersjs
const BASE = 'https://kooperativa.io/api/v1';
const headers = { Authorization: `Bearer ${process.env.KOOPERATIVA_API_KEY}` };
const urn = 'urn:li:activity:1234567890123456789';

async function get(path, params) {
  const res = await fetch(`${BASE}${path}?${new URLSearchParams(params)}`, { headers });
  return res.ok ? res.json() : null;
}

const reactions = await get('/posts/reactions', { urn, page: 1 });
const comments = await get('/companies/post-comments', { urn, page: 1 });

const audience = [
  ...(reactions?.data?.items ?? []),
  ...(comments?.data ?? []),
];

const shortList = [];
for (const item of audience) {
  const ref = item.profileUrl ?? item.url; // adjust to the field in your response
  if (!ref) continue;
  const person = await get('/person', { linkedin_url: ref });
  if (!person) continue;
  shortList.push(person); // filter here on seniority and company size
}

Why comments outrank reactions, and why the source post matters

A reaction takes one tap. A comment takes a sentence, and the sentence tells you what the person thinks. Sort your list so commenters come first and read what they wrote before anyone writes to them. The post matters as much as the action: people who engage with a competitor's announcement are researching your category, and people who engage with a general industry post are not. Choose the posts you pull from with that in mind.

What it costs

Pulling a post with three pages of reactions and three pages of comments is six calls, which is $0.006. Enriching the 150 or so people in those pages is covered by the license. The same job on a tool that charges per contact or per lookup for the enrichment costs more with every person on the list, so the cost of this build is dominated by nothing at all.

Practical notes for the build

The endpoints are in Beta, so keep a few habits. Page until a page comes back empty and cap the number of pages yourself. Send member ids exactly as they were returned, because they are case sensitive and a changed id is rejected before it is billed. A post that does not exist returns an error and not an empty list. Sorting on comments always returns the newest first.

The people in a reaction list are third parties who did not sign up to your funnel. Contact them with something relevant and individual, not with a bulk sequence, and keep a record of why each person is on your list.

Frequently asked questions

Is there an API for post comments?

Yes. GET /v1/people/post-comments and GET /v1/companies/post-comments return the comments on a post, 50 per page, with replies nested under each comment.

How do I export the people who liked a post?

Call GET /v1/posts/reactions with the post urn or URL and page through the result. Each item is a person with their reaction, and you can enrich each one with GET /v1/person.

How do I find out who commented on or reacted to a post?

Call GET /v1/posts/reactions for reactions and GET /v1/people/post-comments or GET /v1/companies/post-comments for comments, with the post urn or URL. Page through the results.

How do I read a post with thousands of reactions?

One call sequence serves up to 38 pages. Split the audience by passing reactionType, one type per call sequence, and each type has its own pages.

How do I turn the people on a post into leads?

Look up each person with GET /v1/person to get title, seniority and employer, then keep the ones that match your buyer. Enrichment is covered by the license, so it does not add a per-person cost.

How much does this cost?

Each live call is $0.001. A post with three pages of reactions and three pages of comments is six calls, or $0.006.

Get started

Try Kooperativa

One API key. Person and company enrichment, structured search, and monitors under one flat license.

Keep reading

We use only cookies that are strictly necessary to run this site (staying signed in, and protecting forms from abuse). Our analytics tool doesn't use cookies or collect personal data. See our Privacy Policy for details.