facebookresearch / Ad-Library-API-Script-Repository

GitHub repository of commonly used python scripts that allows everyone to pull data via the Ad Library API
Other
213 stars 84 forks source link

Meta Ad Library API does not return any ad for some page and also not return same data as it shows on ads library #50

Open jatinadx opened 4 months ago

jatinadx commented 4 months ago

I have connected my application into Facebook Ad Library API using https calls. It is working fine on some pages. but in some other pages it does not return all pages ads or in some it does not return any! but when you take a look at the page itself in the Facebook Ad Library Website. It is showing the page ads. An example of this would be Hunger Games page which is at url https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=ALL&view_all_page_id=159746560708670&search_type=page&media_type=all and you can see that it is displaying more than 20 ads in the page but when you try to get its ads from the Ads Library API. it returns {"data":[]}

shaynak commented 4 months ago

The Ad Library API only provides data on ads that ran in the EU in the last year and ads about Social Issue, Election, and Politics ads outside the EU. That is the reason you may be seeing a discrepancy between the Ad Library and the Ad Library API. For more information, see https://www.facebook.com/ads/library/api

Also, the page you've provided shows that there are no ads in the Ad Library - I've attached an image of the page.

Screenshot 2024-05-04 at 2 03 56 PM
nvtuan305 commented 2 months ago

Did you find the solution @jatinadx ? I have the same problem. The result returns when searching in the Facebook Ads Library but no result when calling the API (I tried call the API directly)

Ad Library result

image

Ad Library API result

image

shaynak commented 1 month ago

Hi @nvtuan305, as I mentioned in the comment above, you are not getting any data back because the Ad Library API does not return results for ads that are not Social Issue, Elections, or Politics outside the EU. The ads in the search above were delivered to Vietnam and are not Social Issue, Elections, or Politics ads, so they will not be returned by the API.

nvtuan305 commented 1 month ago

Thank you for your information @shaynak . We're building an internal system to manage our Ads running on the Facebook platform. Using the Ads Library API, we can get the Ads information and do some of our business. However, we can not do that due to this limitation. Do you know why there is a difference between the search tool and Ads Library API? And any suggestion to get the Ads like the searching tool?