> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # Linking Instagram as a source Canonical URL: https://posthog.com/docs/data-pipelines/sources/instagram > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.posthog.com` instead of `https://us.posthog.com` or `https://app.posthog.com` (app host for links). ## On this page - [Prerequisites](#prerequisites) - [Adding a data source](#adding-a-data-source) - [Sync modes](#sync-modes) - [Configuration](#configuration) - [Supported tables](#supported-tables) - [Limitations](#limitations) - [Troubleshooting](#troubleshooting) ![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_9608fcca70) ![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_dark_a92b0e022d) Let AI connect your sources for you Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog. `npx @posthog/wizard warehouse` ![PostHog Wizard hedgehog](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png) ![](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png)Let AI connect your sources for you The Instagram connector syncs an Instagram professional account into PostHog: the profile, its posts, stories and comments, and the insights Meta reports for the account and for each post. You can then analyze social activity alongside your product data. ## Prerequisites - An Instagram professional account, either Business or Creator. Personal accounts aren't supported. - A Facebook page linked to that professional account. PostHog reads the account through its page, using [Instagram API with Facebook Login](https://developers.facebook.com/docs/instagram-platform/instagram-api-with-facebook-login). - A Facebook account with access to that page. ## Adding a data source 1. In PostHog, go to the [Sources tab](https://app.posthog.com/data-management/sources) of the data pipeline section. 2. Click **\+ New source** and click **Link** next to this source. 3. Enter your credentials (see [Configuration](#configuration) below) and click **Next**. 4. Select the tables you want to sync, choose a sync method and frequency, then click **Import**. Once the syncs are complete, you can start querying this data in PostHog. When linking Instagram, you'll need: - **Instagram account**: connect your account and sign in with Facebook. Grant access to the page your professional account is linked to, along with Instagram insights and comments. PostHog asks for the `instagram_basic`, `instagram_manage_insights`, `instagram_manage_comments`, `pages_show_list`, and `pages_read_engagement` permissions. - **Instagram professional account**: pick the account you want to sync. PostHog lists the professional accounts on the pages you granted access to. - **Start date** (optional): the earliest date to sync posts and account insights from, in `YYYY-MM-DD` format. Leave it empty to sync every post and the last 90 days of account insights. ## Sync modes Each table can be synced in one of several modes, depending on what the source supports: - **Webhook** (when available) – the source pushes changes to PostHog in real time. Fastest freshness, lowest ongoing cost, and the only mode that reliably captures updates and deletes. - **Incremental** – only new or updated rows are synced on each run, using a cursor field (such as an `updated_at` timestamp). Cheaper than a full refresh, but deletes aren't captured. - **Append only** – new rows are appended using a cursor field; existing rows are never updated. Ideal for immutable, append-only tables like event logs. - **Full refresh** – the whole table is reloaded on every sync. Use it when a table has no reliable cursor or when you need deletions reflected. See [sync methods](https://posthog.com/docs/data-pipelines/sources.md#sync-methods) for a full explanation of how each mode works and how to choose between them. Two tables sync incrementally: - `media` uses each post's creation time, so a run fetches only posts created since the previous run. - `account_insights` uses the metric's date and continues from the last day it synced. The rest have no time filter on Meta's side, so they do a full refresh on every run. Instagram deletes stories after 24 hours. The `stories` table only holds stories that were live when a sync ran, so sync at least daily to build up a history. ## Configuration | Option | Description | | --- | --- | | `Instagram account` **Type:** oauth **Required:** True | | | `Instagram professional account` **Type:** oauth-account-select **Required:** True | Only professional accounts linked to a Facebook page are listed. If yours is missing, enter its numeric Instagram account ID from your Meta business settings. | | `Start date` **Type:** text **Required:** False | | ## Supported tables | Table | Description | Sync method | Incremental field | Primary key | | --- | --- | --- | --- | --- | | `account` | The connected Instagram professional account, refreshed on every sync. | Full refresh | — | — | | `media` | Posts, reels and carousels published by the account, newest first. Limited to the 10,000 most recently created media. Every sync re-reads each post from the start date on, so like and comment counts stay current. | Incremental, Full refresh | timestamp | — | | `stories` | Stories published by the account in the last 24 hours. Instagram deletes stories after 24 hours, so history only accumulates from syncs that ran while a story was live. | Full refresh | — | — | | `media_comments` | Comments and comment replies on the account's media, one row per comment. Keyed by media and comment, because the table aggregates comments across every post. Replies have parent\_id set, so the row count per media matches comments\_count on media. | Full refresh | — | — | | `media_insights` | Lifetime performance metrics per post, in long format: one row per media and metric. Available metrics vary by media type, and Meta retires metrics between Graph API versions. | Full refresh | — | — | | `media_insights_breakdowns` | Lifetime post metrics split by a breakdown, in long format: one row per media, metric and breakdown value. Holds profile\_activity by action\_type for feed posts and stories, and navigation by story\_navigation\_action\_type for stories. | Full refresh | — | — | | `account_insights` | Daily account-level metrics, in long format: one row per metric and day. Meta only serves insights in windows of at most 30 days and retains roughly two years of history. | Incremental, Full refresh | date | — | | `account_insights_breakdowns` | Daily account-level metrics split by a breakdown dimension, in long format: one row per metric, breakdown value and day. Covers follows\_and\_unfollows by follow\_type, likes, comments, shares, saves and total\_interactions by media\_product\_type, and profile\_links\_taps by contact\_button\_type. | Incremental, Full refresh | date | — | ## Limitations - Meta returns at most the 10,000 most recently created posts, so `media` and the tables built from it cover that window. - Account insights go back about two years. An earlier start date is clamped to that limit. - `media_insights` and `account_insights` are in long format: one row per metric, not one column per metric. The metrics Meta returns vary by media type, and Meta retires metrics between Graph API versions. ## Troubleshooting - **No accounts to pick from**: the Facebook account you connected has no Instagram professional account on the pages you granted. Check that the account is Business or Creator, that it's linked to a page, and that you granted access to that page. - **"The Instagram connection has expired"**: Meta access tokens expire, and revoking PostHog's access in Facebook ends the connection early. Reconnect the Instagram account in the source's settings, then re-sync. - **"The Instagram connection is missing permissions this sync needs"**: the grant left out one of the permissions listed above. Reconnect the account and accept access to the page, insights, and comments. - **Empty insights tables**: Meta reports insights only for professional accounts, and only for days the account was active. Compare the same metrics in the Instagram app before treating this as a sync problem. If your sync is failing or data looks wrong, see the [Data warehouse troubleshooting guide](https://posthog.com/docs/data-warehouse/troubleshooting.md). If that doesn't help, [contact support](https://us.posthog.com/#panel=support%3Asupport%3Adata_warehouse%3A%3Atrue) – we're happy to help.