[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-10246":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":25,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":44,"readmeContent":45,"aiSummary":46,"trendingCount":16,"starSnapshotCount":16,"syncStatus":47,"lastSyncTime":48,"discoverSource":49},10246,"TikTok-Api","davidteather\u002FTikTok-Api","davidteather","The Unofficial TikTok API Wrapper In Python","https:\u002F\u002Fdavidteather.github.io\u002FTikTok-Api",null,"Python",6425,1201,89,139,0,3,20,82,10,89.44,"MIT License",false,"main",true,[27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"api","download-tiktoks","hacktoberfest","python","tik","tiktok","tiktok-api","tiktok-automation","tiktok-compilations","tiktok-downloader","tiktok-python","tiktok-scraper","tiktok-signature","tiktok-trending-page","tiktokapi","tok","trending","2026-06-12 04:00:49","# Unofficial TikTok API in Python\n\nThis 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.\n\n[![DOI](https:\u002F\u002Fzenodo.org\u002Fbadge\u002F188710490.svg)](https:\u002F\u002Fzenodo.org\u002Fbadge\u002Flatestdoi\u002F188710490) [![LinkedIn](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white&style=flat-square)](https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fdavidteather\u002F) [![Sponsor Me](https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=Sponsor&message=%E2%9D%A4&logo=GitHub)](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Fdavidteather) [![GitHub release (latest by date)](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fv\u002Frelease\u002Fdavidteather\u002FTikTok-Api)](https:\u002F\u002Fgithub.com\u002Fdavidteather\u002FTikTok-Api\u002Freleases) [![GitHub](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Fdavidteather\u002FTikTok-Api)](https:\u002F\u002Fgithub.com\u002Fdavidteather\u002FTikTok-Api\u002Fblob\u002Fmain\u002FLICENSE) [![Downloads](https:\u002F\u002Fpepy.tech\u002Fbadge\u002Ftiktokapi)](https:\u002F\u002Fpypi.org\u002Fproject\u002FTikTokApi\u002F) ![](https:\u002F\u002Fvisitor-badge.laobi.icu\u002Fbadge?page_id=davidteather.TikTok-Api) [![Support Server](https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F783108952111579166.svg?color=7289da&logo=discord&style=flat-square)](https:\u002F\u002Fdiscord.gg\u002FyyPhbfma6f)\n\nThis 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.\n\n## Sponsors\n\nThese 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](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Fdavidteather).\n\n\u003Cdiv align=\"center\">\n    \u003Ca href=\"https:\u002F\u002Ftikapi.io\u002F?ref=davidteather\" target=\"_blank\">\n        \u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fdavidteather\u002FTikTok-Api\u002Fmain\u002Fimgs\u002Ftikapi.png\" width=\"100\" alt=\"TikApi\">\n        \u003Cdiv>\n            \u003Cb>TikAPI\u003C\u002Fb> is a paid TikTok API service providing a full out-of-the-box solution, making life easier for developers — trusted by 500+ companies.\n        \u003C\u002Fdiv>\n    \u003C\u002Fa>\n    \u003Cbr>\n    \u003Ca href=\"https:\u002F\u002Fwww.ensembledata.com\u002F?utm_source=github&utm_medium=githubpage&utm_campaign=david_thea_github&utm_id=david_thea_github\" target=\"_blank\">\n        \u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fdavidteather\u002FTikTok-Api\u002Fmain\u002Fimgs\u002FEnsembleData.png\" width=\"100\" alt=\"Ensemble Data\">\n        \u003Cb>\u003C\u002Fb>\n        \u003Cdiv>\n         \u003Cb>EnsembleData\u003C\u002Fb> is the leading API provider for scraping Tiktok, Instagram, Youtube, and more. \u003Cbr> Trusted by the major influencer marketing and social media listening platforms.\n        \u003C\u002Fdiv>\n    \u003C\u002Fa>\n    \u003Cbr>\n    \u003Ca href=\"https:\u002F\u002Ftikhub.io\u002F?utm_source=github&utm_medium=readme&utm_campaign=tiktok_api&ref=github_davidteather_tiktokapi\" target=\"_blank\">\n        \u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fdavidteather\u002FTikTok-Api\u002Fmain\u002Fimgs\u002Ftikhub.png\" width=\"100\" alt=\"TikHub API\">\n        \u003Cb>\u003C\u002Fb>\n        \u003Cdiv>\n         \u003Cb>TikHub API\u003C\u002Fb> offers 700+ endpoints for fetching and analyzing data from 14+ social media platforms\u003Cbr>including videos, users, comments, shops, products, and trends — all in one place.\n        \u003C\u002Fdiv>\n    \u003C\u002Fa>\n    \u003Cbr>\n    \u003Ca href=\"https:\u002F\u002Fzernio.com\u002F?utm_source=github&utm_medium=readme&utm_campaign=tiktok_api\" target=\"_blank\">\n        \u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fdavidteather\u002FTikTok-Api\u002Fmain\u002Fimgs\u002Fzernio.png\" width=\"100\" alt=\"Zernio\">\n        \u003Cb>\u003C\u002Fb>\n        \u003Cdiv>\n         \u003Cb>Zernio\u003C\u002Fb> — Skip TikTok's API review process. Publish videos, schedule posts, manage comments, and pull analytics through our pre-approved TikTok integration. Works with 13 other platforms too.\n        \u003C\u002Fdiv>\n    \u003C\u002Fa>\n    \u003Cbr>\n    \u003Ca href=\"https:\u002F\u002Fwww.webshare.io\u002F?referral_code=3x5812idzzzp\" target=\"_blank\">\n        \u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fdavidteather\u002FTikTok-Api\u002Fmain\u002Fimgs\u002Fwebshare.png\" width=\"100\" alt=\"Webshare Proxies\">\n        \u003Cb>\u003C\u002Fb>\n        \u003Cdiv>\n         \u003Cb>Cheap, Reliable Proxies: \u003C\u002Fb> Supercharge your web scraping with fast, reliable proxies. Try 10 free datacenter proxies today!\n        \u003C\u002Fdiv>\n    \u003C\u002Fa>\n\u003C\u002Fdiv>\n\n## Table of Contents\n\n- [Documentation](#documentation)\n- [Getting Started](#getting-started)\n  - [How to Support The Project](#how-to-support-the-project)\n  - [Installing](#installing)\n  - [Common Issues](#common-issues)\n- [Quick Start Guide](#quick-start-guide)\n  - [Examples](https:\u002F\u002Fgithub.com\u002Fdavidteather\u002FTikTok-Api\u002Ftree\u002Fmain\u002Fexamples)\n\n## Documentation\n\nYou can find the full documentation [here](https:\u002F\u002Fdavidteather.github.io\u002FTikTok-Api)\n\n## Getting Started\n\nTo get started using this API follow the instructions below.\n\n**Note:** If you want to learn how to web scrape websites check my [free and open-source course for learning everything web scraping](https:\u002F\u002Fgithub.com\u002Fdavidteather\u002Feverything-web-scraping)\n\n### How to Support The Project\n\n- Star the repo 😎\n- Consider [sponsoring](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Fdavidteather) me on GitHub\n- Send me an email or a [LinkedIn](https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fdavidteather\u002F) message telling me what you're using the API for, I really like hearing what people are using it for.\n- Submit PRs for issues :)\n\n### Installing\n\n**Note:** Installation requires python3.9+\n\nIf 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.\n\n```sh\npip install TikTokApi\npython -m playwright install\n```\n\nIf you would prefer a video walk through of setting up this package [YouTube video](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=-uCt1x8kINQ) just for that. (is a version out of date, installation is the same though)\n\nIf you want a quick video to listen for [TikTok Live](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=307ijmA3_lc) events in python.\n\n#### Docker Installation\n\nClone this repository onto a local machine (or just the Dockerfile since it installs TikTokApi from pip) then run the following commands.\n\n```sh\ndocker pull mcr.microsoft.com\u002Fplaywright:focal\ndocker build . -t tiktokapi:latest\ndocker run -v TikTokApi --rm tiktokapi:latest python3 your_script.py\n```\n\n**Note** this assumes your script is named your_script.py and lives in the root of this directory.\n\n### Common Issues\n\n- **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\n  - you may need a proxy to successfully scrape TikTok, I've made a [web scraping lesson](https:\u002F\u002Fgithub.com\u002Fdavidteather\u002Feverything-web-scraping\u002Ftree\u002Fmain\u002F002-proxies) explaining the differences of \"tiers\" of proxies, I've personally had success with [webshare's residential proxies](https:\u002F\u002Fwww.webshare.io\u002F?referral_code=3x5812idzzzp) (affiliate link), but you might have success on their free data center IPs or a cheaper competitor.\n\n- **Browser Has no Attribute** - make sure you ran `python3 -m playwright install`, if your error persists try the [playwright-python](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-python) quickstart guide and diagnose issues from there.\n\n- **API methods returning Coroutine** - many of the API's methods are async so make sure your program awaits them for proper functionality\n\n## Quick Start Guide\n\nHere's a quick bit of code to get the most recent trending videos on TikTok. There's more examples in the [examples](https:\u002F\u002Fgithub.com\u002Fdavidteather\u002FTikTok-Api\u002Ftree\u002Fmain\u002Fexamples) directory.\n\n**Note:** If you want to learn how to web scrape websites check my [free and open-source course for web scraping](https:\u002F\u002Fgithub.com\u002Fdavidteather\u002Fweb-scraping-with-reverse-engineering)\n\n```py\nfrom TikTokApi import TikTokApi\nimport asyncio\nimport os\n\nms_token = os.environ.get(\"ms_token\", None) # get your own ms_token from your cookies on tiktok.com\n\nasync def trending_videos():\n    async with TikTokApi() as api:\n        await api.create_sessions(ms_tokens=[ms_token], num_sessions=1, sleep_after=3, browser=os.getenv(\"TIKTOK_BROWSER\", \"chromium\"))\n        async for video in api.trending.videos(count=30):\n            print(video)\n            print(video.as_dict)\n\nif __name__ == \"__main__\":\n    asyncio.run(trending_videos())\n```\n\nTo directly run the example scripts from the repository root, use the `-m` option on python.\n\n```sh\npython -m examples.trending_example\n```\n\nYou can access the full data dictionary the object was created from with `.as_dict`. On a video this may look like\n[this](https:\u002F\u002Fgist.github.com\u002Fdavidteather\u002F7c30780bbc30772ba11ec9e0b909e99d). TikTok changes their structure from time to time so it's worth investigating the structure of the dictionary when you use this package.\n","该项目是一个非官方的TikTok API Python封装库，用于从TikTok获取数据。其核心功能包括获取热门内容、用户信息等，并支持下载视频等功能，但不支持通过API发布或上传内容至TikTok。技术特点上，它利用Python语言实现了对TikTok网站的数据抓取能力，且无需用户认证即可访问公开信息。适用于需要分析TikTok趋势、收集特定用户资料或是进行内容下载的研究者与开发者。",2,"2026-06-11 03:27:24","top_topic"]