Skip to content

Using the API with Java

Nullicorn edited this page May 29, 2020 · 5 revisions

This page provides examples of how to use the Hypixel PublicAPI in a Java program. It is assumed that you have already configured your IDE and downloaded PublicAPI on your own machine.

Getting your API Key

To use the PublicAPI, you will first need to have an API key. The Hypixel API uses keys to keep track of how frequently a user is sending requests, as well as to determine if your API key is compromised.

To obtain your personal API key, you must own a valid Minecraft account and have the Minecraft Launcher installed.

  1. Launch Minecraft on release 1.8.0 or later (snapshot versions will not work)
  2. Open the Multiplayer GUI and connect to mc.hypixel.net
  3. Once you are connected, open up the chat bar (this can be done by pressing the T key by default)
  4. In the chat bar, type /api new and press enter. You should receive a message in chat saying, Your new API key is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (with your API key in place of the x's)
  5. When you click on that message, your API key should be copied to your clipboard. Paste that somewhere safe for later

NOTE: Your API key is to be treated just like a password. You should never share your API key with anyone, or else it could be used for malicious purposes.

TODO

  • Add example usage in a plain java program
  • Add example usage in a Forge mod
  • Add example usage in a Bukkit plugin

Clone this wiki locally