Skip to main content

Facebook Pages

Facebook Pages API enables businesses to manage their Facebook business pages programmatically, allowing automated posting, content management, customer engagement, and analytics integration to streamline social media operations and enhance customer communication.

Facebook Pages icon

Power end-to-end data operations for your Facebook Pages API with Nexla. Our bi-directional Facebook Pages connector is purpose-built for Facebook Pages, making it simple to ingest data, sync it across systems, and deliver it anywhere — all with no coding required. Nexla turns API-sourced data into ready-to-use, reusable data products and makes it easy to send data to Facebook Pages or any other destination. With comprehensive monitoring, lineage tracking, and access controls, Nexla keeps your Facebook Pages workflows fast, secure, and fully governed.

Features

Type: API

SourceDestination

  • Seamless API Integration: Connect to any endpoint as source or destination without coding, with automatic data product creation
  • Visual Composition & Chaining: Build complex integrations using visual templates, chain API calls, and compose workflows with data validation and filtering
  • API Proxy: Expose curated slices of your data securely with a secure and customizable API proxy that validates and transforms data on the fly
  • Request optimization with intelligent batching, retry, and caching to minimize API calls and costs

Prerequisites

Before creating a Facebook Pages credential, you need to obtain a System User Access Token from your Facebook Business account. Optionally, you may also need a Page Access Token for certain page-specific operations. The System User Access Token is required to authenticate with the Facebook Pages API.

To obtain your System User Access Token, you need to have a Facebook Business account with API access enabled and a System User configured. Once you have access to your account, you can generate a System User Access Token from your Facebook Business Manager. The System User Access Token must have permissions to the Facebook resources you want to access. The access token is sent in the Authorization header with the Bearer prefix for all API requests to the Facebook Pages API. For certain page-specific operations, you may also need a Page Access Token. For a system user, this is a forever token that has to be generated once. You can use the Nexla template for fetching the page access token and update the credential. For detailed information about System User setup and authentication, refer to the Facebook Marketing API documentation.

Authenticate

Credentials required

FieldRequiredSecretDescription
System User Access TokenYesYesFacebook Access Token for Business Suite System User that has permissions to the facebook resources you want to access. View https://developers.facebook.com/docs/marketing-api/system-users/overview for details.
Page Access TokenNoYesFacebook Page Access Token that grants permission for actions on this page. For a system user this is a forever token that has to be generated once. You can use Nexla template for fetching the page access token and update the credential.

Create a credential in Nexla

  1. After selecting the data source/destination type, click the Add Credential tile to open the Add New Credential overlay.

New Credential Overlay – Facebook Pages

FacebookPagesCred.png
  1. Enter a name for the credential in the Credential Name field and a short, meaningful description in the Credential Description field.

  2. Enter your Facebook System User Access Token in the System User Access Token field. This is the System User Access Token you obtained from your Facebook Business Manager. The System User Access Token must have permissions to the Facebook resources you want to access. The access token is sent in the Authorization header with the Bearer prefix (e.g., Bearer {token}) for all API requests to the Facebook Pages API.

    Keep your System User Access Token secure and do not share it publicly. The System User Access Token provides access to your Facebook Pages account and should be treated as sensitive information. The System User Access Token must have permissions to the Facebook resources you want to access. The access token is sent in the Authorization header with the Bearer prefix for all API requests to the Facebook Pages API. For detailed information about System User setup, obtaining access tokens, and managing permissions, see the Facebook Marketing API documentation.

  3. Optionally, enter your Facebook Page Access Token in the Page Access Token field. This is the Page Access Token that grants permission for actions on a specific page. For a system user, this is a forever token that has to be generated once. You can use the Nexla template for fetching the page access token and update the credential. The Page Access Token is used for certain page-specific operations that require page-level permissions.

    The Page Access Token is optional but may be required for certain page-specific operations. For a system user, this is a forever token that has to be generated once. You can use the Nexla template for fetching the page access token and update the credential. The Page Access Token grants permission for actions on a specific page. For detailed information about obtaining and managing page access tokens, see the Facebook Pages API documentation.

  4. Click the Save button at the bottom of the overlay. The newly added credential will now appear in a tile on the Authenticate screen during data source/destination creation.

Use as a data source

To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Select the Facebook Pages connector tile, then select the credential that will be used to connect to the Facebook Pages instance, and click Next; or, create a new Facebook Pages credential for use in this flow.

Endpoint templates

Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common Facebook Pages endpoints. Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below.

Fetch Page Information

This endpoint fetches information about a specific page. You can also use this endpoint to view the current page access token. Use this endpoint when you need to access page information, page data, or page attributes from your Facebook Pages account.

  • Enter the Page ID for which you want to fetch information in the Page ID field. This is the unique identifier of the Facebook page you want to fetch information for. The default value is 399554767050919 if not specified.

  • Enter the page attributes you want to fetch in the Page Attributes to Fetch field. This should be a comma-separated list of field names (e.g., id,about,name,description). Click on the documentation link to view all available fields. The default value is id,about if not specified.

  • Enter the Facebook API version in the API Version field. This is the Facebook API version to use for requests (e.g., v19.0). The default value is v19.0 if not specified.

  • The endpoint uses GET requests to https://graph.facebook.com/{api_version}/{page_id}?fields={fields} where {api_version} is the API Version, {page_id} is the Page ID, and {fields} is the Page Attributes to Fetch you provide. The endpoint URL is automatically constructed based on the Facebook Graph API base URL, the API version, the page ID, and the fields.
  • The endpoint does not use pagination and returns the complete page information in a single request.
  • The endpoint will return information for the specified page. The response data is extracted from the root-level object in the API response ($), and Nexla will process the entire response structure.

Page IDs can be found in your Facebook Business Manager or from the page URL. The Page Attributes to Fetch should be a comma-separated list of field names. Click on the documentation link to view all available fields. You can also use this endpoint to view the current page access token. The endpoint uses a static URL (iteration.type: static.url) and does not require pagination. The response data path is $, which extracts the entire root-level object from the API response. For detailed information about fetching page information and available fields, see the Facebook Graph API documentation.

Generate Page Access Token

This endpoint generates a Page Access Token for accessing page information using Facebook APIs. For a system user, this is a forever token that has to be generated once. You can use this Nexla template for fetching the page access token and update the credential. Use this endpoint when you need to generate a page access token for a specific page.

  • Enter the Page ID for which you want to generate an access token in the Page ID field. This is the unique identifier of the Facebook page for which you want to generate an access token.

  • The endpoint uses GET requests to https://graph.facebook.com/{page_id}?fields=access_token where {page_id} is the Page ID you provide. The endpoint URL is automatically constructed based on the Facebook Graph API base URL and the page ID.
  • The endpoint does not use pagination and returns the page access token in a single request.
  • The endpoint will return the page access token for the specified page. The response data is extracted from the root-level object in the API response ($), and Nexla will process the entire response structure.

Page IDs can be found in your Facebook Business Manager or from the page URL. For a system user, this is a forever token that has to be generated once. You can use this Nexla template for fetching the page access token and update the credential. The endpoint uses a static URL (iteration.type: static.url) and does not require pagination. The response data path is $, which extracts the entire root-level object from the API response. For detailed information about generating page access tokens, see the Facebook Pages API documentation.

Fetch Page Insights

This endpoint fetches insights for a Facebook Page. Click on documentation URL for available metrics and breakdowns. Use this endpoint when you need to access page performance metrics, analytics data, or insights information from your Facebook Pages account.

  • Enter the Page ID for which you want to fetch insights in the Page ID field. This is the unique identifier of the Facebook page for which you want to fetch insights. The default value is 399554767050919 if not specified.

  • Enter the metrics you want to fetch in the Metrics to Fetch field. This should be a comma-separated list of metric names (e.g., page_impressions_unique,page_views_total,page_engaged_users). Click on the documentation link to view all available metrics. The default value is page_impressions_unique,page_views_total,page_engaged_users if not specified.

  • Select the aggregation period from the Aggregation period dropdown menu. This is the period of aggregation for the metric. Available options are:

    • day: Daily aggregation (default)
    • week: Weekly aggregation
    • days_28: 28-day aggregation
    • month: Monthly aggregation
    • lifetime: Lifetime aggregation

    The default value is day if not specified.

  • Enter any other allowed request parameters in the Other Request Parameters field. This should be a comma-separated list of additional parameters for specifying date ranges and/or segmentation (e.g., &date_preset=yesterday). The default value is &date_preset=yesterday if not specified.

  • Enter the Facebook API version in the API Version field. This is the Facebook API version to use for requests (e.g., v19.0). The default value is v19.0 if not specified.

  • The endpoint uses GET requests to https://graph.facebook.com/{api_version}/{page_id}/insights?access_token={page_access_token}&metric={metric}&period={period}{other_params} where {api_version} is the API Version, {page_id} is the Page ID, {page_access_token} is the Page Access Token from the credential, {metric} is the Metrics to Fetch, {period} is the Aggregation period, and {other_params} is the Other Request Parameters you provide. The endpoint URL is automatically constructed based on the Facebook Graph API base URL and all the parameters.
  • The endpoint uses URL-based pagination, automatically fetching additional pages as needed. When a response includes a paging.next value, Nexla automatically uses it as the URL for the subsequent request to fetch the next page of results.
  • The endpoint will return insights for the specified page. The response data is extracted from the data array in the API response ($.data[*]), with each insight record processed individually.

Page IDs can be found in your Facebook Business Manager or from the page URL. The Metrics to Fetch should be a comma-separated list of metric names. Click on the documentation link to view all available metrics and breakdowns. The Page Access Token from your credential is automatically included in the request. The endpoint uses URL-based pagination (iteration.type: paging.next.url) through the paging.next mechanism. The response data path is $.data[*], which extracts all items from the data array in the API response. For detailed information about fetching page insights, available metrics, and breakdowns, see the Facebook Graph API documentation.

Once the selected endpoint template has been configured, click the Test button to the right of the endpoint selection menu to retrieve a sample of the data that will be fetched. Sample data will be displayed in the Endpoint Test Result panel on the right, allowing you to verify that the source is configured correctly before saving.

Manual configuration

Facebook Pages data sources can also be manually configured to ingest data from any valid Facebook Pages API endpoint, including endpoints not covered by the pre-built templates, chained API calls, or custom request parameters. Select the Advanced tab at the top of the configuration screen, and follow the instructions in Connect to Any API to configure the API method, endpoint URL, date/time and lookup macros, path to data, metadata, and request headers.

Facebook Pages API endpoints typically follow the pattern https://graph.facebook.com/{api_version}/{endpoint_path}, where {api_version} is the Facebook API version (e.g., v19.0). The endpoint requires System User Access Token authentication via the Authorization: Bearer {token} header, which is handled automatically by your credential configuration. For certain page-specific operations, a Page Access Token may also be required. For detailed information about Facebook Pages API endpoints, see the Facebook Pages API documentation.

Once all of the relevant settings have been configured, click the Create button in the upper right corner of the screen to save and create the new Facebook Pages data source. Nexla will now begin ingesting data from the configured endpoint and will organize any data that it finds into one or more Nexsets.