Skip to content

Returns the space counters for a date range — spaces, posts, comments and members — optionally narrowed to one space.

Pass space_id to scope posts, comments and members to a single space; the space total ignores it and always counts community-wide. Status filtering is inconsistent between the two modes: the site-wide post count includes drafts while the per-space count does not.

Endpoint

  • Method: GET

  • Path: /analytics/spaces/widget

  • Edition: PRO

  • Controller: SpacesReportsController@widget

  • Route source: fluent-community-pro/app/Http/Routes/api.php:85

  • Controller source: fluent-community-pro/app/Http/Controllers/SpacesReportsController.php

  • Requires the FluentCommunity community-admin permission (or a WordPress super admin).

  • Requires FluentCommunity Pro.

  • The period-over-period comparison on all four counters is unreliable here, because each previous-period query is built on top of the current-period one; treat only total_records as meaningful.

Live sample

The request and response below were recorded against a running FluentCommunity install and then anonymised — member names, emails, avatars and post content are fictional, and long collections are trimmed to a few entries.

GET Get Space Widget Report

GET
/analytics/spaces/widget

Returns the space counters for a date range — spaces, posts, comments and members — optionally narrowed to one space.

Controller: SpacesReportsController@widget
Route source: fluent-community-pro/app/Http/Routes/api.php:85

Authorizations

ApplicationPasswords

WordPress Application Passwords — use Basic auth with username:application_password.

Type
API Key (header: Authorization)

Parameters

Query Parameters

space_id

Space ID read via $request->getSafe() in widget().

Type
string
Default
"null"

Responses

Successful response

application/json
JSON
{
  
"data": {
  
  
"total_comments": {
  
  
  
"comparison": "string",
  
  
  
"title": "string",
  
  
  
"total_records": 0
  
  
},
  
  
"total_members": {
  
  
  
"comparison": "string",
  
  
  
"title": "string",
  
  
  
"total_records": 0
  
  
},
  
  
"total_posts": {
  
  
  
"comparison": "string",
  
  
  
"title": "string",
  
  
  
"total_records": 0
  
  
},
  
  
"total_spaces": {
  
  
  
"comparison": "string",
  
  
  
"title": "string",
  
  
  
"total_records": 0
  
  
}
  
}
}

Playground

Authorization
Variables
Key
Value

Samples

Powered by VitePress OpenAPI

FluentCommunity developer documentation