Skip to content

Read daily post analytics series

PubNio API analytics.posts.series: read daily post analytics series. Request fields, examples in five clients, errors, and idempotency.

Read daily post analytics series with GET /api/v1/analytics/posts/{postId}/series. Requires an API key with the read scope or a signed-in workspace member.

Request

Daily points use UTC dates. Cumulative metrics set value to the day’s increase and total to the cumulative value; a missing date means no data. How far back from can reach depends on the workspace plan; an earlier date returns plan_required with the earliest allowed date.

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 has each field’s type.

Examples

const series = await workspace.analytics.series(postId, {
  metrics: ["views", "likes"],
});
series = workspace.analytics.get_post_series(post_id)
curl "https://pubnio.com/api/v1/analytics/posts/$POST_ID/series?workspaceId=$WORKSPACE_ID" \
  -H "Authorization: Bearer $PUBNIO_API_KEY"
pnio analytics posts series "$POST_ID" --metrics views,likes
async () => {
  const postId = "<postId>";
  const response = await codemode.request({
    method: "GET",
    path: `/api/v1/analytics/posts/${postId}/series`,
    query: { workspaceId: codemode.workspaceId },
  });
  return response.data;
};

Errors

It also declares the problems every Analytics operation and most operations declare.

Idempotency

None needed: a read is safe to retry.

Limits

Type to search…

↑↓ navigate↵ selectEsc close