Docs

Analytics

Account stats, creator media, and per-post metrics for TikTok.

TikTok analytics has three surfaces. Account level stats, the creator recent public videos and per-post metrics. Pass post as described in Analytics. Use the internal id for Onepostly posts. Use the native video id plus accountId for outside videos.

Account stats

Live follower, following, likes and video counts for a connected account.

const stats = await connections.getConnectionStats({ id: accountId });
// stats.stats.followerCount, followingCount, likesCount, videoCount
FieldMeaning
followerCountFollowers of the creator
followingCountAccounts the creator follows
likesCountTotal likes received across all content
videoCountNumber of the creator videos

Creator media

Paginated list of the creator public videos with per-video metrics. Private posts do not appear, and photo posts are not returned by the TikTok video list.

ParameterTypeRequiredDefaultDescription
limitinteger 1-20No10Page size
cursorstringNoNoPagination cursor from the previous response nextCursor
const page = await connections.listConnectionMedia({ id: accountId, limit: 10 });
// page.items[].id, title, coverUrl, shareUrl, createdAt, durationSec, metrics
// page.nextCursor for the next page

Each item includes id, title, description, coverUrl, shareUrl, createdAt, durationSec and metrics with likes, comments, shares and views. nextCursor with value null means no more pages.

Post analytics

Same surface as other platforms.

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

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

const { analytics } = await analyticsApi.getAnalytics({ post: postId });

Daily timeline

Day by day cumulative metrics per subject. Optional from and to bound the inclusive UTC date range. The default window covers the last 366 days.

const { timeline } = await analyticsApi.getAnalyticsTimeline({
  post: postId,
  from: "2026-08-01",
  to: "2026-08-28",
});
// timeline.subjects[].points[].day, metrics, delta

Each metrics object holds cumulative totals as captured on that UTC day. delta compares them against the previous stored day. A delta entry stays null when either side has no value. Days without a stored snapshot have no data. The API does not backfill them.

Outside posts

Videos published outside Onepostly work the same way once they are synced. Sync by URL or native video id then read analytics with that id plus accountId. Omit url and postId to refresh the recent posts of the account in bulk.

const { found, post } = await posts.syncExternal({
  syncExternalBody: { accountId, url: "https://www.tiktok.com/@you/video/7234567890123456789" },
});
if (!found || !post) throw new Error("Post not found on the account.");

const { analytics } = await analyticsApi.getAnalytics({
  post: post.externalPostId,
  accountId,
});

Normalized fields

FieldMeaning on TikTok
plays and impressionsVideo views. Same value, both exposed for cross-platform consistency
likesLike count
commentsComment count
sharesShare count
engagementLikes plus comments plus shares
reachAlways null. TikTok does not expose reach
savesAlways null. TikTok does not expose saves

Pending semantics

Errors

CodeCauseFix
NOT_PUBLISHEDDestination not published yetWait for publish
ANALYTICS_PENDINGMetrics not ready yetRetry later
VIDEO_NOT_FOUNDTikTok has not produced metrics for the video yetRetry later
ANALYTICS_FAILEDHard failure fetching metricsRetry. Contact support if it persists

See also