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
| Field | TikTok metric | Notes |
|---|---|---|
impressions | view_count | Same value as plays |
reach | None | Always null |
plays | view_count | Total views |
likes | like_count | Total likes |
comments | comment_count | Total comments |
shares | share_count | Total shares |
saves | None | Always null |
engagement | None | Sum 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"
}| Field | Meaning |
|---|---|
followerCount | Accounts following the creator |
followingCount | Accounts the creator follows |
likesCount | Likes received across all of the creator's posts |
videoCount | Number 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
| Code | Cause | Fix |
|---|---|---|
NOT_PUBLISHED | The destination has not published successfully | Wait until the destination is published. Failed destinations have no analytics |
VIDEO_ID_PENDING | TikTok has not made the post public yet | Read again later |
VIDEO_NOT_FOUND | TikTok has not returned metrics for this post yet | Read again later |
PRIVACY_RESTRICTED | The post is not visible to everyone | Publish with PUBLIC_TO_EVERYONE to get metrics |
ANALYTICS_FAILED | TikTok returned an error for the metrics request | Read again later. Contact support if it continues |
PERMISSION_DENIED | The connection is missing video.list (post metrics, creator videos) or user.info.stats (account stats) | Reconnect the account and approve every permission |
STATS_FAILED | TikTok returned an error for the account stats request | Send the request again later |
LIST_FAILED | TikTok returned an error for the video list request | Send the request again later |