Get TikToks from a given username/hashtag or music_id.

1. user (no known API-limit)

2. hashtag (API-limit of 2 000 tiktoks at a time)

3. music (API-limit of 2 000 tiktoks at a time)

4. trends (API-limit of 2 000 tiktoks at a time)

tk_posts(
  scope,
  query = "",
  n = 10000,
  start_date = lubridate::dmy("01-01-1900"),
  save_dir = NULL,
  verbose = T,
  ...
)

Arguments

scope

Character indicating the endpoint to scrape (must be "user", "hashtag", "music" or "trends")

query

Character indicating the username/hashtag/music_id to scrape

n

Numeric indicating the number of tiktoks to scrape

Examples

if (FALSE) { # Get posts with hashtags tk_posts(scope = "hashtag", query = "maincharacter", n = 100) # Get posts from user willsmith tk_posts(scope = "user", query = "willsmith", n = 50) }