Skip to content

Node JS/TypeScript module that allows you to work with the site API enka.network adding localization and convenience (even caching).

License

Notifications You must be signed in to change notification settings

notweuz/enkaNetwork

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

enkaNetwork

Node JS/TypeScript module that allows you to work with the site API enka.network adding localization and convenience (even caching).

enkaNetwork

Downloads Downloads/month last commit GitHub npm

📦 Download

  • используя npm
    npm i enkanetwork
  • используя Yarn
    yarn add enkanetwork

🛠️ Usage

import { EnkaNetwork } from "enkanetwork"; //const { EnkaNetwork } = require("enkanetwork");
const enka = new EnkaNetwork({ language: "EN", caching: true });
Key In API Type Description Required?
language - number The language to be used in the localization of names (characters, artifacts, etc.). Default is «EN» -
caching - boolean Cache responses? Default is true -
userAgent - string or boolean Disable or change the header User-Agent. (false for disable) -

Fetch user by uid from the game (response is FetchUserUID)

const user = await enka.fetchUser(700832641, "RU");
Key In API Type Description Required?
UID - number UID from the game +
language - number The language to be used in the localization of names (characters, artifacts, etc.). Default is EnkaNetwork.language -

Or fetch user by enka profile tag (response is FetchUserProfile)

const user = await enka.fetchProfile("kaito", "RU");
Key In API Type Description Required?
Profile tag - number Enka patreon profile tag from the site EnkaNetwork +
language - number The language to be used in the localization of names (characters, artifacts, etc.). Default is EnkaNetwork.language -

⚙ Response structure

FetchUserUID

Key In API Type Description
player playerInfo object See Player
characters avatarInfoList array See Characters
ttl ttl number Cache lifetime in milliseconds

FetchUserProfile

Key In API Type Description
profile profile boolean User fetched by profile tag?
accounts hoyos array See Accounts
enkaProfile user object See EnkaProfile

FetchAccounts[]

Key In API Type Description
-------- ----- array See Accounts. Response is array.

Accounts

Key In API Type Description
is_uid_public is_uid_public boolean User uid is public?
player player_info object See Player

EnkaProfile

Key In API Type Description
id id string Enka profile id
username profile.username string Enka profile username
bio profile.bio string Enka profile description
level profile.level number Enka profile level
drawName profile.draw_name booolean Enka profile draw name?
drawUid profile.draw_uid booolean Enka profile draw uid?
signupState profile.signup_state integer Enka profile sign up state
imageUrl profile.image_url string Url of enka profile picture

Player

Key In API Type Description
nickname nickname string Profile nickname
signature signature string Profile description
level level number User rank level
worldLevel worldLevel number User world level
nameCard - object See NameCard
achievements finishAchievementNum number Achievements count
abyssFloor towerFloorIndex number The floor of the abyss passed by the player
abyssLevel towerLevelIndex number The hall of the abyss floor passed by the player
charactersPreview showAvatarInfoList array See CharacterPreview
nameCardsPreview showNameCardIdList array See NameCard
profilePicture profilePicture object See ProfilePicture

NameCard

Key In API Type Description
id nameCardId number Namecard id
name - string Localized namecard name
icon - string URL to get the icon
banner - string URL to get the icon banner
navbar - string URL to get the icon navbar

CharacterPreview

Key In API Type Description
id avatarId number Character id
name - string Localized character name
icon - string URL to get the character icon
level level number Character level

ProfilePicture

Key In API Type Description
id avatarId number Character id
name - string Localized character name
icon - string URL to get the character icon

Characters

Key In API Type Description
id avatarId number Character id
name - string Localized character name
icons - object See Icons
rarity - number Character rarity (5 or 4)
element - string See ElementType
level propMap["4001"] number Character level
elevations propMap["1002"] number Character elevations
xp propMap["1001"] number Character expiriance
constellation talents array See CharacterConstellation
skills skills array See CharacterSkill
skillSetId skillDepotId number Character Skill Set ID
skillData inherentProudSkillList array List of Unlocked Skill Ids
stats fightPropMap array Character stats
weapon equipList number See CharacterWeapon
reluquary equipList number See ProfilePicture

Icons

Key In API Type Description
avatar - string Character avatar icon
side - string Character side avatar icon

ElementType

Key In API
Cryo Ice
Hydro Water
Anemo Wind
Pyro Fire
Geo Rock
Electro Electric

CharacterConstellation

Key In API Type Description
id talent number Character constellation id
name - string Character constellation name
icon - string URL to get the character constellation icon
unlocked - boolean Character constellation unlocked?

CharacterSkill

Key In API Type Description
id skill number Character skill id
name - string Character skill name
icon - string URL to get the character skill icon
level level number Character skill level

CharacterWeapon

Key In API Type Description
id itemId number Character weapon id
name - string Character weapon name
icon - string URL to get the character weapon icon
level level number Character weapon level
elevations weapon.promoteLevel number Character weapon elevations
improvement weapon.affixMap number Character weapon improvement
rarity flat.rankLevel number Character weapon rarity
mainStat flat.weaponStats[0] object Character weapon main stat
subStat flat.weaponStats[1] object Character weapon sub stat

CharacterReluquary

Key In API Type Description
id itemId number Character reluquary id
name - string Character reluquary name
setName - string Character reluquary set name
icon - string URL to get the character reluquary icon
type - string See ReliquaryType
level reliquary.level number Character reluquary level
rarity flat.rankLevel number Character reluquary rarity
mainStat flat.reliquaryMainstat object Character reluquary main stat
subStat flat.reliquarySubstats object Character reluquary sub stat

ReliquaryType

Key In API
Flower EQUIP_BRACER
Feather EQUIP_NECKLACE
Sands EQUIP_SHOES
Goblet EQUIP_RING
Circlet EQUIP_DRESS

For assets thanks enkanetwork.py-data

About

Node JS/TypeScript module that allows you to work with the site API enka.network adding localization and convenience (even caching).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%