Skip to content

HighLevel: Get Social Media Statistics

HighLevel socialPlanner.getStatistics: arguments, response, policy and SDK examples.

← Social planner operations · Get started

Operation gohighlevel.get_statistics

Provider route: POST /social-media-posting/statistics. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/gohighlevel with npm, or alter-sdk-gohighlevel with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { HighLevelIntegration } from "@alter-ai/gohighlevel";
async function execute(input: Parameters<HighLevelIntegration["socialPlanner"]["getStatistics"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new HighLevelIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.socialPlanner.getStatistics(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_gohighlevel import HighLevelIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = HighLevelIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.social_planner.get_statistics(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
queryobjectRequired within parentAdditional keys: not allowed
query.locationIdstringRequired within parent
bodyobjectRequired within parent
body.currentRangeobjectOptionalCustom date range for the current analytics period. If omitted, defaults to the last 7 days (excluding today) with automatic comparison to the previous 7 days.
body.currentRange.endDatestringRequired within parentEnd date in ISO 8601 format. Must be after startDate.
Format: date-time
body.currentRange.startDatestringRequired within parentStart date in ISO 8601 format.
Format: date-time
body.platformsarrayOptionalArray of social media platforms to filter analytics by. If not provided, all platforms will be included. NOTE: Linkedin (PAGE only) and Tiktok (BUSINESS only) are supported.
body.platforms[]stringEach itemOne of: facebook, instagram, linkedin, google, pinterest, youtube, tiktok
body.prevRangeobjectOptionalComparison date range. Can only be provided when currentRange is also present. If omitted while currentRange is present, no comparison data is returned.
body.prevRange.endDatestringRequired within parentEnd date in ISO 8601 format. Must be after startDate.
Format: date-time
body.prevRange.startDatestringRequired within parentStart date in ISO 8601 format.
Format: date-time
body.profileIdsarrayRequired within parentArray of connected social media account IDs to fetch analytics for. This can be found as ‘profileId’ in /accounts api.
Maximum items: 100
Minimum items: 1
body.profileIds[]stringEach item

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$objectRoot
messagestringOptionalSuccess message indicating the analytics were built successfully
resultsobjectOptionalAnalytics data grouped by metrics and platforms
results.breakdownsobjectOptionalDetailed breakdowns by metric and platform
results.breakdowns.engagementobjectOptionalEngagement metrics breakdown by platform
Additional keys: see wildcard field
results.breakdowns.engagement.*objectAdditional keys
results.breakdowns.engagement.*.changeJSONOptional
results.breakdowns.engagement.*.change (anyOf 1)numberAlternativePercentage change in engagement compared to previous period
results.breakdowns.engagement.*.change (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.breakdowns.engagement.*.commentsJSONOptional
results.breakdowns.engagement.*.comments (anyOf 1)numberAlternativeNumber of comments received on this platform
results.breakdowns.engagement.*.comments (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.breakdowns.engagement.*.likesJSONOptional
results.breakdowns.engagement.*.likes (anyOf 1)numberAlternativeNumber of likes received on this platform
results.breakdowns.engagement.*.likes (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.breakdowns.engagement.*.sharesJSONOptional
results.breakdowns.engagement.*.shares (anyOf 1)numberAlternativeNumber of shares on this platform
results.breakdowns.engagement.*.shares (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.breakdowns.impressionsobjectOptionalImpressions breakdown by platform
results.breakdowns.impressions.platformsobjectOptionalPlatform-specific impression counts with change percentages
Additional keys: see wildcard field
results.breakdowns.impressions.platforms.*objectAdditional keys
results.breakdowns.impressions.platforms.*.changeJSONOptional
results.breakdowns.impressions.platforms.*.change (anyOf 1)numberAlternativePercentage change compared to previous period
results.breakdowns.impressions.platforms.*.change (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.breakdowns.impressions.platforms.*.valueJSONOptional
results.breakdowns.impressions.platforms.*.value (anyOf 1)numberAlternativeNumber of impressions for this platform
results.breakdowns.impressions.platforms.*.value (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.breakdowns.impressions.totalJSONOptional
results.breakdowns.impressions.total (anyOf 1)numberAlternativeTotal impressions across all platforms
results.breakdowns.impressions.total (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.breakdowns.impressions.totalChangeJSONOptional
results.breakdowns.impressions.totalChange (anyOf 1)numberAlternativePercentage change in total impressions compared to previous period
results.breakdowns.impressions.totalChange (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.breakdowns.postsobjectOptionalPost count breakdown by platform
results.breakdowns.posts.platformsobjectOptionalPlatform-specific post counts with change percentages
Additional keys: see wildcard field
results.breakdowns.posts.platforms.*objectAdditional keys
results.breakdowns.posts.platforms.*.changeJSONOptional
results.breakdowns.posts.platforms.*.change (anyOf 1)numberAlternativePercentage change compared to previous period
results.breakdowns.posts.platforms.*.change (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.breakdowns.posts.platforms.*.valueJSONOptional
results.breakdowns.posts.platforms.*.value (anyOf 1)numberAlternativeNumber of posts for this platform
results.breakdowns.posts.platforms.*.value (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.breakdowns.posts.totalJSONOptional
results.breakdowns.posts.total (anyOf 1)numberAlternativeTotal number of posts across all platforms
results.breakdowns.posts.total (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.breakdowns.posts.totalChangeJSONOptional
results.breakdowns.posts.totalChange (anyOf 1)numberAlternativePercentage change in total posts compared to previous period
results.breakdowns.posts.totalChange (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.breakdowns.reachobjectOptionalReach breakdown by platform
results.breakdowns.reach.platformsobjectOptionalPlatform-specific reach counts with change percentages
Additional keys: see wildcard field
results.breakdowns.reach.platforms.*objectAdditional keys
results.breakdowns.reach.platforms.*.changeJSONOptional
results.breakdowns.reach.platforms.*.change (anyOf 1)numberAlternativePercentage change compared to previous period
results.breakdowns.reach.platforms.*.change (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.breakdowns.reach.platforms.*.valueJSONOptional
results.breakdowns.reach.platforms.*.value (anyOf 1)numberAlternativeReach count for this platform
results.breakdowns.reach.platforms.*.value (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.breakdowns.reach.totalJSONOptional
results.breakdowns.reach.total (anyOf 1)numberAlternativeTotal reach across all platforms
results.breakdowns.reach.total (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.breakdowns.reach.totalChangeJSONOptional
results.breakdowns.reach.totalChange (anyOf 1)numberAlternativePercentage change in total reach compared to previous period
results.breakdowns.reach.totalChange (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.dayRangearrayOptionalArray of day names for the analytics period
results.dayRange[]stringEach item
results.demographicsobjectOptionalDemographic data breakdown
results.demographics.ageobjectOptionalAge distribution of audience
results.demographics.age.totalsobjectOptionalTotal counts by age group
results.demographics.age.totals.13-17JSONOptional
results.demographics.age.totals.13-17 (anyOf 1)numberAlternativeNumber of audience members aged 13-17
results.demographics.age.totals.13-17 (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.demographics.age.totals.18-24JSONOptional
results.demographics.age.totals.18-24 (anyOf 1)numberAlternativeNumber of audience members aged 18-24
results.demographics.age.totals.18-24 (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.demographics.age.totals.25-34JSONOptional
results.demographics.age.totals.25-34 (anyOf 1)numberAlternativeNumber of audience members aged 25-34
results.demographics.age.totals.25-34 (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.demographics.age.totals.35-44JSONOptional
results.demographics.age.totals.35-44 (anyOf 1)numberAlternativeNumber of audience members aged 35-44
results.demographics.age.totals.35-44 (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.demographics.age.totals.45-54JSONOptional
results.demographics.age.totals.45-54 (anyOf 1)numberAlternativeNumber of audience members aged 45-54
results.demographics.age.totals.45-54 (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.demographics.age.totals.55-64JSONOptional
results.demographics.age.totals.55-64 (anyOf 1)numberAlternativeNumber of audience members aged 55-64
results.demographics.age.totals.55-64 (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.demographics.age.totals.65+JSONOptional
results.demographics.age.totals.65+ (anyOf 1)numberAlternativeNumber of audience members aged 65 and above
results.demographics.age.totals.65+ (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.demographics.genderobjectOptionalGender distribution of audience
results.demographics.gender.totalsobjectOptionalTotal counts and percentages by gender
results.demographics.gender.totals.femaleobjectOptionalFemale audience statistics
results.demographics.gender.totals.female.percentageJSONOptional
results.demographics.gender.totals.female.percentage (anyOf 1)numberAlternativePercentage of female audience
results.demographics.gender.totals.female.percentage (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.demographics.gender.totals.female.totalJSONOptional
results.demographics.gender.totals.female.total (anyOf 1)numberAlternativeTotal number of female audience members
results.demographics.gender.totals.female.total (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.demographics.gender.totals.maleobjectOptionalMale audience statistics
results.demographics.gender.totals.male.percentageJSONOptional
results.demographics.gender.totals.male.percentage (anyOf 1)numberAlternativePercentage of male audience
results.demographics.gender.totals.male.percentage (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.demographics.gender.totals.male.totalJSONOptional
results.demographics.gender.totals.male.total (anyOf 1)numberAlternativeTotal number of male audience members
results.demographics.gender.totals.male.total (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.demographics.gender.totals.unknownobjectOptionalUnknown gender audience statistics
results.demographics.gender.totals.unknown.percentageJSONOptional
results.demographics.gender.totals.unknown.percentage (anyOf 1)numberAlternativePercentage of audience with unknown gender
results.demographics.gender.totals.unknown.percentage (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.demographics.gender.totals.unknown.totalJSONOptional
results.demographics.gender.totals.unknown.total (anyOf 1)numberAlternativeTotal number of audience members with unknown gender
results.demographics.gender.totals.unknown.total (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.platformTotalsobjectOptionalPlatform-wise totals with time series data
results.platformTotals.followersobjectOptionalDaily follower counts by platform
Additional keys: see wildcard field
results.platformTotals.followers.*objectAdditional keys
results.platformTotals.followers.*.seriesarrayOptionalDaily follower counts over the analytics period
results.platformTotals.followers.*.series[]JSONEach item
results.platformTotals.followers.*.series[] (anyOf 1)numberAlternative
results.platformTotals.followers.*.series[] (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.platformTotals.followers.*.totalJSONOptional
results.platformTotals.followers.*.total (anyOf 1)numberAlternativeTotal followers for this platform
results.platformTotals.followers.*.total (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.platformTotals.impressionsobjectOptionalDaily impression counts by platform
Additional keys: see wildcard field
results.platformTotals.impressions.*objectAdditional keys
results.platformTotals.impressions.*.seriesarrayOptionalDaily impression counts over the analytics period
results.platformTotals.impressions.*.series[]JSONEach item
results.platformTotals.impressions.*.series[] (anyOf 1)numberAlternative
results.platformTotals.impressions.*.series[] (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.platformTotals.impressions.*.totalJSONOptional
results.platformTotals.impressions.*.total (anyOf 1)numberAlternativeTotal impressions for this platform
results.platformTotals.impressions.*.total (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.platformTotals.likesobjectOptionalDaily like counts by platform
Additional keys: see wildcard field
results.platformTotals.likes.*objectAdditional keys
results.platformTotals.likes.*.seriesarrayOptionalDaily like counts over the analytics period
results.platformTotals.likes.*.series[]JSONEach item
results.platformTotals.likes.*.series[] (anyOf 1)numberAlternative
results.platformTotals.likes.*.series[] (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.platformTotals.likes.*.totalJSONOptional
results.platformTotals.likes.*.total (anyOf 1)numberAlternativeTotal likes for this platform
results.platformTotals.likes.*.total (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.postPerformanceobjectOptionalPost performance metrics over time
results.postPerformance.commentsarrayOptionalDaily comments over the analytics period
results.postPerformance.comments[]JSONEach item
results.postPerformance.comments[] (anyOf 1)numberAlternative
results.postPerformance.comments[] (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.postPerformance.impressionsarrayOptionalDaily impressions over the analytics period
results.postPerformance.impressions[]JSONEach item
results.postPerformance.impressions[] (anyOf 1)numberAlternative
results.postPerformance.impressions[] (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.postPerformance.likesarrayOptionalDaily likes over the analytics period
results.postPerformance.likes[]JSONEach item
results.postPerformance.likes[] (anyOf 1)numberAlternative
results.postPerformance.likes[] (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.postPerformance.postsobjectOptionalNumber of posts published per day, organized by platform
results.totalsobjectOptionalAggregated metrics totals
results.totals.commentsJSONOptional
results.totals.comments (anyOf 1)numberAlternativeTotal number of comments received
results.totals.comments (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.totals.followersJSONOptional
results.totals.followers (anyOf 1)numberAlternativeTotal number of followers across all platforms
results.totals.followers (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.totals.impressionsJSONOptional
results.totals.impressions (anyOf 1)numberAlternativeTotal number of impressions across all posts
results.totals.impressions (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.totals.likesJSONOptional
results.totals.likes (anyOf 1)numberAlternativeTotal number of likes received
results.totals.likes (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
results.totals.postsJSONOptional
results.totals.posts (anyOf 1)numberAlternativeTotal number of posts published
results.totals.posts (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
traceIdstringOptionalUnique identifier for tracking this request

SDK function policy ID: gohighlevel.get_statistics. Catalog operation: get-statistics. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Required provider scopes: ["socialplanner/statistics.readonly"]

Pinned headers: {"Version": "v3"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.