Top-line workspace report
For a “how is the brand doing this month?” summary, hit the workspace analytics endpoint with a timeframe:prev_month on the first of each month to close out the previous month.
This is the natural target for “monthly brand report” automation: run it on the 1st, store the JSON in your warehouse or BI tool, and you have a longitudinal record without any custom aggregation.
Per-profile breakdown
When you want to compare profiles or drill into one network:posts, the profile’s published posts for the period with their own metrics and post_url, sorted here by engagement rate, highest first. sort takes published_at, likes, comments, shares, engagement, engagement_rate, or reach, with a leading - for descending; leave it out for newest first. Page through them with page.
To compare all profiles in parallel, list them first then fan out:
Time series for charts
For a line chart of follower growth or engagement over time, use profile metrics:graphs.followers, graphs.post_engagement, graphs.post_reach, and the other series are arrays of { "date", "value" } points at daily granularity. Feed them directly into Chart.js, Recharts, or Plotly, or upsert them into a profile_metrics_daily table keyed by profile and date. The top-level KPIs come with _compare fields (percentage change against the previous period), handy for “up 12% vs last month” tiles.
Find the best times to post
The best-times heatmap is computed from your own publishing history. It ranks the hours you have actually posted in, not a generic industry average.- Schedule recommendation UI: overlay the heatmap onto a calendar picker and bias users toward high-score slots.
- Queue timeslot suggestions: pre-fill a profile’s recurring queue with the top N timeslots from the heatmap.
- Audience timezone sanity checks: see whether your highest-scoring hours line up with your assumed audience timezone.
best_time_to_post: 168 { week_day, hour, score } entries, one for every hour of the week. They’re ordered by week_day (0 is Sunday) and then hour, not by score. score uses the same 0 to 5 scale as the heatmap. Sort by it if you only need the top slots.
Hashtag insights
Two endpoints surface the hashtags that drove engagement:name with aggregate engagement and reach for the posts that used it in the period, ordered by popularity. Useful for a “top hashtags” leaderboard or for spotting under-used high performers.
Pattern: nightly export to a warehouse
A common production setup is a nightly job that pulls the latest metrics into BigQuery, Snowflake, or Postgres for BI. Because the endpoints work in timeframes rather than arbitrary date ranges, pull a window that comfortably covers the sync lag (last_7_days) and upsert by date:
Watch out for
Plan requirements
Plan requirements
Analytics endpoints return
402 when the workspace owner is on Free, and best times returns 402 unless the owner is on Business. Handle that status explicitly so an agency script does not treat it as an outage. On Pro, also expect empty demographic graphs and an empty best_time_to_post in profile metrics.Disconnected profiles
Disconnected profiles
Analytics for a profile whose connection has expired go stale until reconnection. The endpoint still responds with the most recent data PublishBuddy has on file, but no fresh sync happens until the user reconnects in the dashboard. Check the profile’s
connected and synchronization_status fields.