支持抖音开放平台官方 OpenAPI 的命令行工具。
Project description
✨douyin-cli
📢声明
本项目是面向抖音开放平台官方 OpenAPI 的命令行工具,同时保留部分公开网页数据处理能力,仅用于测试和学习研究,禁止用于商业用途或任何非法用途。
任何用户直接或间接使用、传播本仓库内容时责任自负,本仓库的贡献者不对该等行为产生的任何后果负责。
如果相关方认为该项目的代码可能涉嫌侵犯其权利,请及时联系我删除相关代码。
使用本仓库的内容即表示您同意本免责声明的所有条款和条件。如果你不接受以上的免责声明,请立即停止使用本项目。
🍬功能特性
- ✅ 官方 OpenAPI:支持通过
douyin api调用抖音开放平台官方接口 - ✅ Token 获取:支持
client_token与 OAuthaccess_token获取流程 - ✅ 通用请求:支持任意官方 OpenAPI 路径、查询参数、JSON body、表单和自定义请求头
- ✅ 环境变量:支持
DOUYIN_CLIENT_KEY、DOUYIN_CLIENT_SECRET、DOUYIN_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
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
douyin_cli-2026.5.28.1.tar.gz
(35.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file douyin_cli-2026.5.28.1.tar.gz.
File metadata
- Download URL: douyin_cli-2026.5.28.1.tar.gz
- Upload date:
- Size: 35.7 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b4865dc1634ca23e180a14ce7371be5987873aaad1d413ebb9770188170a531
|
|
| MD5 |
b66dd94a70dfab47c9ea567c05278ce1
|
|
| BLAKE2b-256 |
15ff78a2ba87fb1a7cfbfe561983d0d54fdeeeb82f47d0fa6a669af115e6e104
|
File details
Details for the file douyin_cli-2026.5.28.1-py3-none-any.whl.
File metadata
- Download URL: douyin_cli-2026.5.28.1-py3-none-any.whl
- Upload date:
- Size: 44.8 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a80b9270278f620358ed27e198ba5d9700aa6cb1b8c7855b5f369c4dcccce5c3
|
|
| MD5 |
f552720974812b26b0de692c6ccc5c8c
|
|
| BLAKE2b-256 |
41653e3b06ba04d9c015be5b24b95f1bea28bed10af1779a9049954146a5f8ee
|