Skip to content
DocsReference

Analytics

Track post performance and account growth across all connected platforms. Metrics are collected per post and aggregated into overviews with date-range filtering.

Authentication & scopes

Every analytics endpoint requires an API key (Bearer lp_live_…) or a logged-in session. Two API-key scopes apply:

  • analytics:readreads every analytics endpoint below.
  • analytics:exportrequired only for the CSV export endpoint.

Common query parameters

Most read endpoints accept these filters. Dates are ISO-8601; ranges are clamped to your plan's retention window.

FieldTypeDescription
profileIdstringProfile to scope the data to.
startDateISO dateStart of the range (defaults to plan retention).
endDateISO dateEnd of the range (defaults to now).
granularityhour|day|week|monthBucket size for the time series (default day).
platformstringNarrow results to a single platform.

Overview

GET /v1/analytics/overview

Returns totals, per-platform breakdown, top 5 posts by engagement, and a daily time-series. Default range is last 30 days.

curl "https://api.letspost.it/v1/analytics/overview?profileId=prof_abc&startDate=2026-04-01&endDate=2026-04-30" \
  -H "Authorization: Bearer $LETSPOST_KEY"

Response shape

JSON
{
  "period": { "start": "2026-04-01", "end": "2026-04-30" },
  "totalPosts": 42,
  "totalViews": 128400,
  "totalLikes": 3200,
  "totalComments": 410,
  "totalShares": 890,
  "avgEngagementRate": 3.51,
  "byPlatform": {
    "youtube":   { "posts": 15, "views": 80000, ... },
    "instagram": { "posts": 14, "views": 35000, ... },
    "tiktok":    { "posts": 13, "views": 13400, ... }
  },
  "topPosts": [ ... ],
  "dailyTrend": [
    { "date": "2026-04-01", "views": 4200, "likes": 120, ... },
    ...
  ]
}

Per-post metrics

GET /v1/analytics/posts/{postId}

Returns an array of metric snapshots — one per platform the post was published to.

curl https://api.letspost.it/v1/analytics/posts/pst_123 \
  -H "Authorization: Bearer $LETSPOST_KEY"

Fields per entry

FieldTypeDescription
viewsnumberTotal video views.
likesnumberLikes / hearts / thumbs-up.
commentsnumberComment count.
sharesnumberShares / reposts / stitches.
savesnumberBookmarks / saves (Instagram, TikTok).
impressionsnumberHow many feeds the post appeared in.
reachnumberUnique accounts reached.
engagementRatenumber(likes+comments+shares) / impressions × 100.

Per-post history

GET /v1/analytics/posts/{postId}/history

Time series of metric snapshots for one post, per platform — chart growth after publish.

curl https://api.letspost.it/v1/analytics/posts/pst_123/history \
  -H "Authorization: Bearer $LETSPOST_KEY"

Batch post summary

GET /v1/analytics/posts-summary

Aggregated engagement for up to 100 posts at once. Pass postIds as a comma-separated list; posts without synced metrics are omitted.

curl "https://api.letspost.it/v1/analytics/posts-summary?postIds=pst_1,pst_2,pst_3" \
  -H "Authorization: Bearer $LETSPOST_KEY"

Account metrics

GET /v1/analytics/accounts

Follower counts and totals for every connected account. Useful for tracking audience growth over time.

curl https://api.letspost.it/v1/analytics/accounts \
  -H "Authorization: Bearer $LETSPOST_KEY"

Per-account history

GET /v1/analytics/accounts/{accountId}/history

Time series of follower / following / total-post counts for one connected account.

curl "https://api.letspost.it/v1/analytics/accounts/acc_123/history?startDate=2026-04-01" \
  -H "Authorization: Bearer $LETSPOST_KEY"

Account insights

GET /v1/analytics/account-insights

Latest platform-reported insights (views, engagements) summed across the profile's accounts — organic numbers that don't need a LetsPost-published post.

curl "https://api.letspost.it/v1/analytics/account-insights?profileId=prof_abc&platform=instagram" \
  -H "Authorization: Bearer $LETSPOST_KEY"

Best times to post

GET /v1/analytics/best-times

A 7×24 engagement heatmap plus ranked best/worst slots, derived from your historical performance.

curl "https://api.letspost.it/v1/analytics/best-times?platform=tiktok" \
  -H "Authorization: Bearer $LETSPOST_KEY"

Top performers

GET /v1/analytics/outliers

Posts whose reach is a statistical outlier above the account's own baseline. profileId is required.

curl "https://api.letspost.it/v1/analytics/outliers?profileId=prof_abc" \
  -H "Authorization: Bearer $LETSPOST_KEY"

Compare periods

GET /v1/analytics/compare

Period-over-period diff. All four bounds (periodAStart, periodAEnd, periodBStart, periodBEnd) are required.

curl "https://api.letspost.it/v1/analytics/compare?profileId=prof_abc\
&periodAStart=2026-03-01&periodAEnd=2026-03-31\
&periodBStart=2026-04-01&periodBEnd=2026-04-30" \
  -H "Authorization: Bearer $LETSPOST_KEY"

Export CSV

GET /v1/analytics/export

Download a CSV. type is one of overview, accounts, or best-times. Requires the analytics:export scope.

curl "https://api.letspost.it/v1/analytics/export?type=overview&format=csv&profileId=prof_abc&startDate=2026-04-01" \
  -H "Authorization: Bearer $LETSPOST_KEY" -o analytics.csv

Refresh now

POST /v1/analytics/refresh

Force an on-demand metrics sync from the connected platforms. Rate-limited to once per minute per user.

curl -X POST https://api.letspost.it/v1/analytics/refresh \
  -H "Authorization: Bearer $LETSPOST_KEY"
Was this page helpful?

Something unclear? Email us — we read every message.