---
title: "Per-channel trend data"
method: GET
path: "/analytics/trends"
tags: ["Stats & Analytics"]
---

# Per-channel trend data

`GET /analytics/trends`

## Request

- Base URL: `https://api.misar.io/post`
- URL: `https://api.misar.io/post/analytics/trends`
- Auth: API key in header `Authorization`

One trend card per active connected account: daily publish/failure counts (real for every platform) plus daily engagement/impressions (real once MisarPost's metrics-sync cron has fetched them for that platform — currently Twitter/X, LinkedIn, Instagram, Threads, TikTok Business, Reddit, Mastodon, Bluesky, YouTube, Pinterest, Facebook; other platforms report zero and each channel's `metric` field says whether its headline series is `"engagement"` or falls back to `"posts"`).

## Query parameters

- `days` 7 | 30 | 90

## Response `200`

Trend data.

- AnalyticsTrendsResponse
  - `range` DateRange, required
    - `days` integer
    - `from` string, date-time
    - `to` string, date-time
  - `channels` object[], required
    - `accountId` string, uuid
    - `platform` string
    - `displayName` string, nullable
    - `avatarUrl` string, nullable
    - `metric` 'engagement' | 'posts': Which series this channel actually has non-zero real data for.
    - `series` DayBucket[]
      - `date` string, date
      - `posts` integer
      - `failed` integer
      - `engagement` integer
      - `impressions` integer
    - `totals` object
      - `posts` integer
      - `failed` integer
      - `engagement` integer
      - `impressions` integer
    - `percentChange` number, nullable: vs. the equal-length prior period.

## Other responses

- `401`: Missing, malformed, revoked, or invalid API key/session.
- `402`: Plan limit: no active plan (any write; `reason: "no_active_plan"`), a monthly allowance is spent, or the feature is not on the caller's plan. Detect by `code: "plan_limit_exceeded"`.
- `403`: The API key lacks the scope this operation requires (`code: "insufficient_scope"`, `required_scope`).

---

[API](https://skmtc.dev/misarpost/apis/misarpost-api.md) · [All operations](https://skmtc.dev/misarpost/apis/misarpost-api/llms.txt) · [OpenAPI document](https://skmtc.dev/misarpost/apis/misarpost-api/revisions/deec26db1305?raw)
