retrieveProfileViewers

Retrieve the list of people who recently viewed the profile of the account associated with the current API tokens.

typescript
const workflow = await linkedapi.retrieveProfileViewers.execute({ limit: 50 });
const { data, errors } = await linkedapi.retrieveProfileViewers.result(workflow.workflowId);

if (errors.length > 0) {
  console.warn(errors);
}

for (const viewer of data ?? []) {
  if (viewer.viewerType === "identified") {
    console.log(viewer.name, viewer.publicUrl, viewer.viewedAgo);
  } else {
    console.log(viewer.description, viewer.viewedAgo);
  }
}

Params

  • limit (optional) – maximum number of viewers to retrieve. Defaults to 20 and accepts values from 1 to 300.
  • since (optional) – ISO 8601 timestamp; only viewers seen at or after it are returned. It is matched against the estimated viewedAt, so a boundary inside the unit LinkedIn displayed can include or exclude a view near the edge.

How much of the viewer history LinkedIn shows depends on the account. Without LinkedIn Premium, LinkedIn shows only part of the list, and the method returns what is visible – that is a successful result, not an error. An empty array is a legal result too.

Data

Returns a flat array of viewers, in the order LinkedIn shows them. Every item carries viewerType, viewedAt, and viewedAgo, and the remaining fields depend on viewerType:

  • identifiedname, publicUrl, urn, headline, connectionDegree (1, 2, 3, or null), avatarUrl. urn is the stable member URN and is not always available – LinkedIn exposes it only for some viewers, so expect null on part of the list.
  • anonymousdescription, searchUrl.

An anonymous viewer carries exactly what LinkedIn produced: the description line it displayed, and the people-search URL it offers for that viewer. The criteria LinkedIn disclosed (position keywords, industry, location, or company) live in the query parameters of searchUrl, so read them there rather than parsing the description.

viewedAt is an estimate derived from the relative age LinkedIn displayed, so it is only as accurate as the unit LinkedIn showed. viewedAgo is that relative age in normalized form, such as 6h or 3d, and does not depend on the account's interface language.

See the st.retrieveProfileViewers action reference for the complete response contract and error list.