OpenMLBB SDK Docs

OpenMLBB Endpoint

SDK call mapping, request requirements, and Python example.

Every card documents the SDK call from OpenMLBB and mirrors API path/query/body requirements.

GET Roles

/openmlbb/academy/roles

Open Only This

API Path: /api/academy/roles

List all hero roles available in the game (Tank, Fighter, Assassin, Mage, Marksman, Support). Supports query parameters for pagination, sorting, and localization.

Query parameters:

  • size: Number of items per page (minimum: 1).
  • index: Page index (starting from 1).
  • order: Sort order for results. Allowed values: asc, desc.
  • lang: Language code for localized content (default: en).

The response includes role data:

  • records: Array of role entries, each containing:
      • _id: Unique record identifier.
      • caption: Localized role caption (e.g., '坦克', '法师').
      • configId: Configuration ID.
      • createdAt: Creation timestamp.
      • createdUser: Creator username.
      • updatedAt: Last update timestamp.
      • updatedUser: Last updater username.
      • data:
          • emblem_id: Emblem ID associated with the role.
          • emblem_title: Emblem title (e.g., 'Tank', 'Mage').
          • emblem_icon: Emblem icon URL.
          • emblem_detail:
              • _id: Emblem detail record ID.
              • _createdAt: Creation timestamp.
              • _updatedAt: Last update timestamp.
              • data:
                  • emblemid: Emblem ID.
                  • emblemname: Emblem name (e.g., 'Assassin').
                  • emblemattrid: Attribute ID.
                  • emblemattr: Attribute bonuses (e.g., '+500 Extra Max HP').
                  • attriicon: Attribute icon URL.
                  • attriicon2: Secondary attribute icon URL (optional).
                  • emblembg: Background indicator.

This endpoint is useful for:

  • Displaying role categories.
  • Explaining role-specific attributes and emblem bonuses.
  • Guiding players in hero selection based on roles.

Python Example

from OpenMLBB import OpenMLBB

client = OpenMLBB()
response = client.academy.roles(size=20, index=1, order="asc", lang="en")
print(response)

Path and Query Parameters

Name In Type Required Default
size query integer no 20
index query integer no 1
order query string no asc
lang query string no en