Code Monkey home page Code Monkey logo

tiktok-api's Introduction

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.

LinkedIn Sponsor Me GitHub release (latest by date) Build Status GitHub Downloads Support Server

Thank you to our sponsors & advertisers

TikAPI TikAPI is a paid TikTok API service providing an full out-of-the-box solution for developers, trusted by 100+ companies. Learn more

Table 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.

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()
# If playwright doesn't work for you try to use selenium
# api = TikTokApi.get_instance(use_selenium=True)

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.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.getTrending

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

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

tiktok-api's People

Contributors

davidteather avatar hoylemd avatar vdemay avatar shiqwang avatar xodarap avatar crazygmr101 avatar c4l1c0 avatar schrobot avatar isaackogan avatar erhosen avatar olitomas avatar abhint avatar coloradohusky avatar josbraden avatar deus-developer avatar barakplasma avatar muffinfox avatar dependabot-preview[bot] avatar dereklowlind avatar dj2ball avatar zoopzorp avatar

Stargazers

Summsitup.eth avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.