Posts Insights
facebook_get_posts_insightsRetrieve lifetime insights for up to 25 Facebook posts in one compact table by selecting post IDs or recent posts, with per-post errors and optional CSV or JSON export.
Instructions
Lifetime insights for several posts in one call, as a compact table: one row per post with values (one scalar per metric) and unaggregated breakdowns (e.g. reactions by type). Pass post_ids or latest (the N most recent published posts). Defaults to views, unique viewers, clicks and reactions by type. A post Graph refuses, or one on another Page, gets a row error instead of failing the call. output:{format} writes the table to a CSV (one line per post × metric) or JSON file in FB_EXPORT_DIR and returns its path instead of the rows. For one post with full summaries use facebook_post_insights.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| latest | No | Instead of post_ids: the N most recent published posts. | |
| output | No | Write the FULL series to a local file in FB_EXPORT_DIR instead of returning rows. The row cap does not apply to the file; the inline result is the aggregate-mode summary (no rows, max_rows and aggregate are ignored) plus `export: {path, format, rows, bytes, sha256}`. Use it for long daily series that would otherwise be truncated. | |
| metrics | No | Lifetime post metric names (the table columns). Vetted once, on the first post: a dead or rejected name is dropped for the rest. | |
| profile | No | Page profile key (e.g. "brand-a") or a raw Page ID. Omitted ⇒ the default Page (FB_PAGE_ID). | |
| post_ids | No | Post IDs ({page-id}_{post-id}) to compare, 1-25. Exactly one of post_ids or latest. |