Learn R Programming

lares (version 5.1.0)

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
)

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?

Value

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

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
# NOT RUN {
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