Skip to content

feat: read an account's per-network metric set - #26

Merged
alihesari merged 1 commit into
mainfrom
feature/platform-metric-sets
Sep 21, 2026
Merged

alihesari merged 1 commit into
mainfrom
feature/platform-metric-sets

Conversation

@alihesari

Copy link
Copy Markdown
Member

Reads the metric set only an account's own network reports, in the platform's own vocabulary rather than the cross-network one: ad-break earnings on a monetised Facebook Page, how viewers left an Instagram story, a YouTube retention curve and daily views, LinkedIn reactions split by type, the search terms behind a Google Business listing.

Answers from the newest collected snapshot rather than a live call to the network. Each row carries the platform's own key (stable — match on this), a label (ours, and subject to rewording), a kind of count, duration_ms, currency_usd, ratio or series, and the value. A series value is an array of points where every other kind is a number, so the value keeps its raw form and a helper decodes the common numeric case.

Needs the analytics scope. A network whose metric access has been requested but not granted answers 503 platform_metrics_unavailable rather than an empty set, so a pending grant never reads as a zero.

Tests cover the request path and query, the parsed set, a series value surviving intact, and the 503.

Depends on the API change in fopost/fopost#1002.

accounts.platform_metrics answers in the platform's own vocabulary rather than
the cross-network one: ad-break earnings, story taps, a retention curve, the
search terms behind a listing. Needs the analytics scope, and a network whose
access is still pending answers 503 platform_metrics_unavailable.
@alihesari
alihesari merged commit 491d5ab into main Sep 21, 2026
4 checks passed
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.

1 participant