Charts

The Analytics section provide access to social media analytics data for connected accounts in your workspace. These endpoints allow you to retrieve available charts and their corresponding data for various social media platforms.

The Charts endpoints let you:

  • Discover which analytics charts are available (and their IDs).

  • Fetch time‑series and comparative data for selected charts.

Use the returned id values from “List Charts” with “Get Chart Data” to build dashboards and reports.

Requirements

Authentication: Bearer API token Scope: analytics Headers:

  • Authorization: Bearer-API YOUR_API_KEY

  • Publer-Workspace-Id: YOUR_WORKSPACE_ID

Endpoints

1. List Charts

Retrieve chart definitions.

GET /api/v1/analytics/charts

Description

Returns a list of charts grouped by category (growth, insights, demographics). Different platforms expose different charts.

Query Parameters

Parameter
Type
Required
Description

account_type

string

No

Filter charts for a specific account type.

Account type values: ig_business, fb_page, twitter, linkedin, youtube, tiktok, google, pin_business, pin_personal, threads, wordpress_oauth, in_profile, in_page, mastodon, bluesky

Get Available Analytics Charts

get

Retrieves a list of available analytics charts filtered by account type and chart type. Charts include growth metrics (followers, connections), insights (engagement, reach), and demographics (countries, ages).

Query parameters
account_typestring · enumOptional

Social media platform type to filter charts for (e.g., 'ig_business', 'fb_page', 'twitter', 'linkedin', 'youtube', 'tiktok', 'google', 'pin_business')

Possible values:
Header parameters
Publer-Workspace-IdstringRequired

ID of the workspace to retrieve charts from

Responses
200

List of available charts with metadata

application/json
get
GET /api/v1/analytics/charts HTTP/1.1
Host: app.publer.com
Publer-Workspace-Id: text
Accept: */*
[
  {
    "id": "followers",
    "title": "Followers",
    "group_id": "growth",
    "tooltip": "text",
    "type": "vertical",
    "last_value": true,
    "show_percentage": true
  }
]

Field Descriptions

Field
Description

id

Unique chart identifier (use in chart_ids[]).

title

Display title.

group_id

Chart group: growth, insights, demographics.

tooltip

Short explanatory text.

type

Suggested visualization: vertical, horizontal, side_by_side.

last_value

Show latest value highlight.

show_percentage

Indicates client should render as percentage.

2. Get Chart Data

Fetch data for one or more charts by ID. Returns current and previous period blocks for comparison.

GET /api/v1/analytics/:account_id/chart_data

Description

Supports growth metrics, post insights, and demographics. Chart IDs must come from the “List Charts” endpoint.

For better performance and lower latency, request chart data in small logical batches of related chart_ids (e.g., growth first, then insights, then demographics) instead of sending every available chart ID in one call.

URL Parameters

Parameter
Type
Required
Description

account_id

string

No

When provided, returns data for that account only; when omitted, returns aggregate across the workspace (where supported).

Query Parameters

Parameter
Type
Required
Description

chart_ids[]

string[]

Yes

One or more chart IDs from /api/v1/analytics/charts. Example: chart_ids[]=followers&chart_ids[]=post_engagement

from

string (YYYY-MM-DD)

Yes if to used

Start date (inclusive). Defaults to workspace range if omitted with to.

to

string (YYYY-MM-DD)

Yes if from used

End date (inclusive). Defaults to workspace range if omitted with from.

Get Analytics Chart Data

get

Retrieves analytics data for specific charts by their IDs. Returns current and previous period data for comparison. Supports growth metrics, post insights, and demographic data.

Path parameters
account_idstringOptional

Optional account ID to filter analytics data for a specific social media account

Query parameters
chart_idsstring[]Required

Array of chart IDs to retrieve data for. Use chart IDs from the /analytics/charts endpoint

Example: {"value":["followers","post_engagement","post_reach"]}
fromstring · dateOptional

Start date for analytics data (YYYY-MM-DD format)

tostring · dateOptional

End date for analytics data (YYYY-MM-DD format)

Header parameters
Publer-Workspace-IdstringRequired

ID of the workspace to retrieve data from

Responses
200

Analytics chart data with current and previous period values

application/json
get
GET /api/v1/analytics/chart_data HTTP/1.1
Host: app.publer.com
Publer-Workspace-Id: text
Accept: */*
{
  "current": {
    "ANY_ADDITIONAL_PROPERTY": {}
  },
  "previous": {
    "ANY_ADDITIONAL_PROPERTY": {}
  }
}

Structure

Key
Description

current

Object keyed by chart ID with current period series.

previous

Matching structure for the previous (comparison) period.

data[]

Array of { date, value } points.

last_value

Latest cumulative snapshot (growth charts).

total

Period aggregate sum (engagement / sum charts).

Usage Notes

  • Always fetch chart IDs from /api/v1/analytics/charts; charts can change over time.

  • If account_id is omitted, results are aggregated across accessible accounts (where the metric supports aggregation).

  • The comparison (previous) window automatically matches the current window length.

  • Ensure fromto when providing dates.

  • Not all charts are available for every account_type.

  • Apply client‑side caching for chart definitions to reduce requests.

Last updated

Was this helpful?