GetInsights​Get​Insights

Get insights for Facebook posts

Fetch insights and metrics like reach, impressions, and reactions for one or more Facebook posts

yaml
type: "io.kestra.plugin.meta.facebook.posts.GetInsights"

Get default reaction insights for posts

yaml
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

yaml
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

yaml
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

yaml
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

Access Token

Facebook Page access token with appropriate permissions (pages_manage_posts, pages_manage_engagement, etc.)

Facebook Page ID

The ID of the Facebook page to perform operations on

SubType string

Post IDs

List of Facebook post IDs to get insights for (format: pageId_postId)

Default https://graph.facebook.com

Base API URL

The base URL for the Facebook Graph API

Default v24.0

API Version

Facebook Graph API version to use

Default TODAY
Possible Values
TODAYYESTERDAYTHIS_MONTHLAST_MONTHTHIS_QUARTERMAXIMUMLAST_3DLAST_7DLAST_14DLAST_28DLAST_30DLAST_90DLAST_WEEK_MON_SUNLAST_WEEK_SUN_SATLAST_QUARTERLAST_YEARTHIS_WEEK_MON_TODAYTHIS_WEEK_SUN_TODAYTHIS_YEAR

Date Preset

Preset a date range, like last_week, yesterday. If since or until are present, date_preset is ignored.

SubType string
Default ["POST_REACTIONS_LIKE_TOTAL","POST_REACTIONS_LOVE_TOTAL","POST_REACTIONS_WOW_TOTAL","POST_REACTIONS_HAHA_TOTAL","POST_REACTIONS_SORRY_TOTAL","POST_REACTIONS_ANGER_TOTAL"]
Possible Values
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_TOTAL

Metrics

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.

Default LIFETIME
Possible Values
DAYWEEKDAYS_28MONTHLIFETIMETOTAL_OVER_RANGE

Period

The aggregation period for insights

Default 2025-11-03

Since

Lower bound of the time range to consider (datetime). If provided, date_preset does not work.

Default 2025-11-03

Until

Upper bound of the time range to consider (datetime). If provided, date_preset does not work.