Skip to main content

Facebook Pages

This page contains the setup guide and reference information for the Facebook Pages source connector.

Prerequisites​

To set up the Facebook Pages source connector, you need a Facebook app, a long-lived Page access token, and the ID of the Page you want to sync.

note

This connector calls v26.0 of the Facebook Graph API.

Meta only returns Page Insights data for Pages with 100 or more likes. The connector checks the connection by reading the page_insights stream, and an empty response still passes, so a Page with fewer than 100 likes can be set up and will sync its non-insights streams, such as page and post, but its insights streams return no records until it reaches 100 likes.

Setup guide​

Step 1: Set up Facebook Pages​

  1. Create a Facebook Developer Account. Follow these instructions to create one.
  2. Create a Facebook App. Choose "Company" as the purpose of the app. Fill out the remaining fields to create your app, then follow along the "Connect a User Page" section.
  3. Connect a User Page using the Graph API Explorer. Choose your app in the Meta App field. Choose your Page in the User or Page field. Add the following permissions:
    • pages_read_engagement
    • pages_read_user_content
    • pages_show_list
    • read_insights
  4. Click Generate Access Token and follow instructions.

After all the steps, it should look something like this:

  1. Generate Long-Lived User Access Token.
  2. Generate Long-Lived Page Token.

Step 2: Set up the Facebook Pages connector in Airbyte​

  1. In the left navigation bar, click Sources. In the top-right corner, click + New source.
  2. Select Facebook Pages and enter a name for the source.
  3. For Page Access Token, enter the long-lived Page token you generated in Step 1. The connector also accepts a long-lived User token, as long as that user can generate a Page token for the Page you configure.
  4. For Page ID, enter the Page's ID or username. If your Page URL is https://www.facebook.com/Test-1111111111, use Test-1111111111.
  5. (Optional) Set Page Size to control the number of records requested per API call for every paginated stream: post, post_insights, video_insights, reel_insights, comment, and rating. The default is 100, and valid values are 1 through 100. Decrease it if you see "Please reduce the amount of data you're asking for" errors.
  6. (Optional) Set Page Insights Metrics, Post Insights Metrics, Video Insights Metrics, or Reel Insights Metrics to choose which metrics each insights stream requests. See Insights metrics and period.
  7. (Optional) Set Page Insights Period to request a single aggregation period, such as day, for the page_insights stream. Valid values are day, week, days_28, month, lifetime, and total_over_range.
  8. (Optional) Set Start Date to the earliest date the page_insights stream reads, in the format YYYY-MM-DDTHH:MM:SSZ, for example 2024-01-01T00:00:00Z. Meta keeps about two years of Page Insights history. See Supported sync modes.
  9. Click Set up source.

Creating your own OAuth App​

Follow this Facebook documentation to create an OAuth App.

Required permissions for your OAuth App to sync data using the Facebook Pages source connector:

  • pages_read_engagement
  • pages_read_user_content
  • pages_show_list
  • read_insights

If you encounter permission errors for specific Page fields, see Meta's Permissions Reference for additional permissions you might need. As a rule it's best to request the lowest number of permissions you can to function normally.

Supported sync modes​

The Facebook Pages source connector supports the following sync modes:

The post stream is full refresh by default. If you switch it to Incremental, the connector keeps the newest created_time it has seen and asks Facebook only for posts created after it on the next sync, which cuts the amount of data read on every sync after the first. The first incremental sync reads the full post history, and a full refresh always does. Because the filter uses the post's creation time, edits, reactions and comment counts on posts the connector has already synced are not refreshed in incremental mode, so use full refresh if you need those to stay current.

The page_insights stream is full refresh by default, which asks Facebook for its default trailing window only. If you switch it to Incremental, the connector keeps the newest end_time it has seen and asks Facebook only for the days after it on the next sync. Set Start Date to backfill history, which the connector reads in 90-day windows because Facebook returns at most 90 days per request and keeps about two years of history. Start Date applies in both modes, so a full refresh with it set also reads from that date in 90-day windows. The newest point Facebook returns belongs to a day that is usually still in progress, so each incremental sync re-reads the last two days before the saved end_time, and you can expect those days to appear again in your destination. Each record is one metric and period for one window, so if your destination deduplicates on the primary key, use Incremental - Append rather than a deduplicated mode, or windows overwrite each other. If you leave Start Date empty, the first incremental sync reads Facebook's default window and the next syncs continue from there, so a connection paused for more than 90 days may need a reset or a Start Date before it can catch up.

Supported Streams​

The video_insights, reel_insights, comment, and rating streams were added in version 3.1.0 and need permissions that older tokens might not have. If Facebook rejects one of their requests with a permission error (error code 10, a code from 200 to 299, or a message that mentions a permission), the connector logs the error and skips the request instead of failing the sync, so these streams can sync zero records without an error. If one of them is empty, check that your token has the permissions listed in Step 1.

StreamGraph API endpointNotes
page/{page-id}One record describing the Page. Airbyte requests only the fields you select in the connection's Schema tab.
post/{page-id}/feedOne record per post. Paginated, so Page Size applies. Airbyte requests only the fields you select. Supports incremental sync on created_time.
page_insights/{page-id}/insightsOne record per metric and period, not per day. Metrics and period are configurable. Supports incremental sync on end_time, with Start Date to backfill.
post_insights/{page-id}/feed with an insights.metric(...) field selectionPost-level insights, one record per metric and period. Paginated, so Page Size applies. Metrics are configurable.
video_insights/{page-id}/videos with a video_insights.metric(...) field selectionLifetime video insights per Page video, one record per metric. Paginated, so Page Size applies. Metrics are configurable.
reel_insights/{page-id}/video_reels with a video_insights.metric(...) field selectionLifetime Reels insights per Page reel, such as blue_reels_play_count, one record per metric. Paginated, so Page Size applies. Metrics are configurable.
comment/{post-id}/comments for each post in /{page-id}/feedOne record per comment, including replies, with the parent post_id added. This makes one request per post, so a Page with many posts uses many API calls. Needs pages_read_user_content.
rating/{page-id}/ratingsOne record per recommendation or review. Recommendations have no ID of their own, so this stream has no primary key. Needs pages_read_user_content.

Insights metrics and period​

You can choose which metrics each insights stream requests with the Page Insights Metrics, Post Insights Metrics, Video Insights Metrics, and Reel Insights Metrics settings. If you leave a setting empty, the connector requests these defaults:

  • page_insights: page_total_actions, page_post_engagements, page_fan_adds_by_paid_non_paid_unique, page_media_view, page_total_media_view_unique
  • post_insights: post_media_view, post_total_media_view_unique, post_clicks, post_clicks_by_type, post_reactions_by_type_total
  • video_insights: total_video_views, total_video_complete_views, total_video_avg_time_watched, total_video_view_total_time, total_video_reactions_by_type_total
  • reel_insights: blue_reels_play_count, fb_reels_total_plays, fb_reels_replay_count, post_video_avg_time_watched, post_video_view_time, post_video_likes_by_reaction_type, post_video_social_actions

By default, Facebook returns every period it supports for each page_insights metric, usually day, week and days_28, so each metric produces about three records per request. If you only need one, set Page Insights Period to that period and the stream requests only it.

A setting replaces the defaults instead of adding to them, so include every metric you want. Facebook rejects the whole request when any one metric is misspelled or deprecated, so if a sync fails with the "must be a valid insights metric" error after you change a setting, check that list first. Each extra metric also adds to the response size and to your Graph API usage.

All insights streams inherit Meta's own limits on Page Insights: data is available only for Pages with 100 or more likes, most metrics refresh once every 24 hours, and Meta retains at most two years of history.

Reference​

This connector uses the Meta Graph API with the https://graph.facebook.com/v26.0 endpoint. Airbyte requests the selected Page and Post fields from the connector catalog, and requests the insights metrics you configure, or the defaults listed in Insights metrics and period.

For programmatic configuration, use these parameter names:

FieldRequiredDescription
access_tokenYesLong-lived Page access token for the Facebook Page. The connector also accepts a long-lived User access token that can generate a Page access token for the configured Page.
page_idYesFacebook Page ID.
page_sizeNoNumber of records to request per page for the paginated streams: post, post_insights, video_insights, reel_insights, comment, and rating. Defaults to 100. Valid values are 1 through 100.
page_insights_metricsNoArray of metrics for the page_insights stream. Replaces the defaults.
post_insights_metricsNoArray of metrics for the post_insights stream. Replaces the defaults.
video_insights_metricsNoArray of lifetime metrics for the video_insights stream. Replaces the defaults.
reel_insights_metricsNoArray of lifetime metrics for the reel_insights stream. Replaces the defaults.
page_insights_periodNoAggregation period for the page_insights stream: day, week, days_28, month, lifetime, or total_over_range. If empty, Facebook returns every period it supports.
start_dateNoEarliest date for the page_insights stream, in the format YYYY-MM-DDTHH:MM:SSZ. If empty, Facebook's default window is used.

Limitations & Troubleshooting​

"This application has not been approved to use this API" error​

This error means Meta rejected the API request because the app that generated the token isn't approved for the requested API, permission, or Page field.

To resolve this error, use a token from an app that has access to the permissions required by the streams you sync:

  • pages_read_engagement
  • pages_read_user_content
  • pages_show_list
  • read_insights

If you use your own Meta app, it might need App Review and Advanced Access before it can use these permissions in production. The person who generates the token must also be able to perform the required task on the Page. For Page Insights, Meta requires access to a Page that you own or administer, or on which you can perform the ANALYZE task.

"Error while generating page access token" error​

Before it reads any stream, the connector exchanges the token you configured for a Page access token by calling /{page-id}?fields=access_token. If Meta rejects that call, the check or sync fails with Error while generating page access token: followed by Meta's response.

To resolve this error:

  • Confirm that Page ID is the ID or username of the Page the token belongs to. A Page access token can only generate a token for its own Page.
  • Confirm that the user who generated the token can still perform a task on the Page, and that the token hasn't expired or been invalidated, for example by a password change. Generate a new long-lived token if needed.

"Please reduce the amount of data you're asking for" error​

The Graph API returns this error (error code 1, often with HTTP 500) when a response is too large to build in time. Because Meta returns it intermittently, the connector retries the request with backoff. If the retries are exhausted, the sync fails with a transient error and usually succeeds on a later attempt. Version 2.1.3 failed the sync immediately with a configuration error instead of retrying; upgrade to 2.1.4 or later to restore the retries.

If the error keeps recurring, reduce the size of each response:

  • Deselect fields in the Schema tab. Open your connection's Schema tab and deselect fields you don't need for the affected stream. The connector requests only the selected fields. Applies to the page and post streams.
  • Reduce the page size. Set Page Size in the source settings to a lower value, such as 25 or 50. Applies to the post, post_insights, video_insights, reel_insights, comment, and rating streams.

page stream fails for New Pages Experience Pages​

Meta deprecated the legacy Page fields current_location, genre, network, parking, and start_info for Pages on the New Pages Experience. On Graph API v26.0 and later, which the connector calls starting from version 3.3.0, requesting these fields returns an error, and Meta plans to apply the deprecation to all API versions. Meta also doesn't make the live_videos edge available for New Pages Experience Pages.

On versions earlier than 3.0.0, the connector requests these fields, so the entire page stream fails for a New Pages Experience Page. The sync fails with either the Request contains invalid/deprecated field. error or the Facebook API request contains invalid Page fields, metrics, or permissions error followed by a Facebook message that starts with (#10) To use live-video-api. Upgrade to version 3.0.0 or later, which no longer requests these fields. Then refresh the source schema and update any downstream models that reference the removed columns. See the migration guide for the full list of removed columns.

"Facebook API request contains invalid Page fields, metrics, or permissions" error​

Starting from version 2.1.3, the connector fails a sync with this configuration error when the Graph API rejects a request with HTTP 400 for a reason it can't retry, and includes Facebook's own error message so you can see what was rejected. Earlier versions retried these requests several times before failing, which hid the message from Facebook.

To resolve it, read the Facebook message that follows the error. It usually names a Page or Post field your token isn't allowed to read, or a field Meta no longer supports. Deselect that field in the connection's Schema tab, or use a token with the required permissions.

Reach metrics missing from Page Insights and Post Insights​

Meta retired the page_impressions_*_unique and post_impressions_*_unique metrics. Because the Graph API rejects an entire Insights request when any single requested metric is invalid, requesting them returned (#100) The value must be a valid insights metric and broke both insights streams — and, since the connection check queries page_insights, source setup as well. See Meta's deprecated metrics list.

Starting from version 2.1.2 the connector no longer requests them. Only total reach has a replacement; the paid, viral, non-viral, fan and organic reach breakdowns were retired with no equivalent and are permanently unavailable from the API.

StreamNo longer emittedReplacement
page_insightspage_impressions_uniquepage_total_media_view_unique
page_insightspage_impressions_paid_unique, page_impressions_viral_unique, page_impressions_nonviral_uniquenone
post_insightspost_impressions_uniquepost_total_media_view_unique
post_insightspost_impressions_paid_unique, post_impressions_fan_unique, post_impressions_organic_unique, post_impressions_viral_unique, post_impressions_nonviral_uniquenone

The stream schemas are unchanged, so no schema refresh is needed. Rows for the removed metrics simply stop arriving; clear the affected streams if you prefer a consistent history in your destination.

Product catalogs field not available​

Starting from version 2.0.4, the product_catalogs field is no longer synced in the Page stream and will always be null. This is because the Facebook Graph API only returns product catalogs that are owned directly by the Page, not catalogs owned by a Business. Since most product catalogs are now created as Business-owned catalogs (Page-owned catalogs are a legacy feature), and this connector uses Page access tokens, the product_catalogs field would not return meaningful data for most users.

Data type map​

Integration TypeAirbyte TypeNotes
stringstring
numbernumber
arrayarray
objectobject

Performance considerations​

Facebook heavily throttles API tokens generated from Facebook Apps by default, making it infeasible to use such a token for syncs with Airbyte. To be able to use this connector without your syncs taking days due to rate limiting, follow the instructions in the Setup Guide above to generate a Long-Lived Page Token.

Starting from version 3.0.2, the connector exchanges your token for a Page access token once per sync instead of before every Graph API request, so syncs make fewer API calls.

When Meta throttles a request, it reports how long until access returns in the X-Business-Use-Case-Usage response header, and the connector waits that long, up to 10 minutes, before retrying instead of retrying on a fixed schedule. Each extra stream and metric you enable adds to that usage, and the comment stream in particular makes one request per post.

The Graph API can report rate limits with HTTP 400 and an error code such as 4, 17, 32, 613, or 80001. Starting from version 2.1.3, the connector recognizes these codes, and any error Meta marks as transient, and retries the request with backoff instead of failing immediately. Retries are limited, so if your Page stays throttled long enough to exhaust them, the sync still fails with a transient error and succeeds on a later attempt once the quota resets.

See Facebook's documentation on rate limiting for the full list of codes and for information on requesting a quota upgrade.

IP allow list​

If you use Airbyte Cloud and your organization restricts access to specific IPs, add the Airbyte Cloud IP addresses to your allow list.

Reference​

Config fields reference

Field
Type
Property name
string
access_token
string
page_id
integer
page_size

Changelog​

Expand to review
VersionDatePull RequestSubject
3.3.02026-11-1090129Move from Graph API v24.0 to v26.0.
3.2.02026-11-0990124Add an optional incremental sync mode and a start_date setting to the page_insights stream, which reads a since and until date range in 90-day windows.
3.1.02026-11-0990123Configurable insights metrics and period, new video, Reels, comment and rating streams, incremental posts
3.0.22026-11-0990130Exchange the Page access token once per sync instead of before every request, and resolve the schema's date-time paths once per stream instead of per record
3.0.12026-11-0490914Require Python 3.11 for future CDK compatibility.
3.0.02026-10-1385780Remove the Meta-deprecated legacy Page fields current_location, genre, network, parking, and start_info, and the live_videos edge, from the page stream. Remove current_location, genre, and network from nested page objects in the page and post streams.
2.1.42026-09-2286489Retry Facebook's "Please reduce the amount of data you're asking for" error again instead of failing the sync as a configuration error.
2.1.32026-09-0878077Fail fast on deterministic Facebook API bad request errors as config errors, surface the Facebook error message, and keep retrying rate-limit and transient errors.
2.1.22026-08-1784408Remove Page/Post Insights metrics deprecated by Meta and request page_total_media_view_unique / post_total_media_view_unique instead; fail fast with Meta's own message on invalid-metric errors.
2.1.12026-05-2278342Classify Facebook app-approval errors as configuration errors.
2.1.02026-03-0272949Use QueryProperties with JsonSchemaPropertySelector to limit API field requests to user-selected fields; add configurable page_size for post and post_insights streams
2.0.42026-01-2972253Remove product_catalogs from fields request parameter
2.0.32025-12-0170248Use correct pagination parameter name (limit instead of page_size)
2.0.22025-12-0170258Use Post stream for check, handle 400 error in Page stream
2.0.12025-11-2770242Refresh in-app documentation to reflect v24 API version
2.0.02025-11-1969714Upgrade Facebook API to v24.0
1.1.42025-08-1464141Upgrade Facebook API to v23.0
1.1.32025-07-1260391Update dependencies
1.1.22025-05-1060043Update dependencies
1.1.12025-05-0353787Update dependencies
1.1.02025-04-3059126Re-enable in cloud and update versions
1.0.322025-02-0152793Update dependencies
1.0.312025-01-2752122Upgrade Facebook API to v21.0
1.0.302025-01-2552373Update dependencies
1.0.292025-01-1851637Update dependencies
1.0.282025-01-1151056Update dependencies
1.0.272025-01-0450923Update dependencies
1.0.262024-12-2850530Update dependencies
1.0.252024-12-2149997Update dependencies
1.0.242024-12-1449154Starting with this version, the Docker image is now rootless. Please note that this and future versions will not be compatible with Airbyte versions earlier than 0.64
1.0.232024-10-2947737Update dependencies
1.0.222024-10-2147025Update dependencies
1.0.212024-10-1246807Update dependencies
1.0.202024-10-0546461Update dependencies
1.0.192024-09-2846133Update dependencies
1.0.182024-09-2145734Update dependencies
1.0.172024-09-1445563Update dependencies
1.0.162024-09-0745311Update dependencies
1.0.152024-08-3145052Update dependencies
1.0.142024-08-2444664Update dependencies
1.0.132024-08-1744234Update dependencies
1.0.122024-08-1243729Update dependencies
1.0.112024-08-1043477Update dependencies
1.0.102024-08-0343224Update dependencies
1.0.92024-07-2742787Update dependencies
1.0.82024-07-2042255Update dependencies
1.0.72024-07-1341685Update dependencies
1.0.62024-07-1041543Update dependencies
1.0.52024-07-0941126Update dependencies
1.0.42024-07-0640812Update dependencies
1.0.32024-06-2540500Update dependencies
1.0.22024-06-2240058Update dependencies
1.0.12024-06-0639243[autopull] Upgrade base image to v1.2.2
1.0.02024-03-1436015Upgrade Facebook API to v19.0
0.3.02023-06-2627728License Update: Elv2
0.2.52023-04-1326939Add advancedAuth to the connector spec
0.2.42023-04-1325143Update insight metrics request params
0.2.32023-02-2323395Parse datetime to rfc3339
0.2.22023-02-1022804Retry 500 errors
0.2.12022-12-2920925Fix tests; modify expected records
0.2.02022-11-2419788Migrate lo low-code; Beta certification; Upgrade Facebook API to v.15
0.1.62021-12-229032Remove deprecated field live_encoders from Page stream
0.1.52021-11-268267updated all empty objects in schemas for Page and Post streams
0.1.42021-11-26Remove unsupported insights_export field from Pages request
0.1.32021-10-287440Generate Page token from config access token
0.1.22021-10-187128Upgrade Facebook API to v.12
0.1.12021-09-306438Annotate Oauth2 flow initialization parameters in connector specification
0.1.02021-09-015158Initial Release