Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

API: Difference between revisions

From Harry's Wiki
Wolfy (talk | contribs)
Removed the WS profile endpoint, because it has been removed. The WSAPI is now only used for receiving periodic data about yourself.
Wolfy (talk | contribs)
Added the statlb HTTP endpoint.
Line 64: Line 64:
| 504 || Gateway Timeout || Server did not respond in time
| 504 || Gateway Timeout || Server did not respond in time
|}
|}
==== GET /statlb ====
Retrieves leaderboards for a specific stat.
'''Parameters:'''
{| class="wikitable"
! Parameter !! Type !! Description
|-
| apikey || string || Your API key
|-
| stat || string || The [[Leaderboard Stat]]
|-
| max || integer || The amount of leaderboard entries (1-100)
|}
'''Example Request:'''
<pre>GET https://wss.harrys.gg:2053/statlb?apikey=YOUR_API_KEY&stat=deaths&max=50</pre>
'''Response Data:'''
* All the leaderboard entries in json as an array of arrays
'''Error Responses:'''
{| class="wikitable"
! Code !! Error !! Description
|-
| 400 || Missing apikey, stat, or max || Required parameters not provided
|-
| 400 || Invalid max value || The max parameter is not in the valid range (1-100)
|-
| 403 || Invalid API Key || The provided API key is not valid
|-
| 504 || Gateway Timeout || Server did not respond in time
|}


== WebSocket API ==
== WebSocket API ==

Revision as of 21:18, 26 December 2025


This page documents the official Harry's Network API, which allows developers to create mods and applications that interact with server data.

Getting an API Key

To obtain an API key:

  1. You must have at least VIP rank on the server
  2. Log into the Minecraft server
  3. Type /api in chat
  4. Your API key will be provided to you

⚠️ Warning: Keep your API key private. Do not share it with others.

API Endpoints

HTTP API

Base URL

https://wss.harrys.gg:2053

GET /profile

Retrieves profile information for a player.

Parameters:

Parameter Type Description
apikey string Your API key
uuid string The player's Minecraft UUID (with dashes)

Example Request:

GET https://wss.harrys.gg:2053/profile?apikey=YOUR_API_KEY&uuid=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Response Data:

  • Inventory items
  • Armor items
  • Coins
  • Megacoins
  • Coins grinded this prestige
  • Coins requirement for next prestige
  • Rank
  • Prestige number
  • Level
  • Guild
  • Equipped megastreak
  • Equipped killstreaks
  • Equipped perks
  • Equipped blessing

Error Responses:

Code Error Description
400 Missing apikey or uuid Required parameters not provided
400 Invalid UUID format UUID must be in standard format with dashes
403 Invalid API Key The provided API key is not valid
504 Gateway Timeout Server did not respond in time

GET /statlb

Retrieves leaderboards for a specific stat.

Parameters:

Parameter Type Description
apikey string Your API key
stat string The Leaderboard Stat
max integer The amount of leaderboard entries (1-100)

Example Request:

GET https://wss.harrys.gg:2053/statlb?apikey=YOUR_API_KEY&stat=deaths&max=50

Response Data:

  • All the leaderboard entries in json as an array of arrays

Error Responses:

Code Error Description
400 Missing apikey, stat, or max Required parameters not provided
400 Invalid max value The max parameter is not in the valid range (1-100)
403 Invalid API Key The provided API key is not valid
504 Gateway Timeout Server did not respond in time


WebSocket API

Connection

wss://wss.harrys.gg:2053

Authentication Flow

  1. Connect to the WebSocket
  2. Server sends: {"type": "auth_request"}
  3. Client responds: {"type": "auth", "apikey": "YOUR_API_KEY"}
  4. On success, server sends: {"type": "auth_success"}

ℹ️ Note: You must authenticate within 1 second of connecting or the connection will be closed.

Live Data Stream

When you are online on the Minecraft server and connected to the WebSocket, you will automatically receive data every second containing:

  • Equipped perks
  • Equipped killstreaks
  • Equipped megastreak
  • Current monk buff (if active)
  • Riftwalker charges
  • Apocalypse count
  • Booster info (remaining time, multiplier)
  • Battlepass challenges and progression

Example Code

JavaScript WebSocket Example

const ws = new WebSocket('wss://wss.harrys.gg:2053');

ws.onmessage = (event) => {
    const data = JSON.parse(event.data);
    
    if (data.type === 'auth_request') {
        ws.send(JSON.stringify({ type: 'auth', apikey: 'YOUR_API_KEY' }));
    } else if (data.type === 'auth_success') {
        console.log('Connected!');
    } else if (data.type === 'info') {
        console.log('Info about myself:', data.content);
    }
};

See Also