---
title: "Read target-scoped post analytics totals"
description: "PubNio API analytics.posts.get: read target-scoped post analytics totals. Request fields, examples in five clients, errors, and idempotency."
---

> Documentation Index
> Fetch the complete documentation index at: https://pubnio.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Read target-scoped post analytics totals

Read target-scoped post analytics totals with [`GET /api/v1/analytics/posts/{postId}`](https://pubnio.com/api/v1/docs#tag/analytics/GET/api/v1/analytics/posts/{postId}). Requires an API key with the `read` scope or a signed-in workspace member.

## Request

Returns one entry per destination target. A target whose attempt is not published or lacks a provider post ID returns a pending or unavailable state, not 404.

| Parameter     | In    | Type               | Required |
| ------------- | ----- | ------------------ | -------- |
| `postId`      | path  | UUID               | Yes      |
| `workspaceId` | query | UUID               | Yes      |
| `targetId`    | query | UUID               | No       |
| `from`        | query | string             | No       |
| `to`          | query | string             | No       |
| `timezone`    | query | string             | No       |
| `granularity` | query | `"day"`, `"total"` | No       |
| `metrics`     | query | array of string    | No       |

## Response

- HTTP 200: `PostAnalytics` with `postId`, `workspaceId`, `range`, `targets`, `freshness`.

The [OpenAPI document](https://pubnio.com/api/v1/openapi) has each field's type.

## Examples

### TypeScript

```ts
const totals = await workspace.analytics.post(postId);
```

### Python

```python
totals = workspace.analytics.get_post(post_id)
```

### cURL

```sh
curl "https://pubnio.com/api/v1/analytics/posts/$POST_ID?workspaceId=$WORKSPACE_ID" \
  -H "Authorization: Bearer $PUBNIO_API_KEY"
```

### CLI

```sh
pnio analytics posts get "$POST_ID"
```

### MCP execute

```js
async () => {
  const postId = "<postId>";
  const response = await codemode.request({
    method: "GET",
    path: `/api/v1/analytics/posts/${postId}`,
    query: { workspaceId: codemode.workspaceId },
  });
  return response.data;
};
```

## Errors

It declares no problem of its own.

It declares the problems [every Analytics operation](https://pubnio.com/docs/reference/#analytics) and [most operations](https://pubnio.com/docs/reference/#shared-problems) declare.

## Idempotency

None needed: a read is safe to retry.

## Limits

- Field lengths and ranges are in the [OpenAPI document](https://pubnio.com/api/v1/openapi).

## Related

- [Analytics operations](https://pubnio.com/docs/reference/#analytics)

Source: https://pubnio.com/docs/reference/analytics-posts-get/index.mdx
