Docs Reference
Analytics
Views, likes, comments and audience figures for connected channels.
Figures come from the results Soontra has already stored. If nothing is stored for the account and period asked for, the tool says so: ask Astrono in Soontra for that account’s analytics once, which loads them, then ask again.
soontra_analytics_getAudience
- Scope
analytics - Read-only
Audience splits for one account ({ account_id?, platform, period? }): age/gender, devices, and countries where available.
| Parameter | Type | Description |
|---|---|---|
account_id | string | 1 to 128 characters |
platformrequired | "youtube" | "instagram" | |
period | "7d" | "28d" | "90d" |
Returns For YouTube, demographics, devices and the top 10 countries in geography; for Instagram, an audience object; both with period and account.
- YouTube and Instagram only.
periodis7d,28dor90d; the default is28d.- The period is cut to the workspace plan's analytics window.
- Served from cached data only: a window that is not cached returns an error asking you to open the Soontra analytics page first.
- When several accounts could match, the answer is
selection_requiredwith up to 20choices; pass oneaccount_idand call again.
soontra_analytics_getBestTimeToPost
- Scope
analytics - Read-only
Historical publishing performance for one account ({ platform, days?, account_id? }). YouTube returns age-normalized day-of-week results; TikTok returns a UTC day-by-hour heatmap.
| Parameter | Type | Description |
|---|---|---|
platformrequired | "youtube" | "tiktok" | |
days | integer | 7 to 365 |
account_id | string | 1 to 128 characters |
Returns For YouTube, historical_publishing by day of week; for TikTok, a heatmap by day and hour in UTC; both with days, post_count and account.
- YouTube and TikTok only.
daysis 7 to 365; the default is 90.- A shorter plan window shortens
daysand adds aplan_note. - Reads stored post data only; it never calls the platform.
soontra_analytics_getBreakdown
- Scope
analytics - Read-only
ONE deep analytics slice for a selected account. youtube/instagram: demographics | devices | geography | traffic_sources | playback_locations | content_types | retention | search_terms | subscriber_split. tiktok: duration | hashtags only. When several accounts are eligible, omit account_id and pass back the one from the returned selection_required choices. Cached data only.
| Parameter | Type | Description |
|---|---|---|
platformrequired | "youtube" | "instagram" | "tiktok" | |
breakdown_typerequired | "demographics" | "devices" | "geography" | "traffic_sources" | "playback_locations" | "content_types" | "retention" | "search_terms" | "subscriber_split" | "duration" | "hashtags" | |
period | "7d" | "28d" | "90d" | |
account_id | string | 1 to 128 characters |
video_id | string | 1 to 64 characters |
Returns The rows of one breakdown, with platform, breakdown_type, period and account.
- YouTube takes every type except
durationandhashtags. - Instagram takes
demographics,geographyandcontent_typesonly. - TikTok takes
durationandhashtagsonly. - On YouTube,
retention,traffic_sources,search_termsandsubscriber_splitneed avideo_id. periodis7d,28dor90d; the default is28d.- Served from cached data only: a window that is not cached returns an error asking you to open the Soontra analytics page first.
soontra_analytics_getOverview
- Scope
analytics - Read-only
Cross-platform headline analytics for one account per platform ({ account_id?, platforms?, period? }). When several accounts could match and account_id is omitted, returns selection_required with safe choices; account_id pins ONE platform, so re-call with platforms narrowed to that account's platform (one call per platform when several platforms are ambiguous). CACHED data only. Render not_connected honestly.
| Parameter | Type | Description |
|---|---|---|
account_id | string | 1 to 128 characters |
platforms | "youtube" | "tiktok" | "instagram"[] | 1 to 3 items |
period | "7d" | "28d" | "90d" |
Returns An overview entry per platform (connection, ok, headline, error) with platforms_queried, connected_count and the accounts used.
- Covers YouTube, TikTok and Instagram; all three when
platformsis omitted. periodis7d,28dor90d.- An
account_idpins one platform only, so narrowplatformsto that platform. - Served from cached data only: a window that is not cached returns an error asking you to open the Soontra analytics page first.
- When several accounts could match, the answer is
selection_requiredwith up to 20choices; pass oneaccount_idand call again.
soontra_analytics_getPostAnalytics
- Scope
analytics - Read-only
Per-platform performance of ONE published post ({ post_id }) from synced snapshots: views/likes/comments per target, permalink, and a state (not_posted | waiting_for_sync | ready | partial | not_connected). Use posts.list to find the post id.
| Parameter | Type | Description |
|---|---|---|
post_idrequired | string (uuid) |
Returns A state (not_posted, waiting_for_sync, ready, partial or not_connected) and, per platform, the post's views, likes, comments and permalink.
- Takes a Soontra
post_id, asposts.listreturns it. - Reads synced snapshots only; it never calls the platform.
soontra_analytics_getTopContent
- Scope
analytics - Read-only
Top-performing real content for one account ({ account_id?, platform, ... }). When more than one account is connected on that platform, omit account_id and pass back the one from the returned selection_required choices.
| Parameter | Type | Description |
|---|---|---|
account_id | string | 1 to 128 characters |
platformrequired | "youtube" | "instagram" | |
period | "7d" | "28d" | "90d" | |
limit | integer | 1 to 50 |
sort_by | "views" | "engagement" |
Returns For YouTube, the top videos; for Instagram, the top media and a summary; both with period and account.
- YouTube and Instagram only.
limitdefaults to 10, maximum 50; Instagram allows at most 18.sort_byisviews(the default) orengagement.periodis7d,28dor90d; the default is28d.- The period is cut to the workspace plan's analytics window.
- Served from cached data only: a window that is not cached returns an error asking you to open the Soontra analytics page first.
soontra_analytics_query
- Scope
analytics - Read-only
One custom analytics question ({ platform, account_id?, scope, metrics, window, granularity, breakdown?, filter?, sort?, limit? }): a post or the account over a date range, by day/week/month, by country or device, or the top posts by a metric. scope is { kind: 'account' } | { kind: 'posts', refs: [post links or ids] } | { kind: 'top', n, by }; window is { kind: 'lifetime' } | { kind: 'preset', preset: 'last_7d'|'last_28d'|'last_30d'|'last_90d'|'this_month'|'last_month' } | { kind: 'range', start, end } (YYYY-MM-DD). Metric keys (not every key answers every scope or window; a refusal says which do) - youtube: views, likes, comments, shares, watch_time_minutes, avg_view_duration_seconds, subscribers_gained, subscribers_lost, viewer_percentage, followers, posts_count, lifetime_views, title, published_at, duration_seconds, format; instagram: views, likes, comments, saves, shares, replies, total_interactions, reach, avg_watch_time_seconds, accounts_engaged, followers, posts_count, net_followers, title, published_at, duration_seconds, format; tiktok: views, likes, comments, shares, followers, posts_count, net_followers, lifetime_views, title, published_at, duration_seconds. YouTube: viewer_percentage needs breakdown age_gender; filter is country==US. Every answer carries provenance (source, asOf, the dates covered, notes). CACHED and stored data only: YouTube date ranges answer only when the question was already asked in Soontra, else reason window_not_cached. answerable false comes with a reason, a message and often closest (a question that can be answered); render it honestly.
| Parameter | Type | Description |
|---|---|---|
account_id | string | The account to read. Omit when the platform has one connected account.1 to 128 characters |
platformrequired | "youtube" | "instagram" | "tiktok" | |
scoperequired | object | account: the whole account. posts: refs are post links, platform post ids or Soontra post ids. top: the n best posts ranked by the metric key 'by'. |
scope.kindrequired | "account" | |
metricsrequired | string[] | Metric keys from the platform's capability catalog.1 to 8 items |
windowrequired | object | lifetime; a preset; or a range with start and end as YYYY-MM-DD, both included. |
window.kindrequired | "lifetime" | |
granularityrequired | "total" | "day" | "week" | "month" | total, or one row per day, week or month of a range. |
breakdown | string | One row per value of a breakdown from the capability catalog (country, device_type, traffic_source, age_gender...).1 to 64 characters |
filter | string | YouTube only: country==US.1 to 200 characters |
sort | object | |
sort.metricrequired | string | 1 to 64 characters |
sort.directionrequired | "asc" | "desc" | |
limit | integer | 1 to 50 |
Returns An answer with answerable, the rows asked for and their provenance; when answerable is false, a reason, a message and often a closest question that can be answered.
- YouTube, Instagram and TikTok.
- 1 to 8
metricsa call;limitis 1 to 50. - A
postsscope takes up to 250refs; atopscope takesnfrom 1 to 50. - Range dates are
YYYY-MM-DD, both included. - Served from cached and stored data only; it never calls the platform.