Statistics Documentation

This focuses on getting Mojang statistics.

Basic Example:

import aiomojang
import asyncio

async def get_mojang_statistics():
    # You can get Mojang statistics with aiomojang.Statistics()
    stats = aiomojang.Statistics()
    # Using any function under aiomojang.Statistics() requires a payload
    # The payload can be of the following:
    #    item_sold_minecraft
    #    prepaid_card_redeemed_minecraft
    #    item_sold_cobalt
    #    item_sold_scrolls
    #    prepaid_card_redeemed_cobalt
    #    item_sold_dungeons
    return await stats.get_sale_velocity("item_sold_minecraft")  # Returns a float.

asyncio.run(get_mojang_statistics())  # Running the function
class aiomojang.misc.Statistics

Get Mojang statistics given a payload.

async get_raw_stats(payload: Optional[str] = None)

Gets the raw statistics for the specified payload. :returns: The raw json. :rtype: dict

Raises

RequiredPayload – If you are missing the required payload.

async get_sale_velocity(payload: Optional[str] = None)

Gets the sale velocity of the given payload. :returns: The sale velocity. :rtype: int

Raises

RequiredPayload – If you are missing the required payload.

async get_sales_today(payload: Optional[str] = None)

Gets the total amount of sales in the past 24 hours. :returns: The total amount of sales in the past 24 hours. :rtype: int

Raises

RequiredPayload – If you are missing the required payload.

async get_total(payload: Optional[str] = None)

Gets the total amount of sales for the specified payload. :returns: The total amount of sales. :rtype: int

Raises

RequiredPayload – If you are missing the required payload.