BizKitHub
DocsAPI ReferencePost/bff/post/analytics
getPostAdmin BFF

/bff/post/analytics

Aggregated read-only counters powering the Analytika tab: KPIs with period-over-period delta (views, published, comments), views/publications/comments timeseries bucketised by week or month, top posts + trending (biggest half-period growth), category occupancy + readership, publication cadence (12 months), rating histogram, tag popularity, author leaderboard, visibility breakdown and content freshness. "Views in period" is computed as the incremental delta of content__post_view_history (LAG per post_id) so we count only traffic during the window, not the cumulative all-time counter. Scoped to kind="post" so branch documents never appear.

PostgetBffPostAnalytics

Parameters

2 query

Query parameters

· 2
period"30d" | "90d" | "365d"Optional

Rolling window for KPIs, top posts, trending, category readership and viewsOverTime. Publication cadence + freshness always cover 12 months / all live posts respectively.

Default: 30d
Example30d
bucket"week" | "month"Optional

Aggregation step for the viewsOverTime, publication and comment timeseries. Default week reads well for 30d/90d; switch to month for 365d.

Default: week
Exampleweek

Response schema

1 status code documented

200Success
period"30d" | "90d" | "365d"Required
bucket"week" | "month"Required
generatedAtstringRequired

ISO timestamp of when the snapshot was computed (useful for a "poslední aktualizace" badge).

kpisobjectRequired
totalViewsobjectRequired
valuenumberRequired
previousValuenumberRequired
deltaPercentnumber | nullRequired

Percentage change vs. previous window of equal length. null when the previous window was empty and the current one isn't (no meaningful % — UI renders a "new" badge). 0 when both windows are empty.

One of 2:
Variant 1
number
Variant 2
null
publishedPostsobjectRequired
valuenumberRequired
previousValuenumberRequired
deltaPercentnumber | nullRequired
One of 2:
Variant 1
number
Variant 2
null
livePostsobjectRequired
valuenumberRequired
avgRatingobjectRequired
valuenumberRequired

Mean feedback score (1..5). 0 when no feedback rows exist.

countnumberRequired
newCommentsobjectRequired
valuenumberRequired
previousValuenumberRequired
deltaPercentnumber | nullRequired
One of 2:
Variant 1
number
Variant 2
null
starPostsobjectRequired
valuenumberRequired
viewsOverTimeobject[]Required
Each array item:
bucketstringRequired

Bucket anchor date in ISO YYYY-MM-DD (start of week or month).

viewsnumberRequired
publishedCountnumberRequired
commentCountnumberRequired
topPostsobject[]Required
Each array item:
externalIdstringRequired

16-char external post id (wire identifier). Internal bigserial is never exposed.

titlestringRequired
categoryNamestring | nullRequired
One of 2:
Variant 1
string
Variant 2
null
viewsPeriodnumberRequired
viewsTotalnumberRequired
ratingAvgnumber | nullRequired
One of 2:
Variant 1
number
Variant 2
null
ratingCountnumberRequired
commentsCountnumberRequired
trend"up" | "down" | "flat"Required
isStarbooleanRequired
trendingPostsobject[]Required
Each array item:
externalIdstringRequired
titlestringRequired
viewsRecentnumberRequired
viewsPriornumberRequired
deltaPercentnumber | nullRequired
One of 2:
Variant 1
number
Variant 2
null
categoryOccupancyobject[]Required
Each array item:
externalIdstringRequired

16-char external category id (wire identifier).

namestringRequired
postCountnumberRequired
avgViewsPerPostnumberRequired

Average of content__post.views_count across posts in this category (cumulative).

categoryReadershipobject[]Required
Each array item:
externalIdstring | nullRequired

16-char external category id, or null for posts without a category.

One of 2:
Variant 1
string
Variant 2
null
namestringRequired
viewsPeriodnumberRequired
sharenumberRequired

Percentage share of category views out of the top-15 total (0..100).

publicationCadenceobject[]Required
Each array item:
monthstringRequired

YYYY-MM anchor for the month bucket.

publishedCountnumberRequired
ratingDistributionobject[]Required
Each array item:
scorenumberRequired

Integer feedback score 1..5.

countnumberRequired
tagPopularityobject[]Required
Each array item:
codestringRequired

Organisation-scoped tag code (wire identifier — content__tag has no external_id column).

labelstringRequired
colorstring | nullRequired
One of 2:
Variant 1
string
Variant 2
null
postCountnumberRequired
authorLeaderboardobject[]Required
Each array item:
externalIdstringRequired

16-char external shop__contact id (wire identifier).

namestringRequired
postCountnumberRequired
viewsPeriodnumberRequired
visibilityBreakdownobject[]Required
Each array item:
visibility"published" | "private" | "draft" | "scheduled" | "archived"Required
countnumberRequired
freshnessobjectRequired
updatedLast30dnumberRequired
staleOver180dnumberRequired
medianAgeDaysnumberRequired

Response example

application/json
{
  "generatedAt": "example_generatedAt",
  "kpis": {
    "totalViews": {
      "value": 0,
      "previousValue": 0
    },
    "publishedPosts": {
      "value": 0,
      "previousValue": 0
    },
    "livePosts": {
      "value": 0
    },
    "avgRating": {
      "value": 0,
      "count": 0
    },
    "newComments": {
      "value": 0,
      "previousValue": 0
    },
    "starPosts": {
      "value": 0
    }
  },
  "viewsOverTime": [
    {
      "bucket": "example_bucket",
      "views": 0,
      "publishedCount": 0,
      "commentCount": 0
    }
  ],
  "topPosts": [
    {
      "externalId": "example_externalId",
      "title": "example_title",
      "viewsPeriod": 0,
      "viewsTotal": 0,
      "ratingCount": 0,
      "commentsCount": 0,
      "isStar": false
    }
  ],
  "trendingPosts": [
    {
      "externalId": "example_externalId",
      "title": "example_title",
      "viewsRecent": 0,
      "viewsPrior": 0
    }
  ],
  "categoryOccupancy": [
    {
      "externalId": "example_externalId",
      "name": "example_name",
      "postCount": 0,
      "avgViewsPerPost": 0
    }
  ],
  "categoryReadership": [
    {
      "name": "example_name",
      "viewsPeriod": 0,
      "share": 0
    }
  ],
  "publicationCadence": [
    {
      "month": "example_month",
      "publishedCount": 0
    }
  ],
  "ratingDistribution": [
    {
      "score": 0,
      "count": 0
    }
  ],
  "tagPopularity": [
    {
      "code": "example_code",
      "label": "example_label",
      "postCount": 0
    }
  ],
  "authorLeaderboard": [
    {
      "externalId": "example_externalId",
      "name": "example_name",
      "postCount": 0,
      "viewsPeriod": 0
    }
  ],
  "visibilityBreakdown": [
    {
      "count": 0
    }
  ],
  "freshness": {
    "updatedLast30d": 0,
    "staleOver180d": 0,
    "medianAgeDays": 0
  }
}

Request example

GET /bff/post/analytics

get
curl -X GET "https://api.bizkithub.com/bff/post/analytics?period=30d&bucket=week" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY"

Need an API key?

All BizKitHub public API endpoints require authentication via API key.

Get API Key