Meta GetInsights

Meta GetInsights

Certified

Collect Facebook post insights

Fetches Graph API insights (reach, impressions, reactions, etc.) for one or more posts. Defaults to lifetime reaction metrics; date_preset is ignored when since/until are provided.

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: facebook_post_insights
namespace: company.team

tasks:
  - 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: facebook_post_insights_preset
namespace: company.team

tasks:
  - 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: facebook_post_insights_range
namespace: company.team

tasks:
  - 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

Page access token with permissions such as pages_manage_posts and pages_read_engagement.

Facebook Page ID

ID of the Page the task operates on; must match the access token scope.

SubTypestring

Post IDs

Post identifiers in pageId_postId format to retrieve insights for.

Defaulthttps://graph.facebook.com

Base API URL

Base Graph API URL. Defaults to https://graph.facebook.com.

Defaultv24.0

API Version

Facebook Graph API version to call. Defaults to v24.0.

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
DefaultTODAY
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 date range (e.g., last_week, yesterday). Default is TODAY; ignored when since or until are set.

SubTypestring
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

Metrics to request. Defaults to reaction totals; add metrics such as POST_IMPRESSIONS or POST_ENGAGED_USERS as needed.

DefaultLIFETIME
Possible Values
DAYWEEKDAYS_28MONTHLIFETIMETOTAL_OVER_RANGE

Period

Aggregation period for insights. Defaults to lifetime.

Default2026-10-05

Since

Lower bound (datetime string). Overrides date_preset when set. Defaults to today.

Default2026-10-05

Until

Upper bound (datetime string). Overrides date_preset when set. Defaults to today.