Skip to content

Client

GenshinClient

The main client to interact with the Enka Network Genshin Impact API.

Parameters:

  • lang

    (Language | str, default: ENGLISH ) –

    The language to use for the client, defaults to Language.ENGLISH.

  • headers

    (dict[str, Any] | None, default: None ) –

    The headers to use for the client, defaults to None.

  • cache

    (BaseTTLCache | None, default: None ) –

    The cache to use for the client, defaults to None.

  • timeout

    (int, default: DEFAULT_TIMEOUT ) –

    The timeout for the client, defaults to DEFAULT_TIMEOUT.

  • auto_update_assets

    (bool, default: True ) –

    Whether to update assets when a response has data that is missing from them, defaults to True.

  • max_retries

    (int, default: DEFAULT_MAX_RETRIES ) –

    The number of times to retry a request when Enka or the game servers time out (504), defaults to DEFAULT_MAX_RETRIES, 0 disables retrying.

Methods:

Attributes:

lang property writable

lang: Language

fetch_builds async

fetch_builds(
    owner: Owner | OwnerInput,
) -> dict[str, list[Build]]

Fetch the character builds of the given owner.

Parameters:

Returns:

fetch_showcase async

fetch_showcase(
    uid: str | int,
    *,
    info_only: bool = False,
    raw: Literal[False] = False,
) -> ShowcaseResponse
fetch_showcase(
    uid: str | int,
    *,
    info_only: bool = False,
    raw: Literal[True] = True,
) -> dict[str, Any]
fetch_showcase(
    uid: str | int,
    *,
    info_only: bool = False,
    raw: bool = False,
) -> ShowcaseResponse | dict[str, Any]

Fetch the player showcase of the given UID.

Parameters:

  • uid

    (str | int) –

    The UID of the user.

  • info_only

    (bool, default: False ) –

    Whether to only fetch player info, defaults to False.

  • raw

    (bool, default: False ) –

    Whether to return the raw data, defaults to False.

Returns:

parse_showcase

parse_showcase(data: dict[str, Any]) -> ShowcaseResponse

Parse the given showcase data.

Parameters:

Returns:

start async

start() -> None

update_assets async

update_assets() -> None

Update game assets.