# enka-network-api

> Enka-network API wrapper for Genshin Impact.

Latest version **5.1.2** (published 2026-08-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install enka-network-api
pnpm add enka-network-api
yarn add enka-network-api
bun add enka-network-api
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 5.1.2 |
| Published | 2026-08-18 |
| First published | 2022-10-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=16.0.0 |
| Dependencies | 5 |
| Unpacked size | 321.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 106 |
| Author | yuko1101 |
| Maintainers | yuko1101 |
| Keywords | nodejs, wrapper, node, node-js, nodejs-modules, wrapper-api, wrapper-library, genshin, genshin-impact, genshin-api, genshin-artifacts, enkanetwork, enka-network, enka |

## Links

- npm: https://www.npmjs.com/package/enka-network-api
- Repository: https://github.com/yuko1101/enka-network-api
- Homepage: https://enka-network-api.vercel.app
- Issues: https://github.com/yuko1101/enka-network-api/issues
- npm.io page: https://npm.io/package/enka-network-api

## Dependencies (5)

- [axios](https://npm.io/package/axios.md) ^1.4.0
- [yauzl](https://npm.io/package/yauzl.md) ^3.2.0
- [unzipper](https://npm.io/package/unzipper.md) ^0.12.3
- [enka-system](https://npm.io/package/enka-system.md) ^0.3.7
- [config_file.js](https://npm.io/package/config_file.js.md) ^1.4.1

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 5.1.2 (latest) — 2026-08-18
- 5.1.1 — 2026-08-11
- 5.1.0 — 2026-08-09
- 5.0.16 — 2026-06-30
- 5.0.15 — 2026-04-08
- 5.0.14 — 2026-01-12
- 5.0.13 — 2025-12-01
- 5.0.12 — 2025-10-21
- 5.0.11 — 2025-09-13
- 5.0.10 — 2025-09-11
- 5.0.9 — 2025-09-08
- 5.0.8 — 2025-07-28
- 5.0.7 — 2025-07-04
- 5.0.6 — 2025-06-18
- 5.0.5 — 2025-06-16
- … 133 more at https://npm.io/package/enka-network-api/versions

## README

# EnkaNetworkAPI

![Enka.Network](https://github.com/yuko1101/enka-network-api/blob/main/docs/static/img/enka-splash.png?raw=true)

<div align="center">
	<p>
		<a href="https://www.npmjs.com/package/enka-network-api"><img src="https://img.shields.io/npm/v/enka-network-api.svg?maxAge=3600" alt="npm version" /></a>
		<a href="https://www.npmjs.com/package/enka-network-api"><img src="https://img.shields.io/npm/dt/enka-network-api.svg?maxAge=3600" alt="npm downloads" /></a>
		<a href="https://github.com/yuko1101/enka-network-api/actions/workflows/codeql.yml"><img src="https://github.com/yuko1101/enka-network-api/actions/workflows/codeql.yml/badge.svg"/></a>
    	<a href="https://github.com/yuko1101/enka-network-api/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg"/></a>
	</p>
</div>

<div align="center">
    <a href="https://enka-network-api.vercel.app">
        <b>&lt;/&gt; Documentation</b>
    </a>
    <b> | </b>
    <a href="https://www.npmjs.com/package/enka-network-api">
        <b>⚙ NPM</b>
    </a>
    <b> | </b>
    <i class="fab fa-github"></i>
    <a href="https://github.com/yuko1101/enka-network-api">
        <b> GitHub</b>
    </a>
</div>

## About

A Node.js Enka.Network API wrapper for Genshin Impact.

**This is NOT the source code of Enka.Network or its API.**

> [!TIP]
> If you need a wrapper for Honkai: Star Rail, you can use [starrail.js](https://github.com/yuko1101/starrail.js).

### Features
- User Data and Character Stats using EnkaNetwork.
- All Characters and All Weapons Data. (Including More Advanced Info, such as Skill Attributes and Weapon Refinements.)
- Cache Updater for the new update of Genshin Impact. (Update characters and weapons immediately.)
- Honkai: Star Rail support with [starrail.js](https://github.com/yuko1101/starrail.js) integration. (See the example [here](https://github.com/yuko1101/enka-network-api/blob/main/example/starrail.js-integration.js).)


## Installation

**Node.js 16 or newer is required.**

Install enka-network-api including genshin cache data.
```sh-session
npm install enka-network-api@latest
```
<details>
    <summary>Install using ghproxy.com</summary>
    
    npm install enka-network-api@latest --enka-ghproxy=true
</details>
<br/>

If you have already moved the cache to another folder, you can also install without downloading the cache.
```sh-session
npm install enka-network-api@latest --enka-nocache=true
```

## About Genshin Cache Data
Genshin cache data is from [Dimbreath/AnimeGameData2](https://gitlab.com/Dimbreath/AnimeGameData2) (gitlab).

This data contains data of characters, weapons, materials, and more structure information of Genshin Impact.

You can change your cache directory.
```js
const { EnkaClient } = require("enka-network-api");

// Change the directory to store cache data.
// Default directory is node_modules/enka-network-api/cache.
const enka = new EnkaClient();
enka.cachedAssetsManager.cacheDirectoryPath = "./cache";
enka.cachedAssetsManager.cacheDirectorySetup();

// OR

const enka = new EnkaClient({ cacheDirectory: "./cache" });
enka.cachedAssetsManager.cacheDirectorySetup();

```

### Updating

You can update your genshin cache data.
```js
const { EnkaClient } = require("enka-network-api");
const enka = new EnkaClient({ showFetchCacheLog: true }); // showFetchCacheLog is true by default

enka.cachedAssetsManager.fetchAllContents(); // returns promise
```


Also, you can activate auto cache updater.

When using the auto-cache updater, we recommend moving the cache directory directly under your project folder.

```js
const { EnkaClient } = require("enka-network-api");
const enka = new EnkaClient();

enka.cachedAssetsManager.activateAutoCacheUpdater({
    instant: true, // Run the first update check immediately
    timeout: 60 * 60 * 1000, // 1 hour interval
    onUpdateStart: async () => {
        console.log("Updating Genshin Data...");
    },
    onUpdateEnd: async () => {
        enka.cachedAssetsManager.refreshAllData(); // Refresh memory
        console.log("Updating Completed!");
    }
});

// // deactivate
// enka.cachedAssetsManager.deactivateAutoCacheUpdater();
```

## How to use

### Fetching Player Data 
[EnkaClient#fetchUser](https://enka-network-api.vercel.app/api/class/EnkaClient#fetchUser)
```js
const { EnkaClient } = require("enka-network-api");
const enka = new EnkaClient();

enka.fetchUser(825436941).then(user => {
  console.log(user);
});
```

### Genshin Character List
[EnkaClient#getAllCharacters](https://enka-network-api.vercel.app/api/class/EnkaClient#getAllCharacters)
```js
const { EnkaClient } = require("enka-network-api");
const enka = new EnkaClient();

const characters = enka.getAllCharacters();
// print character names in language "en"
console.log(characters.map(c => c.name.get("en")));
```

### Genshin Weapon List
[EnkaClient#getAllWeapons](https://enka-network-api.vercel.app/api/class/EnkaClient#getAllWeapons)
```js
const { EnkaClient } = require("enka-network-api");
const enka = new EnkaClient();

const weapons = enka.getAllWeapons();
// print weapon names in language "jp"
console.log(weapons.map(w => w.name.get("jp")));
```

More examples are available in [example](https://github.com/yuko1101/enka-network-api/tree/main/example) folder.

For more information, please check [Documentation](https://enka-network-api.vercel.app).

You can see the changelog [here](https://github.com/yuko1101/enka-network-api/blob/main/CHANGELOG.md).

---
_Source: https://npm.io/package/enka-network-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
