Skip to main content
This endpoint requires a valid Bearer token.

Endpoint

GET /api/analytics/platforms
Returns aggregated engagement metrics broken down by connected platform for the selected period.

Query parameters

period
string
default:"30d"
Time window for aggregation. Accepted values: 7d (last 7 days) or 30d (last 30 days, default).

Response

success
boolean
required
true on success.
message
string
required
"Platform performance fetched"
data
object[]
required
Array of per-platform performance objects. Each entry aggregates metrics for posts published to that platform during the selected period.

Example

curl --request GET \
  --url 'https://api.hayon.app/api/analytics/platforms?period=30d' \
  --header 'Authorization: Bearer <token>'

Example response

200
{
  "success": true,
  "message": "Platform performance fetched",
  "data": [
    { "_id": "bluesky" },
    { "_id": "threads" },
    { "_id": "mastodon" }
  ]
}
Platforms with no posts published during the selected period are omitted from the response array.

Build docs developers (and LLMs) love