Blog
Reading one person's LinkedIn activity, and the urn that decides what you can ask next
A person's posts, comments and reactions are one endpoint and three answers. The feed leaves share_urn null, and that decides what you can ask next.
Asking for a person’s LinkedIn posts is two calls, not one. GET /v1/activities/personal-feed
takes the bare ACo... entity_urn and nothing else, so if all you hold is a profile slug you
have to resolve it first. Hand the slug straight to the feed and you get this, verbatim:
HTTP/1.1 400 Bad Request
X-Credits-Charged: 0
invalid entity_urn: pass the bare ACo... entity_urn returned by /v1/people/profile, not a public
identifier or a urn:li: string
The 400 is free, so the mistake costs you latency rather than credits. The fix is to resolve
once and keep the urn, because public_identifier is user editable and the urn is not. That is the
same argument made at length in
keying records on the stable identifier, and the
feed is where ignoring it hurts most: three of the paths on the API accept only the bare form.
One endpoint, three different questions
activity_type is the parameter that does the real work. It defaults to posts, and the other two
values answer questions that have nothing to do with publishing.
activity_type | Each item is | Where the person is |
|---|---|---|
posts | their own posts and reposts | the author |
comments | a post they commented on | in highlighted_comments |
reactions | a post they reacted to | named by reaction_type |
The second and third are the ones worth noticing. In comments and reactions mode the author
on each item is whoever wrote the post, not the person you asked about. A pipeline that reads
author.name and assumes it has your subject will quietly attribute every item to the wrong
person, and because the shape is identical in all three modes nothing errors.
reactions mode also tells you how they reacted, using the source’s internal names rather than the
button labels:
reaction_type | The button |
|---|---|
like | Like |
empathy | Love |
praise | Celebrate |
appreciation | Support |
interest | Insightful |
entertainment | Funny |
Those are the same keys engagement.reaction_breakdown uses, so a counter written for one reads
the other unchanged.
One more wording trap in that mode: header_text keeps LinkedIn’s own phrasing, which sometimes
describes a reaction to a comment on the post rather than to the post, as in
"Jordan Avery loved Sam Okafor's comment on this". If you are counting reactions to posts, read
header_text before you count the item.
Always send count=30
count runs from 1 to 30 and defaults to 10. Every page costs one credit whatever it holds, so the
default is a threefold overpay for the same data.
Note the ceiling, because it differs across the surface: post search pages at up to 50 and the
comment and reaction lists at up to 100, but the activity feed stops at 30. A helper that hard
codes count=50 for everything earns a free 400 here.
At $0.005 a credit, with the urn already stored:
| What you want | Calls | Credits | Cost |
|---|---|---|---|
| One page of 30 | 1 | 1 | $0.005 |
| One person’s last 90 items | 3 | 3 | $0.015 |
| 30 items each for 100 people | 100 | 100 | $0.50 |
| A daily check on 100 people for a year | 36,500 | 36,500 | $182.50 |
Add one credit per person the first time if you are starting from slugs instead of urns. On the 100 person row that is a one off dollar, after which the profile call never runs again. The Person API page lists every identifier form that call accepts.
Walk the pages, and do not trust has_more alone
pagination.has_more is a nullable boolean. It can come back null, which is neither a stop nor a
go, so a loop that exits only on has_more === false can run forever or stop early depending on
which way you coerce it. Stop on three conditions instead:
async function* walkActivity(entityUrn, activityType = 'posts') {
let token;
for (;;) {
const url = new URL('https://api.triguna.ai/v1/activities/personal-feed');
const params = { entity_urn: entityUrn, activity_type: activityType, count: '30' };
if (token) params.pagination_token = token;
url.search = new URLSearchParams(params);
const res = await fetch(url, { headers: { ApiKey: process.env.TRIGUNA_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const { activities, pagination } = await res.json();
yield* activities;
// An empty page, a missing token, or an explicit false. Any one of them ends the walk.
if (!activities.length || !pagination?.next_token || pagination.has_more === false) return;
token = pagination.next_token;
}
}
Pass pagination.next_token back unchanged and omit it on the first page. Each page is one credit,
so an abandoned loop is a bill rather than a warning. The published limit is 10 requests per second
and both 429 and 503 carry Retry-After; which statuses are worth a retry at all is in
which enrichment errors to retry.
The urn the feed does not give you
Here is the part that shapes your architecture. Every feed item carries activity_urn, but
update_urn, thread_urn and share_urn are always null, because that scaffolding is not
available on this path.
That matters because the two engagement lists are keyed by two different urns that are different numbers for the same post:
| What you hold | /v1/posts/comments | /v1/posts/reactions |
|---|---|---|
activity_urn, urn:li:activity: form | the form it wants | not this form |
activity_urn, urn:li:ugcPost: form | not this form | the form it wants |
share_urn | n/a | always null on the feed |
activity_urn arrives in either form depending on the item, so branch on the prefix rather than
assuming. Whichever one you got, the other list is out of reach directly, and the wrong form never
returns the right list.
GET /v1/posts/details is the bridge. It accepts the LinkedIn URL or any of the urn forms, it
fills thread_urn and share_urn, and its post object is exactly the item shape the feed
returns, so a parser written for the feed reads it with no changes:
# One credit. Returns both urns, so keep both.
curl -s -G "https://api.triguna.ai/v1/posts/details" \
--data-urlencode "post=urn:li:ugcPost:7500000000000000001" \
-H "ApiKey: $TRIGUNA_KEY" \
| jq '{activity_urn, share_urn}'
So going from “their recent posts” to “everyone who engaged with their recent posts” is three
layers: one page of feed, one posts/details per post you care about, then the paged lists. Budget
it per post you select rather than per post in the feed, and select on the counts the feed already
gave you. The arithmetic for walking a full engagement list is in
who liked and commented on a LinkedIn post.
What the feed already answers for free
Before you pay for a second layer, check whether the feed settled it. Each item arrives with
engagement counts and a reaction breakdown, the full commentary text, the author block with a
headline and a stable urn, and attachments populated with images, videos, articles, documents and
polls. Ranking a person’s posts by reactions, or detecting that someone posted about hiring, needs
no further calls at all.
A repost carries the original under reshared_activity with the same item shape. If you are
measuring what somebody writes, filter on action_type first or reposts will inflate the count
with other people’s words. is_root_share tells you the same thing from the other direction.
Every field here is nullable while every key is present, which is the convention across the whole
API: commentary is null on an image only post, header_text is null outside the modes that use
it. The parsing pattern for that is in
handling partial enrichment records.
What this endpoint is not
It is not a search. You cannot ask for “people posting about migrating off a scraper” and get a list of people back, because the feed is a keyed lookup: you bring a urn and it tells you what that person did. Keyword search exists, it runs over posts rather than people, and it has a billing trap of its own, covered in searching LinkedIn posts by keyword.
It is also not a company feed. There is no employee listing path, so “the activity of everyone at Acme” is not a query this surface answers. You would need the urns already, one per person, and then one feed walk each. The about page explains why the surface stays this small instead of growing an endpoint per question.
The short version
- The feed takes the bare
ACo...urn only. A slug or aurn:li:string is a free400, so resolve once through the profile call and store the urn. activity_typechanges whoauthoris. Incommentsandreactionsmode the author is whoever wrote the post, not your subject.- Send
count=30. It is the ceiling here even though other paths allow 50 or 100, and every page costs the same one credit. - Stop paging on an empty page or a missing token.
has_moreis nullable and cannot be your only exit. share_urnis always null on the feed. One of the two engagement lists is always out of reach until you spend a credit onposts/detailsto get both urns.- Never date a reaction from
created_at_ms. That timestamp is the post’s, and the reaction has none.
Fifty free credits with no card are enough to resolve a urn, walk dozens of pages across all three
modes, and see for yourself which form of activity_urn you get back. The setup is in
enriching on signup.
Next
- Person API: the call that resolves a slug to the
entity_urnthe feed needs, and every identifier form it accepts. - Keying records on the stable identifier: why you store the urn rather than the slug, and what breaks when you do not.
- Who liked and commented on a LinkedIn post: the two post urns, and what a full engagement list costs to walk.
- Searching LinkedIn posts by keyword: the one search path on the API, and the no match page that still bills.
- Handling partial records: parsing a payload where every key is present and every value may be null.
- Giving an agent an API contract: the one page to hand an assistant, including the searches it does not have.
- Pricing: what an answered lookup and a page of a feed cost, and the statuses that cost nothing. Sign up for fifty free credits at app.triguna.ai/signup.