Skip to main content
All Analytics endpoints require a valid Bearer token.

Endpoints covered on this page

MethodPathDescription
GET/api/analytics/overviewSummary stats, follower counts, and platform performance
GET/api/analytics/growthFollower growth over time
GET/api/analytics/posts/topTop-performing posts ranked by engagement
GET/api/analytics/heatmapEngagement heatmap by day and hour

Common query parameters

All four endpoints accept the following parameter:
period
string
default:"30d"
Time window for aggregation. Accepted values: 7d (last 7 days) or 30d (last 30 days, default).

GET /api/analytics/overview

Returns aggregated stats, latest follower counts, and per-platform performance for the selected period.

Response

data
object
required

GET /api/analytics/growth

Returns follower growth data points over the selected period, optionally filtered to a single platform.

Additional query parameters

platform
string
Filter results to a single platform. Accepted values: bluesky, threads, instagram, facebook, mastodon, tumblr. Omit to return data for all connected platforms.

Response

data
object[]
required
Array of growth data points, each representing a point in time with follower counts.

GET /api/analytics/posts/top

Returns the top-performing posts for the selected period ranked by engagement.

Additional query parameters

limit
number
default:"5"
Maximum number of posts to return.
sortBy
string
default:"totalEngagement"
Metric to rank posts by. Default is totalEngagement.
platform
string
Filter to posts published on a specific platform.

Response

data
object[]
required
Array of top post objects with engagement metrics.

GET /api/analytics/heatmap

Returns a heatmap of engagement activity, grouped by day of week and hour of day over the selected period.

Response

data
object[]
required
Array of heatmap data points representing engagement intensity across time slots.

Examples

curl --request GET \
  --url 'https://api.hayon.app/api/analytics/overview' \
  --header 'Authorization: Bearer <token>'

Example response — overview

200
{
  "success": true,
  "message": "Overview fetched successfully",
  "data": {
    "stats": {
      "bestPlatform": "bluesky"
    },
    "followers": {
      "total": 4320,
      "breakdown": {
        "bluesky": 1850,
        "threads": 1200,
        "mastodon": 1270
      }
    },
    "platformPerformance": [
      { "_id": "bluesky" },
      { "_id": "threads" }
    ],
    "period": {
      "start": "2024-08-02T10:00:00.000Z",
      "end": "2024-09-01T10:00:00.000Z"
    }
  }
}

Build docs developers (and LLMs) love