---
title: "Get analytics"
method: GET
path: "/analytics"
tags: ["Analytics"]
---

# Get analytics

`GET /analytics`

## Request

- Base URL: `https://www.postbase.so/api/v1`
- URL: `https://www.postbase.so/api/v1/analytics`
- Auth: HTTP bearer

Published posts in a date range with each channel's latest metrics, plus totals for the whole range.

## Query parameters

- `from` string, date
- `to` string, date
- `post_id` string, uuid
- `channel_id` string, uuid
- `platform` string
- `sort` 'date' | 'impressions' | 'likes' | 'comments' | 'shares' | 'saves' | 'engagement'
- `order` 'desc' | 'asc'
- `limit` integer
- `offset` integer

## Response `200`

Posts and totals

- object
  - `from` string, date, nullable
  - `to` string, date, nullable
  - `totals` object
    - `impressions` number, nullable
    - `likes` number
    - `comments` number
    - `shares` number
    - `saves` number
    - `engagement` number: likes + comments + shares + saves
    - `posts` integer
  - `posts` AnalyticsPost[]
    - `post_id` string, uuid
    - `body` string
    - `published_at` string, date-time
    - `channels` object[]
      - `channel_id` string
      - `platform` string, nullable
      - `handle` string, nullable
      - `url` string, uri, nullable
      - `metrics` object
      - `metrics_updated_at` string, date-time, nullable
    - `totals` Metrics
      - `impressions` number, nullable
      - `likes` number
      - `comments` number
      - `shares` number
      - `saves` number
      - `engagement` number: likes + comments + shares + saves
  - `has_more` boolean

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid API key
- `429`: Rate limited

---

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