facebook-ad-library-scraper
facebook-ad-library-scraper copied to clipboard
A Python scraper for the Facebook Ad Library, using the official Facebook Ad Library API.
It would read line 58, in for demo in ad['demographic_distribution']: KeyError: 'demographic_distribution' >>> Then the code would stop running, any way around this?
I get access token from: https://developers.facebook.com/tools/accesstoken ``` curl -G \ > -d "search_terms='california'" \ > -d "ad_type=POLITICAL_AND_ISSUE_ADS" \ > -d "ad_reached_countries=['US']" \ > -d "access_token=" \ > "https://graph.facebook.com/v7.0/ads_archive" ``` And...
Hello! Within the past few weeks, this has started only returning ads from 2021. Just wondering if anyone has noticed something similar? Could this be a change on Facebook's side?
File "fb_ad_lib_scraper.py", line 94, in 'impressions_max': ad['impressions']['upper_bound'], KeyError: 'upper_bound' I was trying to use your program, and after scraping 777/5000 ads, above error occurred.
hi minimax, I try to run the program, I am getting this error. PS D:\downloads\fbscrap> python .\fb_ad_lib_scraper.py 0%| | 0/100 [00:00
It appears Demographic distribution info is not included 100% of the time? Weird, but should catch that. Only seems to happen when searching `INACTIVE` ads.