apizero
极数本源 官方 Python SDK。一把 Key 调用商城全部接口,GET / POST 写法相同。
底层是 Rust 同步实现。返回值已经是对象,直接 r.title、r.video_url,不用再 JSON 序列化或反序列化。
安装
pip install apizero
import apizero
vd = apizero.key("sk_live_xxx")
不传 Key 时读取环境变量 APIZERO_KEY。申请 Key:https://apizero.cn/account/keys
参数从哪里来
每个接口的方法名、必填 / 可空字段、含义和示例,都来自线上页面,并带进 IDE 提示:
例如 video-parse 页上的 url(必填)、flat(可空),就是代码里的同名参数。
两种写法
写法一:一次传入(关键字或字典)
r = vd.video_parse(url="https://v.douyin.com/xxxx", flat=1)
# 或
r = vd.video_parse({"url": "https://v.douyin.com/xxxx", "flat": 1})
print(r.ok, r.title, r.video_url)
写法二:先赋值再取值
vd.video_parse.url = "https://v.douyin.com/xxxx"
vd.video_parse.flat = 1
print(vd.video_parse.ok, vd.video_parse.title, vd.video_parse.video_url)
两种写法等价。r.ok 为 True 表示网关 code == 0。失败看 r.msg、r.request_id。
其它接口同样:
r = vd.weather(city="北京")
r = vd.movie_box()
r = vd.api("video-parse", url="https://v.douyin.com/xxxx", flat=1)
Python 关键字如 from 写成 from_。
返回值
r.ok # 是否成功
r.code
r.msg
r.request_id
r.title # data 里的字段会提升到顶层
r.video_url
r.data # 也可以 r.data.title
r.json # 完整原始字典
维护
由 极数本源(ApiZero) 维护。
Metadata
Release files for apizero 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| apizero-0.1.1-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details for apizero-0.1.1-cp39-abi3-win_amd64.whl |
| apizero-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ x86-64 | Details for apizero-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
Total release size: 4.2 MB
Release files / apizero-0.1.1-cp39-abi3-win_amd64.whl
| Download URL | apizero-0.1.1-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
13073f781b57e2fd68b028e1885f859fd32a2002aa2f31d2478a1a7b4141c630
|
|
BLAKE2b-256 checksum How to use checksums |
a073fa86c39b3d8d0a5c720d37bc64ed888799facab5b4629dbec93113144909
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Release files / apizero-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | apizero-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 2.3 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
53d57fc4b1a5e44426067dc43f9d4f8b839a70c0ae75eec884fab3d49f3085fa
|
|
BLAKE2b-256 checksum How to use checksums |
291c536ebbb479ca9df88ab7eb8ecb2cc41876386a9f93d249e004c4b67e7582
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Security for apizero 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.