You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

wow-api-sdk

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wow-api-sdk

Node.js SDK for retrieving World of Warcraft character and item data via Blizzards API.

1.3.4
latest
Source
npmnpm
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

WoW API SDK

A simple and flexible SDK for interacting with the Blizzard World of Warcraft API. It provides streamlined access to character profiles, items, media, gear, specializations, and more—with built-in caching, token management, and error handling.

Features

  • Multi-region support with automatic fallback logic
  • In-memory caching to reduce redundant API calls
  • Built-in OAuth token management
  • Modular API helpers for common use cases
  • Robust error handing with meaningful messages

Installation

npm install wow-api-sdk

Quick Start

import { getCharacterData } from "wow-api-sdk";

const data = await getCharacterData("characterName", "realm");
console.log(data);
import {
  getCharacterProfile,
  getCharacterMedia,
  getCharacterSpecializations,
  getCharacterEquipment,
  getItem,
  getItemMedia,
} from "wow-api-sdk";

// Fetch character profile
const profile = await getCharacterProfile("eu", "twisting-nether", "scartx");

// Fetches the character's specializations including the active one (e.g. DPS, Healer, Tank).
const specs = await getCharacterSpecializations("eu", "Sylvanas", "Scartx");
console.log(specs.active_specialization.name); // e.g., "Holy"

// Get item data and media
const item = await getItem(18803, "en_GB", "us");
const itemMedia = await getItemMedia("us", 18803);

// Fetch character media with fallback
const characterMedia = await getCharacterMedia("eu", "Sylvanas", "Scartx");

// Returns the list of achievements earned by the character
const achievements = await getCharacterAchievements("eu", "Sylvanas", "Scartx");
console.log(
  "First Achievement:",
  achievements.achievements[0].achievement.name
);

// Returns the list of character titles the player has earned
const titles = await getCharacterTitles("eu", "Sylvanas", "Scartx");
console.log("First Title:", titles.titles[0].name);

// Returns the list of battle pets collected by the character
const pets = await getCharacterPets("eu", "Sylvanas", "Scartx");
console.log("First Pet:", pets.pets[0]?.creature?.name);

Available Methods

FunctionDescription
getCharacterProfileFetches core character info (level, race, class, etc.)
getCharacterMediaRetrieves character portraits and visuals
getCharacterSpecializationsReturns active and inactive specialization data
getCharacterEquipmentFetches gear currently equipped by the character
getItemRetrieves item stats and metadata by ID
getItemMediaFetches item icon and visual resources
getCharacterAchievementsReturns earned achievements for the character
getCharacterMountsReturns all collected mounts
getCharacterTitlesReturns character titles earned by the player
getCharacterPetsReturns collected battle pets by the character
getCharacterPvpSummaryReturns the character's PvP statistics and rankings

Error Handling

All API functions implement try/catch blocks and throw descriptive errors when calls fail. The media fetching functions implement fallback to the default region (eu) if data is not found for the requested region, improving resilience.

try {
  const media = await getCharacterMedia("us", "sylvanas", "nonexistent");
} catch (err) {
  console.error("Error fetching character media:", err.message);
}

How it Works

  • All API calls use fetchFromAPI() which:

    • Handles access tokens via getAccessToken()
    • Applies in-memory caching with cacheGet() / cacheSet()
    • Adds proper headers and retry logic
  • Region-based URLs are constructed via regionHost(region)

  • JSON responses are returned directly with no transformation

Keywords

wow

FAQs

Package last updated on 23 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts