Skip to content

Read one account's analytics

PubNio API analytics.accounts.get: read one account's analytics. Request fields, examples in five clients, errors, and idempotency.

Read one account’s analytics with GET /api/v1/workspaces/{workspaceId}/analytics/accounts/{accountId}. Requires an API key with the read scope or a signed-in workspace member.

Request

Returns totals or a daily series for one provider account in the workspace. How far back a daily series can reach depends on the workspace plan; an earlier from returns plan_required with the earliest allowed date.

Parameter In Type Required
workspaceId path UUID Yes
accountId path UUID Yes
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: AccountAnalytics with accountId, workspaceId, provider, accountKind, profileId, name, range, metrics, series, freshness.
    • provider: bluesky, facebook, instagram, linkedin, pinterest, reddit, snapchat, tiktok, threads, x, youtube, google_business, meta_ads, google_ads, reddit_ads, pinterest_ads, tiktok_ads, linkedin_ads, snapchat_ads, amazon_ads, openai_ads
    • accountKind: social_page, social_account, social_board, social_channel, ad_account

The OpenAPI document has each field’s type.

Examples

const analytics = await workspace.analytics.account(accountId, {
  from: "2026-11-01",
  to: "2026-11-30",
});
analytics = workspace.analytics.get_account(account_id)
curl "https://pubnio.com/api/v1/workspaces/$WORKSPACE_ID/analytics/accounts/$ACCOUNT_ID" \
  -H "Authorization: Bearer $PUBNIO_API_KEY"
pnio analytics accounts get "$ACCOUNT_ID" --from 2026-11-01 --to 2026-11-30
async () => {
  const accountId = "<accountId>";
  const response = await codemode.request({
    method: "GET",
    path: `/api/v1/workspaces/${codemode.workspaceId}/analytics/accounts/${accountId}`,
  });
  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