Skip to main content

The Unofficial TikTok API Wrapper in Python 3.

Project description

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.

GitHub release (latest by date) Build Status GitHub PyPI - Downloads Downloads

Important Information

  • If this API stops working for any reason open an issue.

Getting Started

To get started using this api follow the instructions below.

Installing

If you need help installing or run into some error, please open an issue. I will try to help out as much as I can.

pip install TikTokApi

Quick Start Guide

Here's a quick bit of code to get the most recent trending on TikTok. There's more example in the examples directory.

from TikTokApi import TikTokApi
api = TikTokApi()

results = 10

trending = api.trending(results)

for tiktok in trending:
    # Prints the text of the tiktok
    print(tiktok['desc'])

print(len(trending))

Here's an example of what a tiktok dictionary looks like.

Detailed Documentation

The TikTok class
TikTokApi(self, debug=False)

debug - Enable this if you need some more output.

The Trending Method
# Where count is how many result you want
# Verbose is optional, default=0. Set it to 1 to get more information
api.trending(self, count=30, referrer="https://www.tiktok.com/@ondymikula/video/6756762109670477061")

count - this is how many trending Tiktoks you want to be returned.

Trending returns an array of dictionaries. Example structure here

The get_Video_By_Url Method
api.get_Video_By_Url(video_url, return_bytes=0)

video_url - The video you want to get url.

return_bytes - The default value is 0, when it is set to 1 the function instead returns the bytes from the video rather than just the direct url.

Built With

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

TikTokApi-3.0.0.1.tar.gz (4.8 kB view details)

Uploaded Source

File details

Details for the file TikTokApi-3.0.0.1.tar.gz.

File metadata

  • Download URL: TikTokApi-3.0.0.1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

File hashes

Hashes for TikTokApi-3.0.0.1.tar.gz
Algorithm Hash digest
SHA256 4fe5f1a7b2990732c52936d1d2a41709f24d42911233593c51e30e823a97e8c9
MD5 b5caa6cb95d262a6e9f989b4570105df
BLAKE2b-256 b91a066b3ffd23ddc972e1f863bf68dd320e38f18114cafcc42dfae416e5c15d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page