抖音
抖音直播间 API
通过 web_rid 或 live.douyin.com 链接获取抖音直播间:直播状态、直播标题、观看人数和点赞数、封面、播放拉流地址以及主播主页信息。每次请求消耗 1 积分。
POST/api/v1/douyin/live/room
Authorizations
AuthorizationstringheaderrequiredBearer authentication header of the form Bearer <token>, where <token> is your Scavio API key (e.g. Bearer sk_live_your_key).
Body
application/jsonweb_ridstring直播间的 web_rid,即 live.douyin.com/<web_rid> 中的数字。与 live_room_url 二选一。
Example: 80017709309
live_room_urlstring完整的直播间链接,必须是绝对 URL。与 web_rid 二选一。
Example: https://live.douyin.com/80017709309
danmaku_typestring已弃用,传入也会被忽略。此接口不返回直播弹幕。
Request
from scavio import ScavioClient
client = ScavioClient(api_key="sk_live_your_key")
result = client.douyin.request("/api/v1/douyin/live/room", {"web_rid": "80017709309"})
room = result["data"]["room"]["data"][0]
print(room["status"] == 2, room["title"], room["user_count_str"])Response
},
"response_time": 1666
}