Analytics

TikTok per-post metrics, account stats, and the creator's public video list.

Read views, likes, comments, and shares for public TikTok posts, plus follower counts and the creator's recent public videos. Per-post metrics need the video.list permission and account stats need user.info.stats; both are requested when you connect.

Metrics

FieldTikTok metricNotes
impressionsview_countSame value as plays
reachNoneAlways null
playsview_countTotal views
likeslike_countTotal likes
commentscomment_countTotal comments
sharesshare_countTotal shares
savesNoneAlways null
engagementNoneSum of likes, comments, and shares

Read Post Analytics

Pass the Onepostly post id as post. For a TikTok post published outside Onepostly, pass its TikTok post id with accountId (Targeting Posts, Outside Posts).

import { Configuration, AnalyticsApi } from "@onepostly/sdk";

const analyticsApi = new AnalyticsApi(
  new Configuration({ apiKey: process.env.ONEPOSTLY_API_KEY })
);

const response = await analyticsApi.getAnalytics({
  post: "7412345678901234567",
  accountId: "YOUR_TIKTOK_ACCOUNT_ID",
  metrics: "views,reach,profile_views",
  period: "day",
});
console.log(response);
{
  "analytics": {
    "post": "1699f415-7fb6-43f4-9d2a-c447491f32a8",
    "status": "ready",
    "fetchedAt": "2026-08-25T10:00:00.000Z",
    "subjects": [
      {
        "scope": "destination",
        "subjectId": "d4e5f6a7-8b9c-4d0e-8f1a-2b3c4d5e6f7a",
        "accountId": "a1b2c3d4-e5f6-4a7b-8c9d-e0f1a2b3c4d5",
        "platform": "tiktok",
        "externalPostId": "17895695668004550",
        "status": "ready",
        "metrics": {
          "impressions": 1234,
          "reach": null,
          "likes": 123,
          "comments": 12,
          "shares": 4,
          "saves": null,
          "plays": 456,
          "engagement": 0.14
        },
        "fetchedAt": "2026-08-25T10:00:00.000Z",
        "expiresAt": "2026-09-01T10:00:00.000Z",
        "error": null,
        "externalUrl": "https://www.tiktok.com/@you/video/17895695668004550"
      }
    ]
  }
}

Only posts published with privacyLevel: "PUBLIC_TO_EVERYONE" have metrics. For day-by-day values, see Daily Timeline.

Account Stats

Read the account's current follower, following, like, and video counts:

import { Configuration, ConnectionsApi } from "@onepostly/sdk";

const connectionsApi = new ConnectionsApi(
  new Configuration({ apiKey: process.env.ONEPOSTLY_API_KEY })
);

const response = await connectionsApi.getConnectionStats({
  id: "YOUR_TIKTOK_ACCOUNT_ID",
  include: "messenger-profile,reviews",
  limit: 20,
});
console.log(response);
{
  "accountId": "a1b2c3d4-e5f6-4a7b-8c9d-e0f1a2b3c4d5",
  "platform": "tiktok",
  "status": "ready",
  "stats": {
    "followerCount": 1234,
    "followingCount": 56,
    "likesCount": 7890,
    "videoCount": 12
  },
  "fetchedAt": "2026-08-25T10:00:00.000Z"
}
FieldMeaning
followerCountAccounts following the creator
followingCountAccounts the creator follows
likesCountLikes received across all of the creator's posts
videoCountNumber of videos on the profile

Creator Videos

List the creator's public videos with their metrics, newest first, whether or not they were published through Onepostly. Pass limit (1 to 20, default 10) and, for the next page, the nextCursor value from the previous response as cursor. nextCursor is null on the last page.

import { Configuration, ConnectionsApi } from "@onepostly/sdk";

const connectionsApi = new ConnectionsApi(
  new Configuration({ apiKey: process.env.ONEPOSTLY_API_KEY })
);

const response = await connectionsApi.listConnectionMedia({
  id: "YOUR_TIKTOK_ACCOUNT_ID",
  limit: 20,
  kind: "media",
  audioType: "music",
});
console.log(response);
{
  "accountId": "a1b2c3d4-e5f6-4a7b-8c9d-e0f1a2b3c4d5",
  "platform": "tiktok",
  "items": [
    {
      "id": "7412345678901234567",
      "title": "My trip",
      "description": "Weekend recap #travel",
      "coverUrl": "https://cdn.onepostly.com/media/cover.jpg",
      "shareUrl": "https://www.tiktok.com/@you/video/7412345678901234567",
      "createdAt": "2026-08-20T10:00:00.000Z",
      "durationSec": 42,
      "metrics": {
        "likes": 123,
        "comments": 12,
        "shares": 4,
        "views": 4567
      }
    }
  ],
  "nextCursor": "20"
}

Each item has id (the TikTok post id), title, description, coverUrl, shareUrl, createdAt, durationSec, and metrics with views, likes, comments, and shares.

Analytics Status

The generic statuses are described in Analytics Status. On TikTok:

Errors

CodeCauseFix
NOT_PUBLISHEDThe destination has not published successfullyWait until the destination is published. Failed destinations have no analytics
VIDEO_ID_PENDINGTikTok has not made the post public yetRead again later
VIDEO_NOT_FOUNDTikTok has not returned metrics for this post yetRead again later
PRIVACY_RESTRICTEDThe post is not visible to everyonePublish with PUBLIC_TO_EVERYONE to get metrics
ANALYTICS_FAILEDTikTok returned an error for the metrics requestRead again later. Contact support if it continues
PERMISSION_DENIEDThe connection is missing video.list (post metrics, creator videos) or user.info.stats (account stats)Reconnect the account and approve every permission
STATS_FAILEDTikTok returned an error for the account stats requestSend the request again later
LIST_FAILEDTikTok returned an error for the video list requestSend the request again later