
Last chance! 50% off unlimited learning
Sale ends in
This returns all available FB ads for any account, campaign, or ad set id. For more information on Ad' API, go to the original documentaion
fb_ads(
token,
which,
start_date = Sys.Date() - 31,
end_date = Sys.Date(),
fields = NA,
api_version = "v11.0",
process = TRUE
)
Character. Valid access token with sufficient privileges. Visit the Facebook API Graph Explorer to acquire one.
Character vector. This is the accounts, campaigns, adsets,
or ads IDs to be queried. Remember: if report_level = "account"
, you must
start the ID with act_
.
Character. The first and last full day to report, in the
format "YYYY-MM-DD"
.
Character. The first and last full day to report, in the
format "YYYY-MM-DD"
.
Character, json format. Leave NA
for default fields.
Character. Facebook API version
Boolean. Process GET results to a more friendly format?
data.frame with un-nested processed results if process=TRUE
or
raw API results as list when process=FALSE
.
This function was based on FBinsightsR.
Other API:
bring_api()
,
fb_accounts()
,
fb_creatives()
,
fb_insights()
,
fb_posts()
,
fb_post()
,
fb_process()
,
fb_rf()
,
fb_token()
,
li_auth()
,
li_profile()
,
queryGA()
,
slackSend()
Other Facebook:
fb_accounts()
,
fb_creatives()
,
fb_insights()
,
fb_posts()
,
fb_post()
,
fb_process()
,
fb_rf()
,
fb_token()
# NOT RUN {
token <- YOURTOKEN
which <- act_ADACCOUNT
# Query all ads for "which" with results in the last 10 days
ads <- fb_accounts(YOURTOKEN, which, start_date = Sys.Date() - 10)
# }
Run the code above in your browser using DataLab