Douyin TikTok Download API
Find a file
vndangkhoa c9aa05f333
Some checks failed
CodeQL / Analyze (push) Waiting to run
Translate README / build (push) Waiting to run
Publish Docker image / main (push) Failing after 0s
fix: remove build section from docker-compose for NAS pull-only deployment, update TZ
2026-02-20 20:28:02 +07:00
.github 🐱Update issue templates 2022-12-02 02:45:37 -08:00
app Enhance download functionality to support Bilibili: added video and audio merging, updated API to handle Bilibili URLs, and improved error handling. Updated documentation to reflect new features and parameters. 2025-09-02 00:03:14 +08:00
bash 🐛: 更新安装脚本 2024-05-01 07:24:59 -07:00
chrome-cookie-sniffer 在hybrid_parsing下添加了update-cookie接口,添加了一个chrome扩展程序cookie-sniffer,现在只支持抖音的cookie抓取,如果出现更新会自动回调配置的webhook地址,动态更新update-cookie 2025-08-30 01:40:36 +08:00
crawlers Enhance download functionality to support Bilibili: added video and audio merging, updated API to handle Bilibili URLs, and improved error handling. Updated documentation to reflect new features and parameters. 2025-09-02 00:03:14 +08:00
daemon 🐛: 修复部署脚本 2024-04-27 15:36:00 -07:00
logo Add files via upload 2022-09-05 15:29:50 -07:00
Screenshots Add files via upload 2022-11-14 17:40:40 -08:00
.gitignore 🐛: 修复一些小bug 2024-04-23 09:29:21 -07:00
config.yaml chore: update port to 8456, configure Docker for NAS deployment 2026-02-20 20:18:30 +07:00
deploy.ps1 chore: update port to 8456, configure Docker for NAS deployment 2026-02-20 20:18:30 +07:00
docker-compose.yml fix: remove build section from docker-compose for NAS pull-only deployment, update TZ 2026-02-20 20:28:02 +07:00
Dockerfile chore: update port to 8456, configure Docker for NAS deployment 2026-02-20 20:18:30 +07:00
LICENSE 🎨: V4预览版本 2024-04-22 21:02:42 -07:00
Procfile 🐛: 修复一些小bug 2024-04-23 09:29:21 -07:00
README.en.md docs: Added README."en".md translation via https://github.com/dephraiim/translate-readme 2025-10-12 15:30:31 +00:00
README.md Update TikHub sponsor info and links in README files 2025-10-12 23:22:11 +08:00
requirements.txt 🔧: Use retry to increase stability of TikTok APP API 2024-09-16 00:08:51 -07:00
start.py 🐛: 修复部署脚本 2024-04-27 15:36:00 -07:00
start.sh 🐛: 修复一些小错误 2024-04-30 18:43:47 -07:00

Douyin_TikTok_Download_API(抖音/TikTok API)

English|Simplified Chinese

🚀"Douyin_TikTok_Download_API" is a high-performance asynchronous API that can be used out of the boxTik Tok|Tiktok|BiliableData crawling tool supports API calling, online batch analysis and downloading.

GitHub licenseRelease VersionGitHub StarGitHub ForkGitHub issuesGitHub closed issuesGitHub Repo size
PyPI vPyPI wheelPyPI dmPyPI pyversions
API statusTikHub-API status
爱发电KofiPatreon

Sponsor

These sponsors have paid to be placed here,Doinan_tics_download_apiThe project will always be free and open source. If you would like to become a sponsor of this project, please check out myGitHub Sponsor Page

TikHub IO_Banner zh

TickubbubProvides more than 700 endpoints that can be used to obtain and analyze data from 14+ social media platforms - including videos, users, comments, stores, products, trends, etc., complete all data access and analysis in one stop.

By checking in every day, you can get free quota. You can use my registration invitation link:https://user.tikhub.io/users/signup?referral_code=1wRL8eQkor invitation code:1wRL8eQk, you can get it by registering and recharging$2Quota.

TickubbubThe following services are provided:

👻Introduction

🚨If you need to use a private server to run this project, please refer to:Deployment preparations,Docker deployment,One-click deployment

This project is based onPyWebIOspeedyHTTPX, fast and asynchronousTik Tok/TiktokData crawling tool, and realizes online batch parsing and downloading of videos or photo albums without watermarks, data crawling API, and iOS shortcut commands without watermark downloads through the Web. You can deploy or modify this project yourself to achieve more functions, or you can call it directly in your projectscraper.pyor install an existingpip packageAs a parsing library, it is easy to crawl data, etc.....

Some simple application scenarios:

Download prohibited videos, perform data analysis, download without watermark on iOS (withShortcut command APP that comes with iOSCooperate with the API of this project to achieve in-app downloads or read clipboard downloads), etc.....

🔊 V4 version notes

  • If you are interested in writing this project together, please add us on WeChatEvil0ctalNote: Github project reconstruction, everyone can communicate and learn from each other in the group. Advertising and illegal things are not allowed. It is purely for making friends and technical exchanges.
  • This project usesX-BogusAlgorithms andA_BogusThe algorithm requests the Web API of Douyin and TikTok.
  • Due to Douyin's risk control, after deploying this project, pleaseObtain the cookie of Douyin website in the browser and replace it in config.yaml.
  • Please read the document below before raising an issue. Solutions to most problems will be included in the document.
  • This project is completely free, but when using it, please comply with:Apache-2.0 license

🔖TikHub.io API

TikHub.ioProvides more than 700 endpoints that can be used to obtain and analyze data from 14+ social media platforms - including videos, users, comments, stores, products, trends, etc., complete all data access and analysis in one stop.

If you want to supportDoinan_tics_download_apiFor project development, we strongly recommend that you chooseTikHub.io

Features:

📦 Ready to use right out of the box

Simplify the use process and use the packaged SDK to quickly carry out development work. All API interfaces are designed based on RESTful architecture and are described and documented using OpenAPI specifications, with sample parameters included to ensure easier calling.

💰 Cost advantage

There are no preset package restrictions and no monthly usage thresholds. All consumption is billed immediately based on actual usage, and tiered billing is performed based on the user's daily requests. At the same time, free quotas can be obtained in the user backend through daily check-ins, and these free quotas will not expire.

Fast support

We have a large Discord community server, where administrators and other users will quickly reply to you and help you quickly solve current problems.

🎉Embrace open source

Part of TikHub's source code will be open sourced on Github, and it will sponsor authors of some open source projects.

Registration and use:

By checking in every day, you can get free quota. You can use my registration invitation link:https://user.tikhub.io/users/signup?referral_code=1wRL8eQkor invitation code:1wRL8eQk, you can get it by registering and recharging$2Quota.

🖥Demo site: I am very vulnerable...please do not stress test (·•᷄ࡇ•᷅ )

😾The online download function of the demo site has been turned off, and due to cookie reasons, Douyin's parsing and API services cannot guarantee availability on the Demo site.

🍔Web APP:https://douyin.wtf/

🍟API Document:https://douyin.wtf/docs

🌭tikub APU Docuration:https://api.tikhub.io/docs

💾iOS Shortcut (shortcut command):Shortcut release

📦Desktop downloader (recommended by warehouse):

⚗️Technology stack

/crawlers

  • Submit requests to APIs on different platforms and retrieve data. After processing, a dictionary (dict) is returned, and asynchronous support is supported.

/app/api

  • Get request parameters and useCrawlersThe related classes process the data and return it in JSON form, download the video, and cooperate with iOS shortcut commands to achieve fast calling and support asynchronous.

/app/web

  • usePyWebIOA simple web program created to process the values entered on the web page and then use themCrawlersThe related class processing interface outputs related data on the web page.

Most of the parameters of the above files can be found in the correspondingconfig.yamlModify in

💡Project file structure

./Douyin_TikTok_Download_API
├─app
│  ├─api
│  │  ├─endpoints
│  │  └─models
│  ├─download
│  └─web
│      └─views
└─crawlers
  ├─bilibili
  │  └─web  
  ├─douyin
  │  └─web
  ├─hybrid
  ├─tiktok
  │  ├─app
  │  └─web
  └─utils

Supported functions:

  • Batch parsing on the web page (supports Douyin/TikTok mixed parsing)
  • Download videos or photo albums online.
  • makepip packageConveniently and quickly import your projects
  • iOS shortcut commands to quickly call APIAchieve in-app download of watermark-free videos/photo albums
  • Complete API documentation (Demo/Demonstration)
  • Rich API interface:
    • Douyin web version API

      • Video data analysis
      • Get user homepage work data
      • Obtain the data of works liked by the user's homepage
      • Obtain the data of collected works on the user's homepage
      • Get user homepage information
      • Get user collection work data
      • Get user live stream data
      • Get the live streaming data of a specified user
      • Get the ranking of users who give gifts in the live broadcast room
      • Get single video comment data
      • Get the comment reply data of the specified video
      • Generate msToken
      • Generate verify_fp
      • Generate s_v_web_id
      • Generate X-Bogus parameters using interface URL
      • Generate A_Bogus parameters using interface URL
      • Extract a single user id
      • Extract list user id
      • Extract a single work id
      • Extract list work id
      • Extract live broadcast room number from list
      • Extract live broadcast room number from list
    • TikTok web version API

      • Video data analysis
      • Get user homepage work data
      • Obtain the data of works liked by the user's homepage
      • Get user homepage information
      • Get user home page fan data
      • Get user homepage follow data
      • Get user homepage collection work data
      • 获取用户主页搜藏数据
      • Get user homepage playlist data
      • Get single video comment data
      • Get the comment reply data of the specified video
      • Generate msToken
      • Generate ttwid
      • Generate X-Bogus parameters using interface URL
      • Extract a single user sec_user_id
      • Extract list user sec_user_id
      • Extract a single work id
      • Extract list work id
      • Get user unique_id
      • Get list unique_id
    • Bilibili web version API

      • Get individual video details
      • Get video stream address
      • Obtain user-published video work data
      • Get all favorites information of the user
      • Get video data in specified favorites
      • Get information about a specified user
      • Get comprehensive popular video information
      • Get comments for specified video
      • Get the reply to the specified comment under the video
      • Get the specified user's updates
      • Get real-time video barrages
      • Get specified live broadcast room information
      • Get live room video stream
      • Get the anchors who are live broadcasting in the specified partition
      • Get a list of all live broadcast partitions
      • Obtain video sub-p information through bv number

📦Call the parsing library (obsolete and needs to be updated):

💡PIPI https://pypi.org/project/douyin-tiktok-scraper/

Install the parsing library:pip install douyin-tiktok-scraper

import asyncio
from douyin_tiktok_scraper.scraper import Scraper

api = Scraper()

async def hybrid_parsing(url: str) -> dict:
    # Hybrid parsing(Douyin/TikTok URL)
    result = await api.hybrid_parsing(url)
    print(f"The hybrid parsing result:\n {result}")
    return result

asyncio.run(hybrid_parsing(url=input("Paste Douyin/TikTok/Bilibili share URL here: ")))

🗺️Supported submission formats:

💡Tip: Including but not limited to the following examples, if you encounter link parsing failure, please open a new oneissue

  • Douyin sharing password (copy in APP)
7.43 pda:/ 让你在几秒钟之内记住我  https://v.douyin.com/L5pbfdP/ 复制此链接打开Dou音搜索直接观看视频
  • Douyin short URL (copy within APP)
https://v.douyin.com/L4FJNR3/
  • Douyin normal URL (copy from web version)
https://www.douyin.com/video/6914948781100338440
  • Douyin discovery page URL (APP copy)
https://www.douyin.com/discover?modal_id=7069543727328398622
  • TikTok short URL (copy within APP)
https://www.tiktok.com/t/ZTR9nDNWq/
  • TikTok normal URL (copy from web version)
https://www.tiktok.com/@evil0ctal/video/7156033831819037994
  • Douyin/TikTok batch URL (no need to use matching separation)
https://v.douyin.com/L4NpDJ6/
https://www.douyin.com/video/7126745726494821640
2.84 nqe:/ 骑白马的也可以是公主%%百万转场变身https://v.douyin.com/L4FJNR3/ 复制此链接打开Dou音搜索直接观看视频
https://www.tiktok.com/t/ZTR9nkkmL/
https://www.tiktok.com/t/ZTR9nDNWq/
https://www.tiktok.com/@evil0ctal/video/7156033831819037994

🛰️API documentation

API documentation:

local:http://localhost/docs

Online:https://api.douyin.wtf/docs

API demo:

  • Crawl video data (TikTok or Douyin hybrid analysis)https://api.douyin.wtf/api/hybrid/video_data?url=[视频链接/Video URL]&minimal=false
  • Download videos/photo albums (TikTok or Douyin hybrid analysis)https://api.douyin.wtf/api/download?url=[视频链接/Video URL]&prefix=true&with_watermark=false

For more demonstrations, please see the documentation...

⚠️Preparation work before deployment (please read carefully):

💻Deployment (Method 1 Linux)

💡Tips: It is best to deploy this project to a server in the United States, otherwise strange BUGs may appear.

Recommended for everyone to useDigitaloceanserver, because you can have sex for free.

Use my invitation link to sign up and you can get a $200 credit, and when you spend $25 on it, I can also get a $25 reward.

My invitation link:

https://m.do.co/c/9f72a27dec35

Use script to deploy this project with one click

Start/stop service

  • Use the following commands to control running or stopping the service:
    • sudo systemctl start Douyin_TikTok_Download_API.service
    • sudo systemctl stop Douyin_TikTok_Download_API.service

Turn on/off automatic operation at startup

  • Use the following commands to set the service to run automatically at boot or cancel automatic run at boot:
    • sudo systemctl enable Douyin_TikTok_Download_API.service
    • sudo systemctl disable Douyin_TikTok_Download_API.service

Update project

  • When the project is updated, ensure that the update script is executed in the virtual environment and all dependencies are updated. Enter the project bash directory and run update.sh:
  • cd /www/wwwroot/Douyin_TikTok_Download_API/bash && sudo bash update.sh

💽Deployment (Method 2 Docker)

💡Tip: Docker deployment is the simplest deployment method and is suitable for users who are not familiar with Linux. This method is suitable for ensuring environment consistency, isolation and quick setup. Please use a server that can normally access Douyin or TikTok, otherwise strange BUG may occur.

Preparation

Before you begin, make sure Docker is installed on your system. If you haven't installed Docker yet, you can install it fromDocker official websiteDownload and install.

Step 1: Pull the Docker image

First, pull the latest Douyin_TikTok_Download_API image from Docker Hub.

docker pull evil0ctal/douyin_tiktok_download_api:latest

Can be replaced if neededlatestLabel the specific version you need to deploy.

Step 2: Run the Docker container

After pulling the image, you can start a container from this image. Here are the commands to run the container, including basic configuration:

docker run -d --name douyin_tiktok_api -p 80:80 evil0ctal/douyin_tiktok_download_api

Each part of this command does the following:

  • -d: Run the container in the background (detached mode).
  • --name douyin_tiktok_api : Name the containerdouyin_tiktok_api
  • -p 80:80将主机上的80端口映射到容器的80端口。根据您的配置或端口可用性调整端口号。
  • evil0ctal/douyin_tiktok_download_api: The name of the Docker image to use.

Step 3: Verify the container is running

Check if your container is running using the following command:

docker ps

This will list all active containers. Finddouyin_tiktok_api to confirm that it is functioning properly.

Step 4: Access the App

Once the container is running, you should be able to passhttp://localhostOr API client access Douyin_TikTok_Download_API. Adjust the URL if a different port is configured or accessed from a remote location.

Optional: Custom Docker commands

For more advanced deployments, you may wish to customize Docker commands to include environment variables, volume mounts for persistent data, or other Docker parameters. Here is an example:

docker run -d --name douyin_tiktok_api -p 80:80 \
  -v /path/to/your/data:/data \
  -e MY_ENV_VAR=my_value \
  evil0ctal/douyin_tiktok_download_api
  • -v /path/to/your/data:/data: Change the/path/to/your/dataDirectory mounted to the container/dataDirectory for persisting or sharing data.
  • -e MY_ENV_VAR=my_value: Set environment variables within the containerMY_ENV_VAR, whose value ismy_value

Configuration file modification

Most of the configuration of the project can be found in the following directories:config.yamlFile modification:

  • /crawlers/douyin/web/config.yaml
  • /crawlers/tiktok/web/config.yaml
  • /crawlers/tiktok/app/config.yaml

Step 5: Stop and remove the container

When you need to stop and remove a container, use the following commands:

# Stop
docker stop douyin_tiktok_api 

# Remove
docker rm douyin_tiktok_api

📸Screenshot

API speed test (compared to official API)

🔎点击展开截图

Douyin official API:

API of this project:

TikTok official API:

API of this project:


Project interface

🔎点击展开截图

Web main interface:

Web main interface:


📜 Star History

Star History Chart

Apache-2.0 license

Start: 2021/11/06

Githubub:@Evil0ctal