Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.2%) to scientific vocabulary
Keywords
Repository
The Unofficial TikTok API Wrapper In Python
Basic Info
- Host: GitHub
- Owner: davidteather
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://davidteather.github.io/TikTok-Api
- Size: 27.6 MB
Statistics
- Stars: 5,678
- Watchers: 84
- Forks: 1,088
- Open Issues: 128
- Releases: 121
Topics
Metadata Files
README.md
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.
This api is designed to retrieve data TikTok. It can not be used post or upload content to TikTok on the behalf of a user. It has no support for any user-authenticated routes, if you can't access it while being logged out on their website you can't access it here.
Sponsors
These sponsors have paid to be placed here or are my own affiliate links which I may earn a commission from, and beyond that I do not have any affiliation with them. The TikTokAPI package will always be free and open-source. If you wish to be a sponsor of this project check out my GitHub sponsors page.
Trusted by the major influencer marketing and social media listening platforms.
Scale your TikTok automation and get unblocked with SadCaptcha.
Table of Contents
Documentation
You can find the full documentation here
Getting Started
To get started using this API follow the instructions below.
Note: If you want to learn how to web scrape websites check my free and open-source course for learning everything web scraping
How to Support The Project
- Star the repo 😎
- Consider sponsoring me on GitHub
- Send me an email or a LinkedIn message telling me what you're using the API for, I really like hearing what people are using it for.
- Submit PRs for issues :)
Installing
Note: Installation requires python3.9+
If you run into an issue please check the closed issues on the github, although feel free to re-open a new issue if you find an issue that's been closed for a few months. The codebase can and does run into similar issues as it has before, because TikTok changes things up.
sh
pip install TikTokApi
python -m playwright install
If you would prefer a video walk through of setting up this package YouTube video just for that. (is a version out of date, installation is the same though)
If you want a quick video to listen for TikTok Live events in python.
Docker Installation
Clone this repository onto a local machine (or just the Dockerfile since it installs TikTokApi from pip) then run the following commands.
sh
docker pull mcr.microsoft.com/playwright:focal
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
EmptyResponseException - this means TikTok is blocking the request and detects you're a bot. This can be a problem with your setup or the library itself
- you may need a proxy to successfuly scrape TikTok, I've made a web scraping lesson explaining the differences of "tiers" of proxies, I've personally had success with webshare's residential proxies (affiliate link), but you might have success on their free data center IPs or a cheaper competitor.
Browser Has no Attribute - make sure you ran
python3 -m playwright install, if your error persists try the playwright-python quickstart guide and diagnose issues from there.API methods returning Coroutine - many of the API's methods are async so make sure your program awaits them for proper functionality
Quick Start Guide
Here's a quick bit of code to get the most recent trending videos on TikTok. There's more examples in the examples directory.
Note: If you want to learn how to web scrape websites check my free and open-source course for web scraping
```py from TikTokApi import TikTokApi import asyncio import os
mstoken = os.environ.get("mstoken", None) # get your own ms_token from your cookies on tiktok.com
async def trendingvideos(): async with TikTokApi() as api: await api.createsessions(mstokens=[mstoken], numsessions=1, sleepafter=3, browser=os.getenv("TIKTOKBROWSER", "chromium")) async for video in api.trending.videos(count=30): print(video) print(video.asdict)
if name == "main": asyncio.run(trending_videos()) ```
To directly run the example scripts from the repository root, use the -m option on python.
sh
python -m examples.trending_example
You can access the full data dictionary the object was created from with .as_dict. On a video this may look like
this. TikTok changes their structure from time to time so it's worth investigating the structure of the dictionary when you use this package.
Owner
- Name: David Teather
- Login: davidteather
- Kind: user
- Location: Chicago, IL
- Company: @CrowdStrike
- Website: dteather.com
- Twitter: david_teather
- Repositories: 64
- Profile: https://github.com/davidteather
I like open source projects and making educational content | SWE @CrowdStrike
Citation (CITATION.cff)
cff-version: 1.2.0
authors:
- family-names: "Teather"
given-names: "David"
orcid: "https://orcid.org/0000-0002-9467-4676"
title: "TikTokAPI"
url: "https://github.com/davidteather/tiktok-api"
version: 7.1.0
date-released: 2025-04-13
GitHub Events
Total
- Create event: 5
- Commit comment event: 1
- Release event: 2
- Issues event: 31
- Watch event: 828
- Delete event: 3
- Issue comment event: 67
- Push event: 19
- Pull request review comment event: 7
- Pull request review event: 8
- Pull request event: 26
- Fork event: 141
Last Year
- Create event: 5
- Commit comment event: 1
- Release event: 2
- Issues event: 31
- Watch event: 828
- Delete event: 3
- Issue comment event: 67
- Push event: 19
- Pull request review comment event: 7
- Pull request review event: 8
- Pull request event: 26
- Fork event: 141
Committers
Last synced: almost 3 years ago
All Time
- Total Commits: 559
- Total Committers: 32
- Avg Commits per committer: 17.469
- Development Distribution Score (DDS): 0.567
Top Committers
| Name | Commits | |
|---|---|---|
| David Teather | 3****r@u****m | 242 |
| davidteather | d****r@u****m | 216 |
| Michael D. Hoyle | h****d@g****m | 21 |
| Vincent Demay | v****t@d****t | 17 |
| Thomas Zronek | t****s@z****t | 12 |
| shiqwang | s****g@g****m | 7 |
| Ben West | X****p@u****m | 5 |
| Reza Arifandie | r****e@g****m | 4 |
| Michelle Bao | m****o@M****l | 4 |
| Brian Schroeder | b****n@a****m | 3 |
| Daniel Nash | d****7@g****m | 3 |
| Óli Tómas | o****s@o****m | 2 |
| AR | a****a@h****t | 2 |
| Vladimir | e****n@g****m | 2 |
| Isaac K | 6****n@u****m | 2 |
| Coloradohusky | 4****y@u****m | 1 |
| Abhijith NT | a****4@g****m | 1 |
| J du Preez | d****n@z****m | 1 |
| Dylan Caponi | d****b@g****m | 1 |
| Michael Salaverry | b****a@g****m | 1 |
| MStudioBuildInc | 4****c@u****m | 1 |
| Josh Braden | j****n@g****m | 1 |
| Sid Shardanand | 5****y@u****m | 1 |
| Sam Hartmann | 4****y@u****m | 1 |
| ctaity | c****y@g****m | 1 |
| zoopzorp | 2****p@u****m | 1 |
| dereklowlind | d****d@g****m | 1 |
| dependabot-preview[bot] | 2****]@u****m | 1 |
| Yoav Zimmerman | y****n@g****m | 1 |
| dj2ball | 3****l@u****m | 1 |
| and 2 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 267
- Total pull requests: 76
- Average time to close issues: 8 months
- Average time to close pull requests: about 1 month
- Total issue authors: 242
- Total pull request authors: 40
- Average comments per issue: 4.92
- Average comments per pull request: 0.97
- Merged pull requests: 57
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 33
- Pull requests: 32
- Average time to close issues: 2 days
- Average time to close pull requests: about 2 months
- Issue authors: 30
- Pull request authors: 14
- Average comments per issue: 0.36
- Average comments per pull request: 0.59
- Merged pull requests: 22
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- upintheairsheep (4)
- lazezo2 (3)
- nedoai (3)
- lirankor (2)
- Tsuyoshisaito601 (2)
- ghost (2)
- tlament (2)
- M-Minkov (2)
- barripdmx (2)
- zakrian07 (2)
- Incher25 (2)
- davidteather (2)
- Popesites (2)
- AbubakrChan (2)
- leegunwoo98 (2)
Pull Request Authors
- davidteather (14)
- gbiz123 (6)
- bendavidsteel (5)
- leegunwoo98 (5)
- dronavallipranav (5)
- trislee (4)
- arhen (4)
- ekorian (4)
- joaovvbp (2)
- oxue (2)
- bgb10 (2)
- stephenarosaj (2)
- koki-ota0 (2)
- Ben3056 (2)
- lhphat02 (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 3
-
Total downloads:
- pypi 101,664 last-month
-
Total dependent packages: 0
(may contain duplicates) -
Total dependent repositories: 6
(may contain duplicates) - Total versions: 127
- Total maintainers: 2
pypi.org: tiktokapi
The Unofficial TikTok API Wrapper in Python 3.
- Homepage: https://github.com/davidteather/tiktok-api
- Documentation: https://tiktokapi.readthedocs.io/
- License: MIT
-
Latest release: 7.1.0
published 10 months ago
Rankings
Maintainers (1)
pypi.org: tiktokapi-pyppeteer
The Unofficial TikTok API Wrapper But Pyppeteer in Python 3.
- Homepage: https://github.com/davidteather/tiktok-api
- Documentation: https://tiktokapi-pyppeteer.readthedocs.io/
- License: MIT
-
Latest release: 3.7.9
published over 5 years ago
Rankings
Maintainers (1)
pypi.org: tiktokapisix
The Unofficial TikTok API Wrapper in Python 3.
- Homepage: https://github.com/davidteather/tiktok-api
- Documentation: https://tiktokapisix.readthedocs.io/
- License: MIT
-
Latest release: 7.0.0
published 11 months ago
Rankings
Maintainers (1)
Dependencies
- playwright *
- requests *
- selenium *
- selenium_stealth *
- requests *
- actions/checkout v2 composite
- actions/setup-python v2 composite
- microsoft/playwright-github-action v1 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- mcr.microsoft.com/playwright focal build