Skip to content

Latest commit

 

History

History
46 lines (36 loc) · 1.15 KB

File metadata and controls

46 lines (36 loc) · 1.15 KB

Hypixel Public API - Apache Transport

Usage

<dependency>
    <groupId>net.hypixel</groupId>
    <artifactId>hypixel-api-transport-apache</artifactId>
    <version>4.4</version>
</dependency>

Can also be included with Gradle.

dependencies {
    implementation 'net.hypixel:hypixel-api-transport-apache:4.4'
}

Example code

public class Main {
    public static void main(String[] args) {
        HypixelHttpClient client = new ApacheHttpClient(UUID.fromString("your-api-key-here"));
        HypixelAPI hypixelAPI = new HypixelAPI(client);
        hypixelAPI.getPlayerByName("Hypixel")
                .exceptionally(throwable -> {
                    // Handle exceptions here
                    throwable.printStackTrace();
                    return null;
                })
                .thenAccept(System.out::println);
    }
}

Dependencies

This transport depends on the following: