import{_ as n,c as a,a as l,o as t}from"./app-CDdN0tOz.js";const e={};function o(p,s){return t(),a("div",null,s[0]||(s[0]=[l(`<h1 id="直播数据" tabindex="-1"><a class="header-anchor" href="#直播数据"><span>直播数据</span></a></h1><h2 id="获取直播场次的直播数据" tabindex="-1"><a class="header-anchor" href="#获取直播场次的直播数据"><span>获取直播场次的直播数据</span></a></h2><blockquote><p>https://api.live.bilibili.com/xlive/app-blink/v1/live/StopLiveData</p></blockquote><p><em>请求方法: GET</em></p><p>认证方式: Cookie (SESSDATA)</p><p>只能获取自己的直播数据。最好在直播结束时立即请求，否则直播时长可能不准确。</p><p><strong>URL参数：</strong></p><table><thead><tr><th>参数名</th><th>类型</th><th>内容</th><th>必要性</th><th>备注</th></tr></thead><tbody><tr><td>live_key</td><td>str</td><td>标记直播场次的key</td><td>必要</td><td>若不提供将会获得无效数据</td></tr></tbody></table><p><strong>json回复：</strong></p><p>根对象：</p><table><thead><tr><th>字段</th><th>类型</th><th>内容</th><th>备注</th></tr></thead><tbody><tr><td>code</td><td>num</td><td>返回值</td><td>0：成功<br>-101：未登录</td></tr><tr><td>message</td><td>str</td><td>提示信息</td><td>成功时为<code>&quot;0&quot;</code></td></tr><tr><td>ttl</td><td>num</td><td><code>1</code></td><td></td></tr><tr><td>data</td><td>obj</td><td>信息本体</td><td></td></tr></tbody></table><p><code>data</code> 对象：</p><table><thead><tr><th>字段</th><th>类型</th><th>内容</th><th>备注</th></tr></thead><tbody><tr><td>LiveTime</td><td>num</td><td>该直播场次的直播时长</td><td>单位:秒，直播结束后还会增长</td></tr><tr><td>AddFans</td><td>num</td><td>该直播场次的新增粉丝</td><td></td></tr><tr><td>HamsterRmb</td><td>num</td><td>该直播场次的收益</td><td></td></tr><tr><td>NewFansClub</td><td>num</td><td>该直播场次新获得粉丝勋章数量</td><td></td></tr><tr><td>DanmuNum</td><td>num</td><td>该直播场次的弹幕条数</td><td></td></tr><tr><td>MaxOnline</td><td>num</td><td>该直播场次的最大在线?</td><td>[需要验证]</td></tr><tr><td>WatchedCount</td><td>num</td><td>该直播场次的看过人数</td><td></td></tr></tbody></table><p><strong>示例：</strong></p><p>获取自己的直播数据</p><div class="language-shell line-numbers-mode" data-highlighter="shiki" data-ext="shell" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-shell"><span class="line"><span style="color:#DCDCAA;">curl</span><span style="color:#CE9178;"> &#39;https://api.live.bilibili.com/xlive/app-blink/v1/live/StopLiveData?live_key=634808443264569139&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#569CD6;">  -b</span><span style="color:#CE9178;"> &#39;SESSDATA=xxx&#39;</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div></div></div><details><summary>查看响应示例：</summary><div class="language-json line-numbers-mode" data-highlighter="shiki" data-ext="json" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-json"><span class="line"><span style="color:#D4D4D4;">{</span></span>
<span class="line"><span style="color:#9CDCFE;">  &quot;code&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">0</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">  &quot;message&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;0&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">  &quot;ttl&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">1</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">  &quot;data&quot;</span><span style="color:#D4D4D4;">: {</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;LiveTime&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">77603</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;AddFans&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">0</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;HamsterRmb&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">0</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;NewFansClub&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">0</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;DanmuNum&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">3</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;MaxOnline&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">13</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;WatchedCount&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">2</span></span>
<span class="line"><span style="color:#D4D4D4;">  }</span></span>
<span class="line"><span style="color:#D4D4D4;">}</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div></details><h2 id="获取直播表现" tabindex="-1"><a class="header-anchor" href="#获取直播表现"><span>获取直播表现</span></a></h2><blockquote><p>https://api.live.bilibili.com/xlive/app-blink/v1/date/Overview</p></blockquote><p><em>请求方法: GET</em></p><p>认证方式: Cookie (SESSDATA)</p><p><strong>json回复：</strong></p><p>根对象：</p><table><thead><tr><th>字段</th><th>类型</th><th>内容</th><th>备注</th></tr></thead><tbody><tr><td>code</td><td>num</td><td>返回值</td><td>0：成功<br>-101：未登录</td></tr><tr><td>message</td><td>str</td><td>提示信息</td><td>成功时为<code>&quot;0&quot;</code></td></tr><tr><td>ttl</td><td>num</td><td><code>1</code></td><td></td></tr><tr><td>data</td><td>obj</td><td>信息本体</td><td></td></tr></tbody></table><p><code>data</code> 对象：</p><table><thead><tr><th>字段</th><th>类型</th><th>内容</th><th>备注</th></tr></thead><tbody><tr><td>graph</td><td>arr</td><td>图表数据</td><td>在界面显示为雷达图</td></tr><tr><td>propose</td><td>null</td><td>(?)</td><td></td></tr></tbody></table><p><code>data.graph</code> 数组：</p><table><thead><tr><th>索引</th><th>类型</th><th>内容</th><th>备注</th></tr></thead><tbody><tr><td>0</td><td>obj</td><td>数据类别</td><td></td></tr><tr><td>…</td><td>obj</td><td>数据类别</td><td></td></tr></tbody></table><p><code>data.graph</code> 数组中对象：</p><table><thead><tr><th>字段</th><th>类型</th><th>内容</th><th>备注</th></tr></thead><tbody><tr><td>name</td><td>str</td><td>显示的名称</td><td></td></tr><tr><td>index</td><td>str</td><td>类别标识</td><td></td></tr><tr><td>me</td><td>num</td><td>自己在这个类别的数值</td><td></td></tr><tr><td>max</td><td>num</td><td>这个类别最外侧那条线的数值</td><td></td></tr><tr><td>aver</td><td>num</td><td>同水平主播在这个类别的数值</td><td></td></tr></tbody></table><p><strong>示例：</strong></p><p>获取自己的直播表现</p><div class="language-shell line-numbers-mode" data-highlighter="shiki" data-ext="shell" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-shell"><span class="line"><span style="color:#DCDCAA;">curl</span><span style="color:#CE9178;"> &#39;https://api.live.bilibili.com/xlive/app-blink/v1/date/Overview&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#569CD6;">  -b</span><span style="color:#CE9178;"> &#39;SESSDATA=xxx&#39;</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div></div></div><details><summary>查看响应示例：</summary><div class="language-json line-numbers-mode" data-highlighter="shiki" data-ext="json" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-json"><span class="line"><span style="color:#D4D4D4;">{</span></span>
<span class="line"><span style="color:#9CDCFE;">  &quot;code&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">0</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">  &quot;message&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;0&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">  &quot;ttl&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">1</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">  &quot;data&quot;</span><span style="color:#D4D4D4;">: {</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;graph&quot;</span><span style="color:#D4D4D4;">: [</span></span>
<span class="line"><span style="color:#D4D4D4;">      {</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;name&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;收益&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;index&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;income&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;me&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">0</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;max&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">9.27</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;aver&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">8.04</span></span>
<span class="line"><span style="color:#D4D4D4;">      },</span></span>
<span class="line"><span style="color:#D4D4D4;">      {</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;name&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;累计观看&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;index&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;watchedCount&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;me&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">5.13</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;max&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">7.01</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;aver&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">6.17</span></span>
<span class="line"><span style="color:#D4D4D4;">      },</span></span>
<span class="line"><span style="color:#D4D4D4;">      {</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;name&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;新增粉丝&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;index&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;fans&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;me&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">0</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;max&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">2.58</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;aver&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">0</span></span>
<span class="line"><span style="color:#D4D4D4;">      },</span></span>
<span class="line"><span style="color:#D4D4D4;">      {</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;name&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;用户平均观看时长&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;index&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;watchTime&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;me&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">9.31</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;max&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">11.82</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;aver&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">10.88</span></span>
<span class="line"><span style="color:#D4D4D4;">      },</span></span>
<span class="line"><span style="color:#D4D4D4;">      {</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;name&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;开播时长&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;index&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;broadcast&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;me&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">17.57</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;max&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">17.42</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;aver&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">16.6</span></span>
<span class="line"><span style="color:#D4D4D4;">      },</span></span>
<span class="line"><span style="color:#D4D4D4;">      {</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;name&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;弹幕数量&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;index&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;barrage&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;me&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">7.37</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;max&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">8.02</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;aver&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">6.91</span></span>
<span class="line"><span style="color:#D4D4D4;">      }</span></span>
<span class="line"><span style="color:#D4D4D4;">    ],</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;propose&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#569CD6;">null</span></span>
<span class="line"><span style="color:#D4D4D4;">  }</span></span>
<span class="line"><span style="color:#D4D4D4;">}</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div></details>`,34)]))}const r=n(e,[["render",o]]),c=JSON.parse('{"path":"/docs/live/live_data.html","title":"直播数据","lang":"zh-CN","frontmatter":{},"git":{"updatedTime":1755859507000,"contributors":[{"name":"pskdje","username":"pskdje","email":"77605497+pskdje@users.noreply.github.com","commits":1,"url":"https://github.com/pskdje"}],"changelog":[{"hash":"bdc05a371b42c983c4ab30390d81da60ccfc70ea","time":1755859507000,"email":"77605497+pskdje@users.noreply.github.com","author":"pskdje","message":"创建“直播数据”文档"}]},"filePathRelative":"docs/live/live_data.md"}');export{r as comp,c as data};
