The TikTok Research API Wrapper is a ToolKit built in R and Python to facilitate the use of TikTok Research API. Our Wrapper Toolkit supports the following endpoints: Videos, User Info, Video Comments, User Liked Videos, User Pinned Videos, User Followers, User Following, and Reposted Videos.
R and Python are among the most popular languages among researchers. The TikTok Research API Wrapper is a code package that provides an interface between your application and TikTok's research APIs for these two languages. This tutorial provides the basic information needed to use our wrapper and includes sample code for your reference.
- API version: 1.0.0
- 4.0.0
- Download the Git Wrapper
install_git("git@github.com:tiktok/tiktok-research-api-wrapper.git", , subdir = "tiktok-research-api-r")
- Usage
## IMPORT
library(TikTokResearchAPI)
qps <- 5
client_key <- 'Your_client_key'
client_secret <- 'Your_client_secret'
if (client_key == "" || client_secret == "") {
stop("CLIENT_KEY and CLIENT_SECRET environment variables must be set.")
}
## # Initialize the API client
research_api <- TikTokResearchAPI$new(client_key, client_secret, qps)
- 3.0.0
- Download the Git Wrapper
pip install TikTokResearchApi
- Usage
from tiktok_research_api import *
qps = 5 #rate limiter
client_key = os.getenv("CLIENT_KEY", "")
client_secret = os.getenv("CLIENT_SECRET", "")
# Initialize the API client
api = TikTokResearchAPI(client_key, client_secret, qps)
- If you want to report bugs or issues related to the wrapper, please contact us via Github Issues page.
Here are the detailed documentation for currently supported programming languages.
- R: please refer to tiktok-research-api-r/readme.MD
- Python: please refer to tiktok-research-api-python/readme.MD