Skip to main content

StatsResponse

Response containing aggregated statistics for an account or alert.
account_id
string
ID of the account these stats belong to
alert_id
string
ID of the alert these stats belong to (if filtered by alert)
period
string
Time period grouping: hour, day, week, or month
from_date
string
Start date for the statistics range (ISO 8601 or YYYY-MM-DD)
to_date
string
End date for the statistics range (ISO 8601 or YYYY-MM-DD)
data
array
default:"[]"
List of StatsData objects for each period
total_mentions
integer
default:"0"
Total mentions across all periods
total_reach
integer
default:"0"
Total reach across all periods
sentiment_distribution
object
default:"{}"
Sentiment breakdown with counts for positive, negative, and neutral
sources_distribution
object
default:"{}"
Source breakdown with mention counts per source

StatsPeriod Enum

Available time periods for grouping statistics:
  • hour - Group by hour
  • day - Group by day
  • week - Group by week
  • month - Group by month

Example

{
  "account_id": "acc_1234567890",
  "alert_id": "alert_1234567890",
  "period": "day",
  "from_date": "2026-03-01",
  "to_date": "2026-03-04",
  "data": [
    {
      "period": "2026-03-01",
      "mentions_count": 45,
      "reach": 125000,
      "sentiment_positive": 32,
      "sentiment_negative": 5,
      "sentiment_neutral": 8,
      "sources": [
        {
          "source": "twitter",
          "mentions_count": 28,
          "reach": 85000,
          "sentiment_positive": 20,
          "sentiment_negative": 3,
          "sentiment_neutral": 5
        },
        {
          "source": "news",
          "mentions_count": 17,
          "reach": 40000,
          "sentiment_positive": 12,
          "sentiment_negative": 2,
          "sentiment_neutral": 3
        }
      ]
    },
    {
      "period": "2026-03-02",
      "mentions_count": 38,
      "reach": 98000,
      "sentiment_positive": 25,
      "sentiment_negative": 7,
      "sentiment_neutral": 6,
      "sources": [
        {
          "source": "twitter",
          "mentions_count": 22,
          "reach": 62000,
          "sentiment_positive": 15,
          "sentiment_negative": 4,
          "sentiment_neutral": 3
        }
      ]
    }
  ],
  "total_mentions": 147,
  "total_reach": 485000,
  "sentiment_distribution": {
    "positive": 98,
    "negative": 22,
    "neutral": 27
  },
  "sources_distribution": {
    "twitter": 89,
    "news": 35,
    "blog": 23
  }
}

Request Models

StatsRequest

Used when requesting statistics data.
from_date
string
Start date for the statistics range (ISO 8601 or YYYY-MM-DD)
to_date
string
End date for the statistics range (ISO 8601 or YYYY-MM-DD)
period
string
default:"day"
Time period grouping: hour, day, week, or month
group_by
string
Optional field to group by (e.g., “source”, “sentiment”)

Build docs developers (and LLMs) love