Skip to content

Wrapper for Genshin Impact user statistics and game items and characters data.

Notifications You must be signed in to change notification settings

sawa-ko/genshin-stats

Repository files navigation

Genshin Impact Stats

This package can obtain a player's information from Genshin Impact, such as their stats, characters earned, character level and more. Also, thanks to the Genshin Db package, the package has more options to obtain information about Genshin impact characters, weapons, artifacts, etc. with a solid and updated database.

Installation

npm

npm i genshin-stats

yarn

yarn add genshin-stats

Game information - User guide

The available methods are listed below:

  1. getCharacter
  2. getTalents
  3. getConstellations
  4. getWeapons
  5. getWeaponMaterialTypes
  6. getTalentMaterialTypes
  7. getArtifacts
  8. getFoods
  9. getElements

Example

import { GameInfo } from 'genshin-stats';

const data = new GameInfo();
await data.getCharacter('amber');

User statistics - User guide

The client to obtain the user information of a Genshin Impact player takes 2 parameters in its configuration. The parameters required in the configuration are listed below.

  1. account_id - This parameter is the user uid linked to the access token that is generated when a user logs in to Hoyolab. It is necessary to enter the correct one because the token will work only if the correct uid is entered.
  2. token - The token gives access to get the Genshin Impact API information, this token is generated when a user logs into Hoyolab and can be obtained from the Cookies section, also the account_id parameter can be found there.

To obtain these parameters it is necessary to follow the instructions listed below:

1. Login to Hoyolab

2. Press the F12 key in the browser and click on the Application tab.

3. Go to the category Storage, open the option Cookies and open the option called https://www.hoyolab.com/.

4. Find the ltoken and account_id field and copy its value.

The ltoken field is the token mentioned above.

Once this data is obtained, it will be introduced in the client's options to obtain the user's statistics.

Example

import { UserStats } from 'genshin-stats';

const data = new UserStats({ account_id: 'account_id', token: 'ltoken' });

Important note

This data may expire, so be sure to update it when necessary.

About

Wrapper for Genshin Impact user statistics and game items and characters data.

Resources

Stars

Watchers

Forks

Packages

No packages published