Skip to main content

Lund University Publications

LUND UNIVERSITY LIBRARIES

FBAdLibrarian

Schmøkel, Rasmus and Bossetta, Michael LU (2021)
Abstract
The FBAdLibrarian is a simple, command line tool that archives images from unique hyperlinks offered by the Facebook Ad Library API.

At the time of writing, Facebook permits the downloading of individual ad creatives such as images for academic research purposes. The Librarian assists researchers with this process. Users must have verified their identity with Facebook, received the appropriate access tokens for the API, and use this tool only for academic research purposes.

The Librarian works as follows. First, the Librarian takes the ad_snapshot_url of an ad and creates a unique hyperlink, using the researcher's access tokens. Then, the Librarian looks up each ad individually. If the ad includes an image, the Librarian... (More)
The FBAdLibrarian is a simple, command line tool that archives images from unique hyperlinks offered by the Facebook Ad Library API.

At the time of writing, Facebook permits the downloading of individual ad creatives such as images for academic research purposes. The Librarian assists researchers with this process. Users must have verified their identity with Facebook, received the appropriate access tokens for the API, and use this tool only for academic research purposes.

The Librarian works as follows. First, the Librarian takes the ad_snapshot_url of an ad and creates a unique hyperlink, using the researcher's access tokens. Then, the Librarian looks up each ad individually. If the ad includes an image, the Librarian saves the image to an output folder and names the image according to the post’s unique ad identification number (or "adlib_id"). If the ad includes an embedded video, the Librarian will pass over the ad, but it will document the adlib_id as a video in an accompanying "metadata.txt" file.

Prerequisites

Python 3 (Currently tested on 3.7 but might work on other versions)
Verified access to Facebook Ad Library
Output data from Facebook Ad Library in xlsx format with semi-colon seperator (other formats and seperators are not supported as of now)
(Less)
Please use this url to cite or link to this publication:
author
and
organization
publishing date
type
Non-textual form
publication status
published
subject
language
English
LU publication?
yes
id
77b5bbdd-244c-43ee-866a-df6ae5428a97
alternative location
https://github.com/schmokel/FBAdLibrarian
date added to LUP
2022-01-04 10:07:49
date last changed
2022-01-04 10:07:49
@misc{77b5bbdd-244c-43ee-866a-df6ae5428a97,
  abstract     = {{The FBAdLibrarian is a simple, command line tool that archives images from unique hyperlinks offered by the Facebook Ad Library API.<br/><br/>At the time of writing, Facebook permits the downloading of individual ad creatives such as images for academic research purposes. The Librarian assists researchers with this process. Users must have verified their identity with Facebook, received the appropriate access tokens for the API, and use this tool only for academic research purposes.<br/><br/>The Librarian works as follows. First, the Librarian takes the ad_snapshot_url of an ad and creates a unique hyperlink, using the researcher's access tokens. Then, the Librarian looks up each ad individually. If the ad includes an image, the Librarian saves the image to an output folder and names the image according to the post’s unique ad identification number (or "adlib_id"). If the ad includes an embedded video, the Librarian will pass over the ad, but it will document the adlib_id as a video in an accompanying "metadata.txt" file.<br/><br/>Prerequisites<br/><br/>Python 3 (Currently tested on 3.7 but might work on other versions)<br/>Verified access to Facebook Ad Library<br/>Output data from Facebook Ad Library in xlsx format with semi-colon seperator (other formats and seperators are not supported as of now)<br/>}},
  author       = {{Schmøkel, Rasmus and Bossetta, Michael}},
  language     = {{eng}},
  title        = {{FBAdLibrarian}},
  url          = {{https://github.com/schmokel/FBAdLibrarian}},
  year         = {{2021}},
}