Skip to Content
VLRdevAPI

选手综合档案 (Player Profile)

获取选手的综合档案:单次调用整合个人资料、当前战队、招牌特工及曾用名。

player.profile(player_id) 返回整合了选手个人基本信息、当前效力战队以及招牌特工竞技统计的综合选手档案。

函数签名

player.profile(player_id: int) -> PlayerProfile

参数

Prop

Type

返回值 - PlayerProfile

Prop

Type

示例

查看选手完整综合档案

profile 方法是一个便捷整合接口,只需一次网络调用即可同时获取资料、当前战队与主力特工。

import vlrdevapi

profile = vlrdevapi.player.profile(player_id=438)
print(f"{profile.name} ({profile.real_name})")
print(f"国家/地区: {profile.country}")
team_name = profile.current_team.name if profile.current_team else "(自由人/无战队)"
print(f"所属战队: {team_name}")
print("主力特工:")
if profile.top_agents:
    for a in profile.top_agents[:3]:
        print(f"  {a.agent}: Rating {a.rating}, KD {a.kd}")
else:
    print("  (暂无特工数据)")

提取社交平台链接

import vlrdevapi

profile = vlrdevapi.player.profile(player_id=438)
print(f"X: {profile.x_handle} ({profile.x_link})")
print(f"Twitch: {profile.twitch_handle} ({profile.twitch_link})")

柯里化链式访问

import vlrdevapi

player = vlrdevapi.player(438)
profile = player.profile()
if profile.top_agents:
    best_agent = max(profile.top_agents, key=lambda a: a.rating or 0)
    print(f"{profile.name} 最拿手的特工: {best_agent.agent} (Rating {best_agent.rating})")

最后更新于

本页内容