
GetInsights
Fetch insights and metrics like reach, impressions, and reactions for one or more Facebook posts
Fetch insights and metrics like reach, impressions, and reactions for one or more Facebook posts
Get insights for Facebook posts
Fetch insights and metrics like reach, impressions, and reactions for one or more Facebook posts
type: "io.kestra.plugin.meta.facebook.posts.GetInsights"Examples
Get default reaction insights for posts
id: facebook_get_post_insights
namespace: company.team
tasks:
- id: get_insights
type: io.kestra.plugin.meta.facebook.posts.GetInsights
pageId: "{{ secret('FACEBOOK_PAGE_ID') }}"
accessToken: "{{ secret('FACEBOOK_ACCESS_TOKEN') }}"
postIds:
- "123456789_987654321"
- "123456789_987654322"
Add custom metrics to default reactions
id: "getinsights"
type: "io.kestra.plugin.meta.facebook.posts.GetInsights"
- id: get_insights_with_custom_metrics
type: io.kestra.plugin.meta.facebook.posts.GetInsights
pageId: "{{ secret('FACEBOOK_PAGE_ID') }}"
accessToken: "{{ secret('FACEBOOK_ACCESS_TOKEN') }}"
postIds:
- "123456789_987654321"
metrics:
- POST_REACTIONS_LIKE_TOTAL
- POST_REACTIONS_LOVE_TOTAL
- POST_REACTIONS_WOW_TOTAL
- POST_REACTIONS_HAHA_TOTAL
- POST_REACTIONS_SORRY_TOTAL
- POST_REACTIONS_ANGER_TOTAL
- POST_IMPRESSIONS
- POST_ENGAGED_USERS
period: "lifetime"
Get insights with date preset
id: "getinsights"
type: "io.kestra.plugin.meta.facebook.posts.GetInsights"
- id: get_insights_last_7_days
type: io.kestra.plugin.meta.facebook.posts.GetInsights
pageId: "{{ secret('FACEBOOK_PAGE_ID') }}"
accessToken: "{{ secret('FACEBOOK_ACCESS_TOKEN') }}"
postIds:
- "123456789_987654321"
datePreset: "last_7d"
period: "day"
Get insights with custom date range
id: "getinsights"
type: "io.kestra.plugin.meta.facebook.posts.GetInsights"
- id: get_insights_custom_range
type: io.kestra.plugin.meta.facebook.posts.GetInsights
pageId: "{{ secret('FACEBOOK_PAGE_ID') }}"
accessToken: "{{ secret('FACEBOOK_ACCESS_TOKEN') }}"
postIds:
- "123456789_987654321"
since: "2025-10-01"
until: "2025-10-15"
period: "day"
Properties
accessToken*Requiredstring
Access Token
Facebook Page access token with appropriate permissions (pages_manage_posts, pages_manage_engagement, etc.)
pageId*Requiredstring
Facebook Page ID
The ID of the Facebook page to perform operations on
postIds*Requiredarray
Post IDs
List of Facebook post IDs to get insights for (format: pageId_postId)
apiBaseUrlstring
https://graph.facebook.comBase API URL
The base URL for the Facebook Graph API
apiVersionstring
v24.0API Version
Facebook Graph API version to use
datePresetstring
TODAYTODAYYESTERDAYTHIS_MONTHLAST_MONTHTHIS_QUARTERMAXIMUMLAST_3DLAST_7DLAST_14DLAST_28DLAST_30DLAST_90DLAST_WEEK_MON_SUNLAST_WEEK_SUN_SATLAST_QUARTERLAST_YEARTHIS_WEEK_MON_TODAYTHIS_WEEK_SUN_TODAYTHIS_YEARDate Preset
Preset a date range, like last_week, yesterday. If since or until are present, date_preset is ignored.
metricsarray
["POST_REACTIONS_LIKE_TOTAL","POST_REACTIONS_LOVE_TOTAL","POST_REACTIONS_WOW_TOTAL","POST_REACTIONS_HAHA_TOTAL","POST_REACTIONS_SORRY_TOTAL","POST_REACTIONS_ANGER_TOTAL"]POST_REACTIONS_LIKE_TOTALPOST_REACTIONS_LOVE_TOTALPOST_REACTIONS_WOW_TOTALPOST_REACTIONS_HAHA_TOTALPOST_REACTIONS_SORRY_TOTALPOST_REACTIONS_ANGER_TOTALPOST_IMPRESSIONSPOST_ENGAGED_USERSPOST_CLICKSPOST_REACTIONS_BY_TYPE_TOTALMetrics
List of specific metrics to retrieve. Default includes reaction metrics (like, love, wow, haha, sorry, anger). You can add more metrics like POST_IMPRESSIONS, POST_ENGAGED_USERS, etc.
periodstring
LIFETIMEDAYWEEKDAYS_28MONTHLIFETIMETOTAL_OVER_RANGEPeriod
The aggregation period for insights
sincestring
2025-12-09Since
Lower bound of the time range to consider (datetime). If provided, date_preset does not work.
untilstring
2025-12-09Until
Upper bound of the time range to consider (datetime). If provided, date_preset does not work.