Skip to content

feat(threads): implement account-level insights - #151

Closed
murtaja1 wants to merge 1 commit into
brightbeanxyz:mainfrom
Murtaja-Adnan:upstream/threads-account-insights
Closed

feat(threads): implement account-level insights#151
murtaja1 wants to merge 1 commit into
brightbeanxyz:mainfrom
Murtaja-Adnan:upstream/threads-account-insights

Conversation

@murtaja1

Copy link
Copy Markdown

get_account_metrics had no override for Threads, so every Threads account skipped account-level analytics entirely -- it raised NotImplementedError, leaving the account with no follower/views history at all. Noticed in production while auditing which providers actually populate account-level analytics.

Fix: add it against me/threads_insights with metric=views,followers_count. views is a daily time-series metric (Threads returns it under values[]) and followers_count is a lifetime total (returned under total_value.value) -- the same two response shapes parse_insights_response already handles for the other Meta-backed providers, reused here rather than re-implemented. A day with no view activity simply omits the views entry, which maps to 0 rather than being dropped.

Tested: new unit tests in tests/providers/test_threads.py covering the request shape, the two response shapes (time-series views + lifetime followers_count), and a day with no views activity. Full test_threads.py passes.

get_account_metrics had no override, so every Threads account skipped
account-level analytics entirely (NotImplementedError).

Add it against me/threads_insights with metric=views,followers_count:
views is a daily time-series metric (Threads returns it under
values[]) and followers_count is a lifetime total (returned under
total_value.value) — the same two shapes parse_insights_response
already handles for the other Meta-backed providers, reused here
rather than re-implemented. A day with no view activity simply omits
the views entry, which maps to 0 rather than being dropped.
@murtaja1
murtaja1 requested a review from JanSchm as a code owner August 13, 2026 10:53
@Murtaja-Adnan Murtaja-Adnan closed this by deleting the head repository Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants