# Retrieving post data

To retrieve LinkedIn post data, include the st.openPost action in your workflow. Returns post content, author, media, reactions, comments, reposts, and metadata.

> The API Reference is also the SDK and CLI reference. Consecutive code fences marked `tab=HTTP`, `tab=Node`, `tab=Python` and `tab=CLI` are the same call on each surface (a fence marked `tab=HTTP,CLI` is the same text for both), and a block between `:::surface <names>` and `:::` applies only to the surfaces it names. Identifiers in the text are written as in Node and in HTTP JSON (camelCase); the Python SDK spells methods, parameters and result attributes in snake_case (`sendMessage` → `send_message`, `reconnectionLink` → `reconnection_link`), while names inside HTTP JSON stay camelCase.

To retrieve LinkedIn post data, include the [`st.openPost`](/docs/action-st-open-post) action in your workflow and set `basicInfo` to `true`. Here's an example:

:::surface node
Each example below has its Node SDK call in the Node tab, and the label over each completion says what that call returns.
:::

:::surface python
Each example below has its Python SDK call in the Python tab, and the label over each completion says what that call returns.
:::

:::surface cli
Each example below has its CLI command in the CLI tab, and the label over each completion says what the command prints.
:::

**Workflow:**

```json tab=HTTP
{
  "actionType": "st.openPost",
  "postUrl": "https://www.linkedin.com/posts/post1",
  "basicInfo": true
}
```

```typescript tab=Node
const workflow = await linkedapi.fetchPost.execute({
  postUrl: "https://www.linkedin.com/posts/post1"
});

const { data, errors } = await linkedapi.fetchPost.result(workflow.workflowId);
```

```python tab=Python
from linkedapi import FetchPostParams

workflow = linkedapi.fetch_post.execute(
    FetchPostParams(
        post_url="https://www.linkedin.com/posts/post1",
    )
)

result = linkedapi.fetch_post.result(workflow.workflow_id)
```

```bash tab=CLI
linkedin post fetch https://www.linkedin.com/posts/post1
```

:::surface http
**Completion:**
:::

:::surface node,python
**Completion** – `result()` returns its `data` in `data`, and a failed action in `errors`:
:::

:::surface cli
**Completion** – with `--json` the CLI prints its `data` as `data`, or the action's `error`:
:::

```json
{
  "actionType": "st.openPost",
  "success": true,
  "data": {
    "url": "https://www.linkedin.com/feed/update/urn:li:activity:1234567890123456789",
    "activityUrn": "urn:li:activity:1234567890123456789",
    "time": "2023-01-02T12:30:00Z",
    "type": "original",
    "author": {
      "type": "person",
      "name": "Example Person",
      "urn": "urn:li:member:123456789",
      "profileUrl": "https://www.linkedin.com/in/example-person",
      "headline": "Product Marketing Lead",
      "viewerState": { "connectionDegree": "2nd" }
    },
    "reposter": null,
    "text": "Check out our latest product launch!",
    "repostText": null,
    "hashtags": ["product", "launch"],
    "mentions": ["https://www.linkedin.com/company/example-company"],
    "externalLinks": ["https://example.com/launch"],
    "images": [
      "https://static.linkedin.com/image1.jpg",
      "https://static.linkedin.com/image2.jpg"
    ],
    "documentSlides": [],
    "hasVideo": false,
    "videoThumbnail": null,
    "hasPoll": false,
    "reactionsCount": 27,
    "commentsCount": 8,
    "repostsCount": 12,
    "viewerState": { "reaction": null, "isOwn": false }
  }
}
```

> 💡 If you want to react or comment on the opened post, use the following actions as children: [st.reactToPost](/docs/action-st-react-to-post), [st.commentOnPost](/docs/action-st-comment-on-post).

> This page provides examples of [workflows](/docs/building-workflows) and their [completions](/docs/executing-workflows). For detailed documentation on constraints, parameters, and possible results of specific actions, always refer to the corresponding [action documentation pages](/docs/actions-overview).
