Ads-Library-API-Script-Repository is a set of code examples to help user/researchers understand how the Facebook Ads Library API works. It also provides a simple command-line interface(CLI) for users to easily use the Facebook Ads Library API.
Here's an example on how to use the CLI:
$ python fb_ads_library_api_cli.py -t {access_token} -f 'page_id,ad_snapshot_url,funding_entity,ad_delivery_start_time' -c 'CA' -s '.' -v count
It would count the number of all polictical ads in CA(Canada);
Note: please replace the '{access_token}' with your Facebook Developer access token.
Ads-Library-API-Script-Repository requires or works with
- Mac OS X or Linux or Window
- Python 3.0+
- Python Requests Library (installation)
- Python iso3166 Library (installation)
The script will query the Facebook Ads library API to get all the Ads Library information on the Facebook platform;
You can find the full documentation here: (--to-be-added--)
- Website: https://www.facebook.com/ads/library
- Report: https://www.facebook.com/ads/library/report
- API: https://www.facebook.com/ads/library/api
See the CONTRIBUTING file for how to help out.
Ads-Library-API-Script-Repository is licensed under the Facebook Platform License, as found in the LICENSE file.