Blog

Watch a list of LinkedIn company pages for new posts, and pay only for the posts you have not read

A company page's posts cost a credit each, so a poll that asks for 25 mostly rebuys posts you stored last time. Size count to the gap and stop at the overlap.

The Triguna team 25 November 2026

Rendered still life on a pale floor: a stack of thin stone slabs on a grey plinth, the top two slabs orange and slightly offset as new posts and the pale ones below already stored, beside the headline "Pay for new posts, not reruns."

GET /v1/companies/posts returns a company page’s newest posts, newest first, reposts included. It bills one credit per post returned, and count, from 1 to 25, is the most a call can charge. That pricing changes how you poll. On a feed you pay per page, so rereading a page you already have costs one credit. Here you pay per post, so rereading 25 posts you stored yesterday costs 25.

curl -H "ApiKey: $TRIGUNA_KEY" \
  "https://api.triguna.ai/v1/companies/posts?company_id=examplecorp&count=5"

If you want to know when a list of companies posts something new, the job is to ask for roughly the number of posts that are new since your last look, and no more. The rest of this post covers how to size that number, where the bookmark lives, and the two urn details that decide what you can do with a post once you have it.

What one call returns, and what it costs

The response is {company_id, count, posts[]}. Each item in posts[] is exactly the post object of GET /v1/posts/details, so a parser written for one reads the other. Three rules from the reference shape everything below:

  • There is no next page. 25 is the most you can see. The source can return slightly fewer than count, so a short list does not mean the company has nothing older.
  • The charge is per post returned. A company with four posts costs 4 however many you ask for, and a company with none costs 1.
  • Your balance must cover count, not the result. Ask for 25 with 20 credits left and the call is a free 402 with the body insufficient credits, even if the company has posted twice.
PollPosts returnedCredits
count=25, company posted twice since last poll2525
count=5, company posted twice since last poll55
count=5, company page has no posts01
company_id that does not exist4041

The first two rows return the same two new posts. The difference is how many old ones you bought again to find them.

Your bookmark is the set of activity urns you have stored

Every post carries an activity_urn. Store it per company and you know where the last poll ended:

create table company_posts_seen (
  company_id     text not null,  -- the slug or numeric id you query with
  activity_urn   text not null,  -- as the response returned it
  created_at_ms  bigint,         -- may be null, like every value
  first_seen_at  timestamptz not null default now(),
  primary key (company_id, activity_urn)
);

Query with the identifier you stored, not a display name. company_id takes the slug after /company/ in the page URL, the numeric id, or the full URL. “Example Corporation” is a 404, and that 404 costs one credit like any answered lookup, so fix the input rather than retrying it. The company records guide covers keeping that identifier stable.

Size count to the gap, and keep one post of overlap

Posts come back newest first. If the list contains at least one activity_urn you already stored, you have reached the overlap with the previous poll and everything newer is what you missed. If every post in the list is new, you cannot tell whether there are more behind it.

That gives a simple rule. Ask for the number of posts you expect since your last poll, plus one, so that a normal poll ends on a post you already have:

const BASE = 'https://api.triguna.ai/v1';
const headers = { ApiKey: process.env.TRIGUNA_KEY };

async function pollCompany(companyId, seen, count) {
  const url = new URL(`${BASE}/companies/posts`);
  url.searchParams.set('company_id', companyId);
  url.searchParams.set('count', String(count));
  const res = await fetch(url, { headers });
  const charged = Number(res.headers.get('X-Credits-Charged'));
  if (!res.ok) throw new Error(`${res.status} ${await res.text()} (charged ${charged})`);
  const { posts } = await res.json();
  const fresh = posts.filter((p) => !seen.has(p.activity_urn));
  const caughtUp = fresh.length < posts.length; // at least one post was already stored
  return { fresh, caughtUp, charged };
}

Then adjust count per company from what the poll saw:

  • Caught up with room to spare. Most of the list was old. Lower count for the next poll, but not below 2, so there is still room for one new post and one post of overlap.
  • Caught up on the last post. The size was right. Keep it.
  • Not caught up. Every post was new. Raise count for the next poll. If the gap matters now, read once more with count=25 and accept that you are rebuying the posts you just read.

Parse X-Credits-Charged as a number, not an integer, and add it to a running total per company. After a week of polls the totals tell you which pages are worth watching daily and which only need a weekly look.

Poll at most once a day unless you bypass the cache

use_cache defaults to true and serves a stored copy less than 24 hours old at the same price as a live read. For this endpoint that means a second poll on the same day, with the same request, returns the list you already have and charges you for every post in it again.

So pick one of two schedules:

  • Daily or slower, cache on. The default. A stored copy that is still fresh is the same list you would have fetched.
  • More than once a day, use_cache=false. Only then is each poll a real re-read. With use_cache=false a failed fetch is a free 502 rather than a stored copy, so retry it with backoff.

When to bypass the enrichment cache walks through the same trade on the other endpoints.

Decide what a repost means to you

A company page shares other people’s posts. A repost without the company’s own words comes back with action_type set to repost, the company as author, commentary set to null, and the original post under reshared_activity. It costs a credit like any other post returned.

Decide up front whether reposts count as news. If you only want the company’s own words, skip items where action_type is repost and commentary is null when you alert, but still store their activity_urn so the overlap rule keeps working. If you want them, key any deduplication on reshared_activity.activity_urn, because several companies you watch may repost the same original.

From a new post to the people engaging with it

A new post is often the start of the job, not the end. Who commented on it and who reacted to it comes from two paged endpoints, and each takes a different urn:

You wantEndpointUrn it takesWhere you get it
Everyone who commentedGET /v1/posts/commentsactivity_urnAlready on the company post
Everyone who reactedGET /v1/posts/reactionsshare_urnOften null on the company post: call GET /v1/posts/details with the activity_urn

The two urns are different numbers and neither can be derived from the other. Passing the wrong form is a free 400. posts/details costs one credit and fills both, so call it once for the posts you care about and store both urns.

Each page of comments or reactions costs one credit whatever its size, so ask for count=100. Stop when items is empty, not when a page comes back short, and deduplicate on the commenter’s or reactor’s entity_urn, because items occasionally repeat across pages. Who liked and commented on a LinkedIn post covers those lists in detail, and the Person API turns any entity_urn in them into a full profile.

Budget a run before you start it

A watch list is a batch job, and the balance check is free. Read GET /v1/credits before a run and compare it with the sum of count across the companies you are about to poll. The balance must cover each call’s count, so a run that starts with too little stops partway with 402 responses rather than skipping the expensive companies. Check credits before a batch run has the pattern.

The retry rules are the usual ones. Retry 429, 502 and 503 with backoff, honouring Retry-After where it is sent. Do not retry 400, 401, 402 or 404. A retried 404 costs a credit every time and returns the same answer.

How this differs from polling a person’s feed

If you already poll people with GET /v1/activities/personal-feed, the structure is the same and the economics are not:

Person feedCompany page posts
Billing1 credit per page of up to 301 credit per post returned
Pagingpagination_token, page until the overlapNone, 25 at most
The leverStop paging at the overlapAsk for fewer posts
Cost of rereading old itemsOne pageOne credit per old post

Polling a person’s activity incrementally covers the feed side. The seen-set table and the cache rule carry over unchanged.

The short version

  1. Store activity_urn per company. That set is your bookmark.
  2. Ask for the gap plus one. A poll that ends on a post you already have is the right size.
  3. Grow or shrink count per company from what each poll saw, and track X-Credits-Charged.
  4. Poll at most daily with the cache on, or send use_cache=false for sub-daily polls.
  5. Keep both urns for the posts you follow up on: activity_urn for comments, share_urn from posts/details for reactions.

Fifty free credits are enough to put a few company pages on a daily watch and see the overlap rule settle each one at a small count. Why the reference documents billing at this level of detail is on the about page.

Next

company-postspollingcost-controlcaching

Start with one request

Free credits on signup, no card required. Usage-based pricing after that.