Skip to content

Models

BaseBuild

Bases: BaseModel, Generic[C]

Represents a character build.

Attributes:

Name Type Description
id int

The build's ID.

name str

The build's name.

order Decimal

The build's order.

live bool

Whether the build is live.

character_id int

The build's character ID.

character C

The build's character data.

Build

Bases: BaseBuild[Character]

Represents a HSR build.

Attributes:

Name Type Description
id int

The build's ID.

name str

The build's name.

order Decimal

The build's order.

live bool

Whether the build is live.

character_id int

The build's character ID.

character C

The build's character data.

Character

Bases: BaseModel

Represents a character in HSR.

Attributes:

Name Type Description
level int

The character's level.

ascension Literal[0, 1, 2, 3, 4, 5, 6]

The character's ascension level.

id int

The character's ID.

traces list[Trace]

List of the character's traces (skills).

light_cone LightCone | None

The character's light cone (weapon).

relics list[Relic]

List of the character's relics.

eidolons list[Eidolon]

List of the character's eidolons.

eidolons_unlocked int

The number of unlocked eidolons.

is_assist bool

Whether the character is an assist character.

icon CharacterIcon

The character's icon.

name str

The character's name.

rarity Literal[4, 5]

The character's rarity.

element Element

The character's element (type.)

path Path

The character's path.

stats dict[StatType, Stat]

The character's stats.

enhanced bool

Whether the character's traces are enhanced.

highest_dmg_bonus_stat property

Character's highest damage bonus stat.

max_level property

Character's max level.

CharacterIcon

Bases: BaseModel

Represents a HSR character icon.

Attributes:

Name Type Description
character_id int

The character's ID.

card property

Character icon in card shape.

Provided by Project Yatta. e.g. https://api.yatta.top/hsr/assets/UI//avatar/medium/1001.png

gacha property

Character gacha splash art.

e.g. https://enka.network/ui/hsr/SpriteOutput/AvatarDrawCard/1001.png

round property

Character icon in round shape.

e.g. https://enka.network/ui/hsr/SpriteOutput/AvatarRoundIcon/1001.png

LightCone

Bases: BaseModel

Represents a light cone (weapon.)

Attributes:

Name Type Description
id int

The light cone's ID.

level int

The light cone's level.

ascension Literal[0, 1, 2, 3, 4, 5, 6]

The light cone's ascension level.

superimpose Literal[1, 2, 3, 4, 5]

The light cone's superimpose level.

name str

The name of the light cone.

stats list[Stat]

The stats of the light cone.

rarity Literal[3, 4, 5]

The rarity of the light cone.

icon LightConeIcon

The icon of the light cone.

path Path

The light cone's path.

max_level property

Light Cone's max level.

LightConeIcon

Bases: BaseModel

Represents a HSR light cone icon.

Attributes:

Name Type Description
light_cone_id int

The light cone's ID.

image property

Light cone icon image.

e.g. https://enka.network/ui/hsr/SpriteOutput/LightConeFigures/20000.png

item property

Light cone icon item.

Provided by Project Yatta. e.g. https://api.yatta.top/hsr/assets/UI//equipment/medium/20000.png

Player

Bases: BaseModel

Represents a HSR player.

Attributes:

Name Type Description
nickname str

The player's nickname.

signature str

The player's signature.

uid int

The player's UID.

level int

The player's level.

equilibrium_level int

The player's equilibrium level.

friend_count int

The number of friends the player has.

stats PlayerStats

The player's statistics.

PlayerStats

Bases: BaseModel

Represents the statistics of a HSR player.

Attributes:

Name Type Description
achievement_count int

The number of achievements the player has.

light_cone_count int

The number of light cones the player has.

character_count int

The number of characters the player has.

max_simulated_universe_world int | None

The maximum world completed in the simulated universe.

book_count int | None

The number of books the player has, added in game version 2.2

relic_count int | None

The number of relics the player has, added in game version 2.2

music_count int | None

The number of music tracks the player has, added in game version 2.2

Relic

Bases: BaseModel

Represents a relic in HSR.

Attributes:

Name Type Description
id int

The relic's ID.

level int

The relic's level.

type RelicType

The relic's type.

main_affix_id int

The ID of the main affix.

set_name str

The name of the relic set.

set_id int

The ID of the relic set.

stats list[Stat]

The stats of the relic.

sub_affix_list list[RelicSubAffix]

List of sub-stat information for the relic.

icon str

The icon of the relic.

rarity Literal[3, 4, 5]

The rarity of the relic.

main_stat property

The relic's main stat.

sub_stats property

The relic's sub-stats.

RelicSubAffix

Bases: BaseModel

Represents a relic's sub-stat information.

Attributes:

Name Type Description
id int

The ID of the sub-stat.

cnt int

The count of the sub-stat.

step int | None

The step of the sub-stat.

ShowcaseResponse

Bases: BaseModel

Represents a HSR showcase response.

Attributes:

Name Type Description
characters list[Character]

The characters in the showcase.

player Player

The player.

ttl int

The time to live of the response.

uid str

The UID of the showcase.

owner Owner | None

The owner of the showcase's account, if any.

Stat

Bases: BaseModel

Represents a HSR stat.

Attributes:

Name Type Description
type StatType

The type of the stat.

value float

The value of the stat.

name str

The name of the stat.

icon str

The icon of the stat.

formatted_value property

The formatted value of the stat.

is_percentage property

Whether the stat is a percentage stat.

Trace

Bases: BaseModel

Represents a character's trace (skill).

Attributes:

Name Type Description
id int

The trace's ID.

level int

The trace's level.

boosted bool

Whether the trace's level is boosted by an activated eidolon's effect.

icon str

The trace's icon.

max_level int

The trace's maximum level.

anchor str

The trace's anchor.

type TraceType

The trace's type.

boosted = False class-attribute instance-attribute

Whether the level of this trace is boosted by an activated eidolon's effect.