API: Difference between revisions
From Harry's Wiki
More actions
Created page with " 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: # You must have at least '''VIP''' rank on the server # Log into the Minecraft server # Type <code>/api</code> in chat # 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 =..." |
Removed the WS profile endpoint, because it has been removed. The WSAPI is now only used for receiving periodic data about yourself. |
||
| Line 79: | Line 79: | ||
{{Note|You must authenticate within 1 second of connecting or the connection will be closed.}} | {{Note|You must authenticate within 1 second of connecting or the connection will be closed.}} | ||
=== Live Data Stream === | === Live Data Stream === | ||
| Line 111: | Line 97: | ||
=== JavaScript WebSocket Example === | === JavaScript WebSocket Example === | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript" start="0" line="1"> | ||
const ws = new WebSocket('wss://wss.harrys.gg:2053'); | const ws = new WebSocket('wss://wss.harrys.gg:2053'); | ||
| Line 121: | Line 107: | ||
} else if (data.type === 'auth_success') { | } else if (data.type === 'auth_success') { | ||
console.log('Connected!'); | console.log('Connected!'); | ||
} else if (data.type === 'info') { | } else if (data.type === 'info') { | ||
console.log('Info about myself:', data.content); | console.log('Info about myself:', data.content); | ||
Revision as of 21:13, 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:
- You must have at least VIP rank on the server
- Log into the Minecraft server
- Type
/apiin chat - 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 |
WebSocket API
Connection
wss://wss.harrys.gg:2053
Authentication Flow
- Connect to the WebSocket
- Server sends:
{"type": "auth_request"} - Client responds:
{"type": "auth", "apikey": "YOUR_API_KEY"} - 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);
}
};