tk_posts: tk_posts

Description Usage Arguments Examples

View source: R/endpoints.R

Description

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)

Usage

1
2
3
4
5
6
7
8
9
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

1
2
3
4
5
6
7
8
9
## Not run: 

# 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)


## End(Not run)

benjaminguinaudeau/tiktokr documentation built on Jan. 17, 2021, 8:52 a.m.