npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

maplestory-openapi

v3.7.0

Published

This JavaScript library enables the use of the MapleStory OpenAPI of Nexon.

Readme

MapleStory OpenAPI JavaScript Library

npm JS

This JavaScript library enables the use of the MapleStory OpenAPI of Nexon.

Packages written in other languages can be found HERE.

English | 한국어

Notice

💡 Notice 1: Migration is required when updating to version 3.5.0. Please refer to the documentation for Migration.

🌏 Notice 2: Starting from version 3.4.0, support for tms region has been added. You can now retrieve data from KMS, TMS, MSEA.

🌏 Notice 3: Starting from version 3.0.0, support for msea region has been added.

💡 Notice 4: Migration is required when updating from version 2.x.x to 3.0.0. Please refer to the documentation for Migration.

Installation

Install the latest version of the JavaScript/TypeScript library in your npm project:

npm install maplestory-openapi

Usage

API Key

Before using the library, register your application and obtain an api key from the Nexon Open API Console.

Applications must be registered separately for each region. (For example, an API key issued for KMS cannot be used to request data from MSEA.)

Region

Currently, this library supports data retrieval from the KMS, TMS, MSEA regions. To access data from a specific region, import the corresponding package path.

import { MapleStoryApi } from 'maplestory-openapi/kms'; // data from KMS
// or
import { MapleStoryApi } from 'maplestory-openapi/msea'; // data from MSEA

Even though the regions differ, each package inherits the same interface, ensuring a consistent API usage experience across all regions.

Supports

  1. TypeScript Support: TypeScript is fully supported. Type definitions are included.

  2. CommonJS, ESM Support: The library supports both CommonJS and ESM usage.

const { MapleStoryApi } = require('maplestory-openapi/kms'); // CommonJS
import { MapleStoryApi } from 'maplestory-openapi/kms'; // ESM
  1. TS2307 Cannot find module: it may be due to the moduleResolution option being set to node. In such cases, update it to node16, nodenext, or bundler as shown below
{
  "compilerOptions": {
    "moduleResolution": "nodenext"
  }
}

Sample Code

Below is an example that retrieves the identifier of a specific character from the KMS server based on the nickname, and then fetches that character’s basic information.

const { MapleStoryApi } = require('maplestory-openapi/kms');
const { MapleStoryApiError } = require('maplestory-openapi');

const apiKey = '{Your API Key}';
const api = new MapleStoryApi(apiKey);

try {
  // run your code

  const character = await api.getCharacter('{Your Character Name}');
  const characterBasic = await api.getCharacterBasic(character.ocid);

  console.log(characterBasic);
} catch (e) {
  // exception handling

  if (e instanceof MapleStoryApiError) {
    // handle MapleStoryApiError
  } else {
    // handle other errors
  }
}

You can find more examples in the test cases at the following link.

Features

This library supports all apis published in the MapleStory OpenAPI official docs.

Some features are supported only in specific regions. Please refer to the official documentation for each region for details.

Exception Handling

Handle MapleStoryApiError to safely make calls, ensuring that specific Status defined in the MapleStory OpenAPI Guide are not encountered.

While MapleStoryApi is designed to prevent the occurrence of certain Status, exceptions may arise due to developer mistakes.

Therefore, it's recommended to use MapleStoryApiError for exception handling based on the MapleStoryApiErrorCode list described in the table below.

| ErrorCode | Description | |--------------|--------------------------------------------------| | OPENAPI00001 | Internal server error | | OPENAPI00002 | Access denied | | OPENAPI00003 | Invalid identifier | | OPENAPI00004 | Request format error (incorrect parameter input) | | OPENAPI00005 | Invalid api key | | OPENAPI00006 | Invalid api path | | OPENAPI00007 | Request allowance (Rate Limit) exceeded | | OPENAPI00009 | Not prepared data | | OPENAPI00010 | Game server maintenance | | OPENAPI00011 | API server maintenance |