

GitHub - davidteather/TikTok-Api: The Unofficial TikTok API Wrapper In Python
source link: https://github.com/davidteather/TikTok-Api
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Unofficial TikTok API in Python
This is an unofficial api wrapper for TikTok.com in python. With this api you are able to call most trending and fetch specific user information as well as much more.
Sponsors (TikTokApi is free)
TikAPI is a paid TikTok API service providing an full out-of-the-box solution for developers, trusted by 100+ companies. Learn moreTable of Contents
Getting Started
To get started using this api follow the instructions below.
How to support the project
- Feel free to sponsor me on GitHub
- Feel free to tip the project using the brave browser
- Submit PRs for issues :)
Installing
If you run into an issue please check the closed issues on the github. You're most likely not the first person to experience this issue. If nothing works feel free to open an issue.
pip install TikTokApi python -m playwright install
If you would prefer a video walk through of setting up this package I created a YouTube video just for that.
If you're on MacOS you may need to install XCode Developer Tools
Docker Installation
Clone this repository onto a local machine then run the following commands.
docker build . -t tiktokapi:latest docker run -v TikTokApi --rm tiktokapi:latest python3 your_script.py
Note this assumes your script is named your_script.py and lives in the root of this directory.
Common Issues
Please don't open an issue if you're experiencing one of these just comment if the provided solution do not work for you.
- Browser Has no Attribute - make sure you ran
python3 -m playwright install
, if your error persists try the playwright quickstart guide and diagnose issues from there.
Quick Start Guide
Here's a quick bit of code to get the most recent trending on TikTok. There's more examples in the examples directory.
from TikTokApi import TikTokApi api = TikTokApi.get_instance() results = 10 # Since TikTok changed their API you need to use the custom_verifyFp option. # In your web browser you will need to go to TikTok, Log in and get the s_v_web_id value. trending = api.by_trending(count=results, custom_verifyFp="") for tiktok in trending: # Prints the id of the tiktok print(tiktok['id']) print(len(trending))
To run the example scripts from the repository root, make sure you use the module form of python the interpreter
python -m examples.get_trending
Here's an example of what a TikTok dictionary looks like.
Documentation
You can find the documentation here (you'll likely just need the TikTokApi section of the docs), I will be making this documentation more complete overtime as it's not super great right now, but better than just having it in the readme!
Authors
- David Teather - Initial work - davidteather
See also the list of contributors who participated in this project.
License
This project is licensed under the MIT License
Recommend
-
11
A 'modern 3D API' wrapper for WebGL Oct 24, 2016 This post is a bit of followup to Thoughts about a WebGL Next. (please excuse the partl...
-
11
TL;DR: This post shows why you probably should consider using “The Last API Wrapper” next time you need to get something from HTTP API. ...
-
6
OpenWeatherMap (After you’ve ruled out the difference between open_weather_map, open_weather and open-weather gems—the most recent is the latter): OpenWeather::Current.city...
-
10
-
10
Your ultimate Discord interactions library for discord.py. About |
-
6
GoHN — Hacker News API Wrapper for Go
-
4
TheMovieDB-API-Wrapper.js
-
10
David Stocker January 30, 2023 7 minute read...
-
4
A simple Python wrapper for the ChatGPT API OpenAI released an API for ChatGPT yesterday. It's 1/10th of the price of the text-davinci-003
-
4
PHP Wrapper for Telegram Bot API A lightweight object-oriented PHP wrapper for the Telegram Bot API with full support for all the telegram methods and types. See all availab...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK