Registering the Facebook Application
Creating the Facebook Application
Log in to the Facebook account of the administrator for the Ad Account or Page which you will be primarily using for data extraction, and create the Facebook application as follows:
Navigate to https://developers.facebook.com/
Select My Apps → Create App:
Type the name for your new application and the main contact email:
Finish by clicking Create App ID.
Adding Products to the Application
Log in to https://developers.facebook.com/apps/ and select your application;
In the left pane click the plus sign next to Products:
Facebook Login
The primary product is Facebook Login which should be added to each Facebook application. As soon as you add any additional product, it is added automatically.
Marketing API
In order to use Ad Performance data, add the Marketing API product:

Select the corresponding tile and click Set Up;
You are navigated to the Marketing API dashboard;
Switch to Marketing API → Settings. Depending on your scenario, you may need to configure additional settings here, including Ads Management Standard Access to retrieve data from the Ad Accounts, which you do not manage. More information can be found in Facebook’s documentation.
Pages API
You do not need to add products in order to use the Facebook Pages API. You can query data from the Pages which you administer. Access to the data from other pages (public pages) requires additional configuration and application review from Facebook.