/aiotikpy

TikTok API for Python

Primary LanguagePythonMIT LicenseMIT

TikTok API

TikTok has no public API. TikPy is a light weight API, without the requirement of any browser sessions, to collect the public data available at www.tiktok.com. Collect trending posts, video metadata, user metadata, hashtags, music, related hashtags, related music and, download videos with the API. Everything is returned in a JSON object.

This has been rewritten to use aiohttp instead of requests to not block. Definition can be found here: #1

The original package can be found here: https://github.com/precog-recr/TikPy

Instlling

pip install git+https://github.com/OofChair/aiotikpy

Quick Start

from aiotikpy import API

api = API()
api.get_user_info('leenabhushan')

Documentation

get_user_info(name) Takes in user name, returns user information available on tiktok.com/@

get_user_videos(name) Takes user name, returns the first 10 videos available on tiktok.com/@

get_trending_posts() returns a list of trending posts.

get_video_info(url) Takes url of a video and returns video info.

get_hash_recommend_list(hashtag) Returns four related hashtags as lited on TikTok, of the input.

get_hash_videos(hashtag) Returns the first 10 videos related to a hashtag.

get_videos_from_music(music_id, name) Returns videos related to music.

get_music_recommend_list(music_id, name) Returns four related music recommendations as listed on TikTok.

download_video(url, post_name=None) if post_name is None, video is returned in the form of chunk. Else the video is saved with post_name.