# retrieveProfileViewers

Retrieve the list of people who recently viewed the current account's LinkedIn profile.

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);
  }
}
```

```python
from linkedapi import RetrieveProfileViewersParams

workflow = linkedapi.retrieve_profile_viewers.execute(RetrieveProfileViewersParams(limit=50))
result = linkedapi.retrieve_profile_viewers.result(workflow.workflow_id)

if result.errors:
    print(result.errors)

for viewer in result.data or []:
    if viewer.viewer_type == "identified":
        print(viewer.name, viewer.public_url, viewer.viewed_ago)
    else:
        print(viewer.description, viewer.viewed_ago)
```

## 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`:

- `identified` – `name`, `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.
- `anonymous` – `description`, `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](/docs/action-st-retrieve-profile-viewers) for the complete response contract and error list.
