Skip to content

Joshy3282/HyWrapper

Repository files navigation

HyWrapper - Hypixel API Wrapper

Python CITypeScript CI Kotlin CI
PyPI version npm version JitPack
License: MIT Discord

An asynchronous and multi-platform Hypixel API wrapper for Python, Kotlin, and Java.

Features

  • Language Parity: Consistent models and helper methods across Python, TypeScript, and Kotlin.
  • Asynchronous: Fully non-blocking requests using Coroutines (Kotlin), asyncio/httpx (Python), and Promises (TypeScript).
  • Type Safety: Rich, strongly-typed models with validation (Pydantic, Kotlin Serialization, TypeScript Interfaces).
  • Comprehensive Coverage: Support for all major endpoints including SkyBlock (Bazaar, Auctions, Garden), Players, Guilds, and Resources.
  • Automatic Rate Limiting: Built-in handling for Hypixel API rate limits to ensure reliable data fetching.

Documentation

Full documentation is available at https://joshy3282.github.io/HyWrapper/.

Installation

Python

pip install hywrapper

Kotlin / Java

Add the JitPack repository and the dependency to your build.gradle.kts:

repositories {
    maven { url = uri("https://jitpack.io") }
}

dependencies {
    implementation("com.github.joshy3282:hywrapper:1.0.0")
}

Usage

Kotlin

// Initialize the client
val client = HypixelClient(apiKey = "your-api-key")

// Fetch a player's stats (suspend function)
val response = client.getPlayer("ac29411d0826412f98c0dd14b334c1fa")
if (response.success) {
    println("Player Found!")
}

Python

import asyncio
from hywrapper import HypixelClient

async def main():
    client = HypixelClient(api_key="your-api-key")
    response = await client.get_player("ac29411d0826412f98c0dd14b334c1fa")
    if response.success:
        print("Player Found!")

asyncio.run(main())

TypeScript

import { HypixelClient } from 'hywrapper-ts';

async function main() {
    const client = new HypixelClient('your-api-key');
    const response = await client.getPlayer('ac29411d0826412f98c0dd14b334c1fa');
    
    if (response.success) {
        console.log(`Player Found: ${response.player?.displayname}`);
    }
}

main();

Examples

For more detailed examples in different languages, see the examples/ folder.

Bazaar (Kotlin)

val bazaar = client.getBazaar()
val enchantedDiamond = bazaar.getProduct(BazaarItem.ENCHANTED_DIAMOND)
println("Sell Price: ${enchantedDiamond?.quickStatus?.sellPrice}")

Guild Information (Kotlin)

val guild = client.getGuildByPlayer("ac29411d0826412f98c0dd14b334c1fa")
println("Guild Name: ${guild.guild?.name}")