Skip to main content

支持抖音开放平台官方 OpenAPI 的命令行工具。

Project description

douyin-cli

✨douyin-cli

❤️开源不易,欢迎star⭐

📢声明

本项目是面向抖音开放平台官方 OpenAPI 的命令行工具,同时保留部分公开网页数据处理能力,仅用于测试和学习研究,禁止用于商业用途或任何非法用途。

任何用户直接或间接使用、传播本仓库内容时责任自负,本仓库的贡献者不对该等行为产生的任何后果负责。

如果相关方认为该项目的代码可能涉嫌侵犯其权利,请及时联系我删除相关代码

使用本仓库的内容即表示您同意本免责声明的所有条款和条件。如果你不接受以上的免责声明,请立即停止使用本项目。


🍬功能特性

  • 官方 OpenAPI:支持通过 douyin api 调用抖音开放平台官方接口
  • Token 获取:支持 client_token 与 OAuth access_token 获取流程
  • 通用请求:支持任意官方 OpenAPI 路径、查询参数、JSON body、表单和自定义请求头
  • 环境变量:支持 DOUYIN_CLIENT_KEYDOUYIN_CLIENT_SECRETDOUYIN_ACCESS_TOKEN
  • 命令行安装:通过 uv tool install . 安装为本机 douyin 命令
  • 兼容能力:保留旧版网页数据命令,适合已有脚本迁移

🚀快速开始

环境要求

  • Python 3.13
  • uv 0.9+
  • 抖音开放平台应用的 client_key / client_secret
  • Node.js(仅旧版网页数据命令需要)
  • aria2c(可选,仅旧版下载命令需要)

安装命令

uv tool install -e . # 开发者
uv tool install douyin-cli # 用户

官方 OpenAPI

# 获取 client_token
douyin api client-token \
  --client-key "$DOUYIN_CLIENT_KEY" \
  --client-secret "$DOUYIN_CLIENT_SECRET"

# 用 OAuth code 换 access_token
douyin api access-token \
  --client-key "$DOUYIN_CLIENT_KEY" \
  --client-secret "$DOUYIN_CLIENT_SECRET" \
  --code "授权码"

# 调用任意官方 OpenAPI 路径
douyin api request GET /oauth/userinfo/ \
  --token "$DOUYIN_ACCESS_TOKEN" \
  --param open_id=xxx

📖 详细使用说明请查看 USAGE.md

📊 技术栈

  • 运行时: Python 3.13
  • 命令行: Click
  • 官方接口: 抖音开放平台 OpenAPI
  • HTTP 客户端: niquests

Star History

Star History Chart

Project details


Download files

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

Source Distribution

douyin_cli-2026.5.28.2.tar.gz (35.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

douyin_cli-2026.5.28.2-py3-none-any.whl (42.7 kB view details)

Uploaded Python 3

File details

Details for the file douyin_cli-2026.5.28.2.tar.gz.

File metadata

  • Download URL: douyin_cli-2026.5.28.2.tar.gz
  • Upload date:
  • Size: 35.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for douyin_cli-2026.5.28.2.tar.gz
Algorithm Hash digest
SHA256 e1b6058ef1951eb227e4a375dae0c54c1090127a03b41f1553c31eb2f619379a
MD5 7b4d604a8a63325925982d6a2f24645a
BLAKE2b-256 c386ca56e0ecdcc34fc26842746089959fc4b31dcea526764aeaf20968743705

See more details on using hashes here.

File details

Details for the file douyin_cli-2026.5.28.2-py3-none-any.whl.

File metadata

  • Download URL: douyin_cli-2026.5.28.2-py3-none-any.whl
  • Upload date:
  • Size: 42.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for douyin_cli-2026.5.28.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7cbd3a7f7647c204904778aa13791872dc4cc079b0326a64b713b7938eae944b
MD5 4ac6b447b28fe15f2f696f05eeab2077
BLAKE2b-256 c8e096a1f56b593058612edd513f422728aa183d230fe6093d33ca59c4270059

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