Facebook’s API Shows How It Shares Ad Data

Facebook is providing more insight into how it shares advertising data, with the launch of its Ads Archive application programming interface (API).

The “Ads Archive” was introduced last year, but lacked many of the features to carry out a large-scale analysis, including the download of data. However, the social media giant assured researchers: “We’re working closely with … stakeholders to launch an API for the archive.”

A small group of researchers was invited to test a beta version of the API Ad Library (as it’s now known) last August, with databases created using web browser extensions that upload ad data as users browse the site. One database is operated by advocacy group Who Targets Me (WTM), which collected a considerable amount of data before something changed.

“The first thing we noticed, around November, was that [Facebook] started hiring for all these anti-scraping positions,” said WTM Co-founder Louis Knight-Webb, according to the Financial Times (FT). He added that, by January, a change to the underlying code of Facebook ads prohibited the WTM browser extension from automatically capturing data.

Facebook’s Director of Product Management Rob Leathern said on Twitter that the change was to prevent “people’s data from being misused.”

Knight-Webb, however, wasn’t buying that excuse. “[WTM’s] value beyond the Ad Archive was that we gave you that data,” he said. “When we lost that, researchers and journalists lost the ability to see why certain interests or demographics are being targeted.”

The following month, the Mozilla Foundation published an open letter to the social media site, demanding that it boost transparency around political advertising. Within hours, Leathern responded on Twitter that the API would be made publicly accessible “in late March.” The author of the FT article was one of the people who received an invite to gain access to the API.

“Having provided my passport and home address, received a verification code through the post and activated two-factor authentication on my Facebook account, I was informed that my identity had been confirmed. Some 130 lines of Python code later, I was able to sit back and watch the text of thousands of ads stream down my laptop screen,” wrote Journalist David Blood.

He continued, “Through the API, I am now able to retrieve data on millions of ads, reaching countries including the U.S., India and the 28 EU member states. In the case of the U.K., this amounts to 51,000 ads since October 2018 alone, though this falls some way short of the 82,000 Facebook reports to be in the archive. A spokesperson confirmed the company is working to resolve a bug impacting retrieval of the full database.”