> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keyapi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 通过sec_uid获取指定用户的直播流数据

> 通过sec_uid获取指定用户的直播流数据

<div className="inline-flex items-center gap-2 px-4 py-2 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg">
  <span className="text-base">🪙</span>
  <span className="text-sm font-medium text-yellow-900 dark:text-yellow-100"><span className="font-semibold">1 credit</span><span className="text-yellow-700 dark:text-yellow-300 ml-1">每次请求</span></span>
</div>

## Copy for AI

<div className="my-6 rounded-xl border border-gray-200 bg-gray-50 p-5 dark:border-gray-800 dark:bg-gray-900/40">
  <div className="min-w-0">
    <p className="text-base font-semibold text-gray-900 dark:text-gray-100">🤖 让 AI 帮你写调用代码</p>
    <p className="mt-1 text-sm text-gray-700 dark:text-gray-300">点击按钮复制一段结构化提示词，可直接交给 ChatGPT、Claude 或其他 AI 助手生成接口调用代码。</p>
  </div>

  <div className="mt-4">
    <button
      type="button"
      className="inline-flex items-center gap-2 rounded-md border border-emerald-300 bg-emerald-50 px-3 py-2 text-sm font-medium text-emerald-800 hover:bg-emerald-100 dark:border-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-100 dark:hover:bg-emerald-900/50"
      onClick={() => navigator.clipboard.writeText(`我需要调用以下 KeyAPI 接口，请根据提供的接口信息生成一份可直接运行的 Python 示例代码。

## 接口信息

Endpoint: GET https://api.keyapi.ai/v1/douyin/web/fetch_user_live_videos_by_sec_uid
Summary: 通过sec_uid获取指定用户的直播流数据

Required Headers:
- Authorization: Bearer <YOUR_API_KEY>

Parameters:
- sec_uid (Required): 用户sec_uid和sec_user_id一样，可以在用户主页链接中找到。例如：\`https://www.douyin.com/user/MS4wLjABAAAAgq8cb7cn9ByhZbmx-XQDdRTvFzmJeBBXOUO4QflP96M?from_tab_name=main\`. Example: MS4wLjABAAAAgq8cb7cn9ByhZbmx-XQDdRTvFzmJeBBXOUO4QflP96M


## 代码要求

- 使用 Python \`requests\` 库
- 提供完整、可直接运行的示例
- 处理 HTTP 请求异常、超时以及非 2xx 响应
- 处理 JSON 解析异常
- 示例参数优先使用接口信息中提供的 Example
- 保持代码简洁，避免不必要的封装和复杂设计
`)}
    >
      ✨ 复制给 AI
    </button>
  </div>
</div>


## OpenAPI

````yaml zh/douyin-web.zh.openapi.json GET /v1/douyin/web/fetch_user_live_videos_by_sec_uid
openapi: 3.0.1
info:
  title: Douyin Web API 中文文档
  description: Douyin Web API 的中文参考文档。
  version: 1.0.0
servers:
  - url: https://api.keyapi.ai
    description: Production
security:
  - JWT Bearer: []
tags: []
paths:
  /v1/douyin/web/fetch_user_live_videos_by_sec_uid:
    get:
      tags: []
      summary: 通过sec_uid获取指定用户的直播流数据
      description: 通过sec_uid获取指定用户的直播流数据
      parameters:
        - name: sec_uid
          in: query
          description: >-
            用户sec_uid和sec_user_id一样，可以在用户主页链接中找到。例如：`https://www.douyin.com/user/MS4wLjABAAAAgq8cb7cn9ByhZbmx-XQDdRTvFzmJeBBXOUO4QflP96M?from_tab_name=main`
          required: true
          example: MS4wLjABAAAAgq8cb7cn9ByhZbmx-XQDdRTvFzmJeBBXOUO4QflP96M
          schema:
            type: string
            example: MS4wLjABAAAAgq8cb7cn9ByhZbmx-XQDdRTvFzmJeBBXOUO4QflP96M
      responses:
        '200':
          description: 请求成功
          content:
            application/json:
              schema:
                type: object
                properties: {}
              example:
                code: 0
                message: success
                data:
                  data:
                    id: 66598046050
                    short_id: 653421556
                    nickname: 央视新闻
                    gender: 0
                    signature: 我用心，你放心
                    level: 0
                    birthday: 0
                    telephone: ''
                    avatar_thumb:
                      url_list:
                        - >-
                          https://p26.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-i-0813c000-ce_o4DvqC1g1AuZcraZiIMAy6aWBPEADBP84iAAx.jpeg?from=3067671334
                        - >-
                          https://p11.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-i-0813c000-ce_o4DvqC1g1AuZcraZiIMAy6aWBPEADBP84iAAx.jpeg?from=3067671334
                        - >-
                          https://p3.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-i-0813c000-ce_o4DvqC1g1AuZcraZiIMAy6aWBPEADBP84iAAx.jpeg?from=3067671334
                      uri: >-
                        100x100/aweme-avatar/tos-cn-i-0813c000-ce_o4DvqC1g1AuZcraZiIMAy6aWBPEADBP84iAAx
                      height: 0
                      width: 0
                      avg_color: ''
                      image_type: 0
                      open_web_url: ''
                      is_animated: false
                      flex_setting_list: []
                      text_setting_list: []
                    avatar_medium:
                      url_list:
                        - >-
                          https://p26.douyinpic.com/aweme/720x720/aweme-avatar/tos-cn-i-0813c000-ce_o4DvqC1g1AuZcraZiIMAy6aWBPEADBP84iAAx.jpeg?from=3067671334
                        - >-
                          https://p11.douyinpic.com/aweme/720x720/aweme-avatar/tos-cn-i-0813c000-ce_o4DvqC1g1AuZcraZiIMAy6aWBPEADBP84iAAx.jpeg?from=3067671334
                        - >-
                          https://p3.douyinpic.com/aweme/720x720/aweme-avatar/tos-cn-i-0813c000-ce_o4DvqC1g1AuZcraZiIMAy6aWBPEADBP84iAAx.jpeg?from=3067671334
                      uri: >-
                        720x720/aweme-avatar/tos-cn-i-0813c000-ce_o4DvqC1g1AuZcraZiIMAy6aWBPEADBP84iAAx
                      height: 0
                      width: 0
                      avg_color: ''
                      image_type: 0
                      open_web_url: ''
                      is_animated: false
                      flex_setting_list: []
                      text_setting_list: []
                    avatar_large:
                      url_list:
                        - >-
                          https://p3.douyinpic.com/aweme/1080x1080/aweme-avatar/tos-cn-i-0813c000-ce_o4DvqC1g1AuZcraZiIMAy6aWBPEADBP84iAAx.jpeg?from=3067671334
                        - >-
                          https://p11.douyinpic.com/aweme/1080x1080/aweme-avatar/tos-cn-i-0813c000-ce_o4DvqC1g1AuZcraZiIMAy6aWBPEADBP84iAAx.jpeg?from=3067671334
                        - >-
                          https://p26.douyinpic.com/aweme/1080x1080/aweme-avatar/tos-cn-i-0813c000-ce_o4DvqC1g1AuZcraZiIMAy6aWBPEADBP84iAAx.jpeg?from=3067671334
                      uri: >-
                        1080x1080/aweme-avatar/tos-cn-i-0813c000-ce_o4DvqC1g1AuZcraZiIMAy6aWBPEADBP84iAAx
                      height: 0
                      width: 0
                      avg_color: ''
                      image_type: 0
                      open_web_url: ''
                      is_animated: false
                      flex_setting_list: []
                      text_setting_list: []
                    verified: true
                    experience: 0
                    city: ''
                    status: 1
                    create_time: 0
                    modify_time: 1787139152
                    secret: 0
                    share_qrcode_uri: 72a4000fe1b5d865c51b
                    income_share_percent: 0
                    badge_image_list:
                      - url_list: []
                        uri: ''
                        height: 16
                        width: 32
                        avg_color: ''
                        image_type: 1
                        open_web_url: ''
                        content:
                          name: ''
                          font_color: ''
                          level: 0
                          alternative_text: 荣誉等级0级勋章
                        is_animated: false
                        flex_setting_list: []
                        text_setting_list: []
                    follow_info:
                      following_count: 52
                      follower_count: 186396395
                      follow_status: 0
                      push_status: 0
                      remark_name: ''
                      follower_count_str: '0'
                      following_count_str: '0'
                      invalid_follow_status: false
                      follwer_count_display: ''
                      follower_count_str_desc: ''
                    pay_grade:
                      total_diamond_count: 0
                      name: ''
                      next_name: ''
                      level: 0
                      next_diamond: 0
                      now_diamond: 0
                      this_grade_min_diamond: 0
                      this_grade_max_diamond: 1
                      pay_diamond_bak: 0
                      grade_describe: ''
                      grade_icon_list: []
                      screen_chat_type: 0
                      new_im_icon_with_level:
                        url_list: []
                        uri: ''
                        height: 16
                        width: 32
                        avg_color: ''
                        image_type: 1
                        open_web_url: ''
                        is_animated: false
                        flex_setting_list: []
                        text_setting_list: []
                      new_live_icon:
                        url_list:
                          - >-
                            https://p11-webcast.douyinpic.com/img/webcast/aweme_pay_grade_2x_0.png~tplv-obj.image
                          - >-
                            https://p3-webcast.douyinpic.com/img/webcast/aweme_pay_grade_2x_0.png~tplv-obj.image
                        uri: webcast/aweme_pay_grade_2x_0.png
                        height: 12
                        width: 12
                        avg_color: ''
                        image_type: 1
                        open_web_url: ''
                        is_animated: false
                        flex_setting_list: []
                        text_setting_list: []
                      upgrade_need_consume: 0
                      next_privileges: ''
                      score: 0
                      grade_describe_shining: false
                      in_rebirth: false
                      grade_banner: ''
                    fans_club:
                      data:
                        club_name: ''
                        level: 0
                        user_fans_club_status: 0
                        badge:
                          icons:
                            '0':
                              url_list: []
                              uri: ''
                              height: 0
                              width: 0
                              avg_color: ''
                              image_type: 0
                              open_web_url: ''
                              is_animated: false
                              flex_setting_list: []
                              text_setting_list: []
                          title: ''
                        available_gift_ids: []
                        anchor_id: 0
                        badge_type: 0
                        user_guard_status: 0
                        guard_expired_time: 0
                        anchor_open_id: ''
                      prefer_data: {}
                    special_id: ''
                    real_time_icons: []
                    new_real_time_icons: []
                    top_vip_no: 0
                    user_attr:
                      is_muted: false
                      is_admin: false
                      is_super_admin: false
                      admin_privileges: []
                      is_chat_self_see: false
                    own_room:
                      room_ids:
                        - '7675686413492357928'
                      room_ids_str:
                        - '7675686413492357928'
                      room_ids_display:
                        - 1
                    pay_score: 0
                    ticket_count: 0
                    link_mic_stats: 1
                    display_id: cctvnews
                    with_commerce_permission: true
                    with_fusion_shop_entry: true
                    total_recharge_diamond_count: 0
                    verified_content: ''
                    top_fans: []
                    sec_uid: MS4wLjABAAAAgq8cb7cn9ByhZbmx-XQDdRTvFzmJeBBXOUO4QflP96M
                    user_role: 0
                    authentication_info:
                      custom_verify: ''
                      enterprise_verify_reason: 中央广播电视总台央视新闻官方抖音号
                      authentication_badge:
                        url_list:
                          - >-
                            https://p11-webcast.douyinpic.com/img/webcast/authentication_icon_02.png~tplv-obj.image
                          - >-
                            https://p3-webcast.douyinpic.com/img/webcast/authentication_icon_02.png~tplv-obj.image
                        uri: webcast/authentication_icon_02.png
                        height: 0
                        width: 0
                        avg_color: ''
                        image_type: 0
                        open_web_url: ''
                        is_animated: false
                        flex_setting_list: []
                        text_setting_list: []
                      level_list:
                        - 1
                        - 1
                      account_type_info:
                        account_type_map:
                          '1': true
                      account_cert_info: ''
                    authorization_info: 3
                    adversary_authorization_info: 1
                    poi_info:
                      is_poi_enabled: false
                      poi_id: 0
                      poi_name: ''
                      poi_id_str: ''
                      follower_count_permission: 1
                      white_user_permission: 0
                    media_badge_image_list: []
                    adversary_user_status: 1
                    commerce_webcast_config_ids: []
                    badge_image_list_v2:
                      - url_list: []
                        uri: ''
                        height: 16
                        width: 32
                        avg_color: ''
                        image_type: 1
                        open_web_url: ''
                        content:
                          name: ''
                          font_color: ''
                          level: 0
                          alternative_text: 荣誉等级0级勋章
                        is_animated: false
                        flex_setting_list: []
                        text_setting_list: []
                    location_city: ''
                    fans_group_info:
                      list_fans_group_url: >-
                        sslocal://webcast_lynxview?height=754&radius=8&gravity=bottom&type=popup&animation_type=present&url=https%3A%2F%2Flf-webcast-sourcecdn-tos.bytegecko.com%2Fobj%2Fbyte-gurd-source%2Fwebcast%2Fmono%2Flynx%2Fdouyin_lynx_fansclub%2Ftemplate%2Fpages%2Ffansclub%2Ffans_group%2Fuser%2Ftemplate.js&load_taro=0&fallback_url=sslocal%3A%2F%2Fwebcast_webview%3Furl%3Dhttps%253A%252F%252Flf-webcast-sourcecdn-tos.bytegecko.com%252Fobj%252Fbyte-gurd-source%252Fwebcast%252Fmono%252Flynx%252Fdouyin_lynx_fansclub%252Ftemplate%252Fpages%252Ffansclub%252Ffans_group%252Fuser%252Findex.html%26type%3Dpopup%26gravity%3Dbottom%26height%3D754%26radius%3D8%26load_taro%3D0
                    remark_name: ''
                    mystery_man: 1
                    web_rid: ''
                    desensitized_nickname: ''
                    j_accredit_info:
                      JAccreditBasic: 0
                      JAccreditAdvance: 0
                      JAccreditContent: 0
                      JAccreditLive: 0
                    subscribe:
                      is_member: false
                      level: 0
                      identity_type: 0
                      buy_type: 0
                      open: 0
                    is_anonymous: false
                    consume_diamond_level: 0
                    webcast_uid: >-
                      MS4wLjML1RSgKPOn1g3u_TAeRvaOmsHFvvTltH7hutTeAzyOQqzk-EtzpDSISHgVcbmRhPY
                    user_dress_info:
                      dress_wear_ids: []
                      dress_own_ids: []
                    public_area_oper_freq: 0
                    user_canceled: false
                    webcast_private: 0
                    can_view_webcast_private: 0
                    webcast_nick: ''
                    hide_by_room: 0
                    link_mask: 0
                    allow_be_located: false
                    allow_find_by_contacts: false
                    allow_others_download_video: false
                    allow_others_download_when_sharing_video: false
                    allow_share_show_profile: false
                    allow_show_in_gossip: false
                    allow_show_my_action: false
                    allow_strange_comment: false
                    allow_unfollower_comment: false
                    allow_use_linkmic: false
                    bg_img_url: ''
                    birthday_description: ''
                    birthday_valid: false
                    block_status: 0
                    comment_restrict: 0
                    constellation: ''
                    disable_ichat: 0
                    enable_ichat_img: 0
                    exp: 0
                    fan_ticket_count: 0
                    fold_stranger_chat: false
                    follow_status: 0
                    hotsoon_verified: false
                    hotsoon_verified_reason: ''
                    ichat_restrict_type: 0
                    id_str: '66598046050'
                    is_follower: false
                    is_following: false
                    need_profile_guide: false
                    pay_scores: 0
                    push_comment_status: false
                    push_digg: false
                    push_follow: false
                    push_friend_action: false
                    push_ichat: false
                    push_status: false
                    push_video_post: false
                    push_video_recommend: false
                    verified_mobile: false
                    verified_reason: ''
                    with_car_management_permission: false
                    age_range: 0
                    watch_duration_month: 0
                    foreign_user: 0
                    bottom_entry:
                      status: 0
                      icon: ''
                      schema: >-
                        sslocal://webcast_redirect?entry=webcast_privilege_honor_level_lynx&url_query=page_from%3Dliveroom_toolbar
                      mystery_man: false
                      grade_level: 0
                      hide_grade_level: false
                    user_open_id: ''
                  extra:
                    now: 1787140486850
                  status_code: 0
                requestId: 2c59c78f-a0fc-4adc-8201-d801a05b8412
          headers: {}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '402':
          $ref: '#/components/responses/402'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      deprecated: false
      security:
        - JWT Bearer: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.keyapi.ai/v1/douyin/web/fetch_user_live_videos_by_sec_uid?sec_uid=MS4wLjABAAAAgq8cb7cn9ByhZbmx-XQDdRTvFzmJeBBXOUO4QflP96M' \
              --header 'Authorization: Bearer <YOUR_API_KEY>'
        - lang: python
          label: Python
          source: |-
            import requests

            response = requests.get(
                'https://api.keyapi.ai/v1/douyin/web/fetch_user_live_videos_by_sec_uid',
                params={"sec_uid": "MS4wLjABAAAAgq8cb7cn9ByhZbmx-XQDdRTvFzmJeBBXOUO4QflP96M"},
                headers={'Authorization': 'Bearer <YOUR_API_KEY>'}
            )
            print(response.json())
        - lang: javascript
          label: JavaScript
          source: >-
            const params = new URLSearchParams({"sec_uid":
            "MS4wLjABAAAAgq8cb7cn9ByhZbmx-XQDdRTvFzmJeBBXOUO4QflP96M"});


            const response = await
            fetch(`https://api.keyapi.ai/v1/douyin/web/fetch_user_live_videos_by_sec_uid?${params}`,
            {
              method: 'GET',
              headers: { 'Authorization': 'Bearer <YOUR_API_KEY>' }
            });

            const data = await response.json();

            console.log(data);
components:
  responses:
    '400':
      description: Bad Request
      content:
        application/json:
          schema:
            type: object
            example:
              code: 400
              data: null
              message: 'Missing required parameter: handle'
    '401':
      description: Unauthorized
      content:
        application/json:
          schema:
            type: object
            example:
              code: 401
              data: null
              message: apiKey is null
    '402':
      description: Payment Required
      content:
        application/json:
          schema:
            type: object
            example:
              code: 402
              data: null
              message: apiKey quota is not enough
    '429':
      description: Too Many Requests
      content:
        application/json:
          schema:
            type: object
            example:
              code: 429
              data: null
              message: qps limit exceeded
    '500':
      description: Internal Server Error
      content:
        application/json:
          schema:
            type: object
            example:
              code: 500
              data: null
              message: Internal server error
  securitySchemes:
    JWT Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |-
        接口鉴权凭证。请在请求 Header 中传入 `Authorization: Bearer <YOUR_API_KEY>`。
        可在 [Dashboard](https://keyapi.ai/app/dashboard) 获取你的 API Key。

````