Facebook Marketing API allows advertisers to target audiences by demographic groups. Facebook ad campaigns have a three-level structure.
An R package fbRads is available to wrap the API and allow for analysis of potential audience that falls within specific targeting criteria.
Another R package allows to conduct quota sampling via Facebook advertisements: fbSample. This has been used in the paper: Quota Sampling Using Facebook Advertisements Can Generate Nationally Representative Opinion Estimates.
There are a few document that document how to set up an account to access the API for analysis purpose.
Step 1 : Goto the link ” https://developers.facebook.com/tools/explorer/” . This will open thee FB developer page.
Step 2: Change the API Version(Red box in the picture) to “unversioned”
Step 3: Click the “Get Access Token” (Green box in the picture).
Step 4: Check all the boxes in all three tabs. These are the permissions you are asking from yourself to access. Assuming you do not wish to hide anything from yourself, you can safely check all boxes.
Step 5 : Click on the button “Get Access Token”. This token is valid for 2 hours.
We can now see targeting categories linked to “live In”