fbGetAdAccount: Get ad account details by ID.

View source: R/fbGetAdAccount.R

fbGetAdAccountR Documentation

Get ad account details by ID.

Description

Load ad account details for a specific ad account or a vector of ad account IDs from Facebook Marketing API into R.

Usage

fbGetAdAccount(
  account_id = getOption("rfacebookstat.account_id"),
  fields = paste0("id,name,account_id,account_status,amount_spent,",
                  "created_time,balance,business_name,currency,owner,",
                  "timezone_name,disable_reason,spend_cap"),
  api_version = getOption("rfacebookstat.api_version"),
  username = getOption("rfacebookstat.username"),
  token_path = fbTokenPath(),
  access_token = getOption("rfacebookstat.access_token")
)

Arguments

account_id

Vector of one or more Facebook Ad Account IDs (with or without 'act_' prefix).

fields

Character string or vector of requested fields separated by comma. Default includes basic account info, status, spend and balance.

api_version

Current Facebook Marketing API version.

username

Your username on Facebook.

token_path

Path to directory with credentials.

access_token

Your Facebook API access token.

Value

Data frame (tibble) with ad account details.

Author(s)

Alexey Seleznev

Examples

## Not run: 
# Get details for a single account
acc <- fbGetAdAccount(account_id = "1090055510425474")

# Get details for multiple accounts
accs <- fbGetAdAccount(account_id = c("1090055510425474", "act_2090055510425474"))

## End(Not run)

rfacebookstat documentation built on Oct. 16, 2026, 1:08 a.m.