Learn R Programming

lares (version 5.1.4)

fb_posts: Facebook Page Posts API

Description

Connect to an API Graph's token of a given page and get posts, comments, shares, and reactions of n posts (with no limits).

Usage

fb_posts(
  token,
  n = 150,
  limits = 100,
  comments = FALSE,
  shares = FALSE,
  reactions = FALSE,
  api_version = "v13.0"
)

Value

data.frame with un-nested processed results fetched with API.

Arguments

token

Character. Valid access token with sufficient privileges. Visit the Facebook API Graph Explorer to acquire one.

n

Integer. How many most recent posts do you need?

limits

Integer. For each post, hoy many results do you need?

comments, shares, reactions

Boolean. Include in your query?

api_version

Character. Facebook API version

See Also

Other API: bring_api(), fb_accounts(), fb_ads(), fb_creatives(), fb_insights(), fb_post(), fb_process(), fb_rf(), fb_token(), li_auth(), li_profile(), queryGA(), slackSend()

Other Facebook: fb_accounts(), fb_ads(), fb_creatives(), fb_insights(), fb_post(), fb_process(), fb_rf(), fb_token()

Examples

Run this code
if (FALSE) {
token <- YOURTOKEN
# Query latest 10 posts and 50 comments for each
posts <- fb_posts(token, n = 10, limits = 50, comments = TRUE)
}

Run the code above in your browser using DataLab