Skip to main content

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

Project description

MapleStory OpenAPI Python Library

PyPi Python

This Python 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 Python library in your python project:

pip 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.

from maplestory_openapi.kms import MapleStoryApi # data from KMS
# or
from maplestory_openapi.msea import MapleStoryApi # data from MSEA

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

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.

from maplestory_openapi.kms import MapleStoryApi
from maplestory_openapi.common import MapleStoryApiException

api_key = '{Your API Key}'
api = MapleStoryApi(api_key=api_key)

# run your code
try:
    character = api.get_character_id('{Your Character Name}')
    character_basic = api.get_character_basic(ocid=character.ocid)

    print(character_basic)
# exception handling
except MapleStoryApiException as e:
    # handle MapleStoryApiException

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 MapleStoryApiException 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 MapleStoryApiException for exception handling based on the error code 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

maplestory_openapi-3.10.0.tar.gz (86.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

maplestory_openapi-3.10.0-py3-none-any.whl (159.7 kB view details)

Uploaded Python 3

File details

Details for the file maplestory_openapi-3.10.0.tar.gz.

File metadata

  • Download URL: maplestory_openapi-3.10.0.tar.gz
  • Upload date:
  • Size: 86.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for maplestory_openapi-3.10.0.tar.gz
Algorithm Hash digest
SHA256 286ecb7509c54ccb37f527ee20da55ae56ed67d67d8de99ead2b0c3b3d076534
MD5 a222c7aa8600ffa27f3d1b06a4e6e87d
BLAKE2b-256 39e89eef481e3440f08a61c644d88035b3c143fef94bb1e2878fd57a5dca5fc3

See more details on using hashes here.

File details

Details for the file maplestory_openapi-3.10.0-py3-none-any.whl.

File metadata

File hashes

Hashes for maplestory_openapi-3.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e6a55fbf3b91985112bba81db3a92586da75378d0c3e264cfa7430b293541f2
MD5 f3da2c0fbd53e73a7aea9f0979d7ce40
BLAKE2b-256 9f6091f2d5aee5ac0fb3ff8d4d586af5f4d6491602c38bae24fe0d20aea3556f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page