You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/keys.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,4 +6,5 @@ You may at anytime copy your existing API key with `/api key copy`
6
6
7
7
Keys currently serve 2 purposes:
8
8
1. Allowing access to the server's SSE endpoint (`/events`)
9
-
2. Allowing players to query their own data - Players can query their own resident information even if they have opted out, and they may view information about their shops in the `/shop` endpoint.
9
+
2. Allowing players to query their own data - Players can query their own resident information even if they have opted out, and they may view additional information about themselves. Example endpoints: `/shop`, `/mcmmo`.
10
+
3. Allowing players to query 'private' endpoints which have a stricter rate limit. Example endpoints: `/pursuits`, `/mcmmo-top`
The mcMMO endpoint provides information about a player's mcMMO levels.
6
+
It is important to note that the information here is not public, and players can only access their own information, using their API key.
7
+
8
+
The rate limit for this endpoint is one request per hour per API key (and thus per player).
9
+
10
+
Example **POST** request
11
+
```json5
12
+
{
13
+
"query": ["PLAYER_UUID"],
14
+
"key":"API_KEY"
15
+
}
16
+
```
17
+
The player UUID must match the API key's owner.
18
+
19
+
Example **POST** response
20
+
```json5
21
+
[
22
+
{
23
+
"name":"Veyronity",
24
+
"ACROBATICS":21,
25
+
"ALCHEMY":0,
26
+
"ARCHERY":0,
27
+
"AXES":0,
28
+
"CROSSBOWS":0,
29
+
"EXCAVATION":0,
30
+
"FISHING":0,
31
+
"HERBALISM":0,
32
+
"MACES":0,
33
+
"MINING":1,
34
+
"REPAIR":0,
35
+
"SALVAGE":0,
36
+
"SMELTING":0,
37
+
"SPEARS":0,
38
+
"SWORDS":0,
39
+
"TAMING":0,
40
+
"TRIDENTS":0,
41
+
"UNARMED":0,
42
+
"WOODCUTTING":50
43
+
}
44
+
]
45
+
```
46
+
The player's name and their level in each primary skill. The overall power level can be calculated by adding all the values.
47
+
48
+
## Top endpoint
49
+
Accessed at https://api.earthmc.net/v4/mcmmo-top
50
+
51
+
The mcMMO-top endpoint provides the leaderboard of a specified skill.
52
+
53
+
The rate limit for this endpoint is one request per 2 minutes per API key.
54
+
55
+
Example **POST** request
56
+
```json5
57
+
{
58
+
"query": ["SKILL"], // Skill name (E.g. 'FISHING', 'MINING'), or 'POWER' for the overall power leaderboard
59
+
"key":"API_KEY"
60
+
}
61
+
```
62
+
63
+
Example **POST** response
64
+
```json5
65
+
[
66
+
{
67
+
"skill":"power",
68
+
"1": {
69
+
"player":"K1kimor",
70
+
"level":12078
71
+
},
72
+
"2": {
73
+
"player":"Veyronity",
74
+
"level":72
75
+
},
76
+
"3": {
77
+
"player":"Andre1098",
78
+
"level":29
79
+
},
80
+
"lastUpdated":1779619278
81
+
}
82
+
]
83
+
```
84
+
The information is not live, it is cached & updated every 15 minutes. The field `lastUpdated` provides the epoch second that the information was last updated at.
"wiki":null, // The nation's wiki URL as a string if set, returns null if not
53
+
"discord":null, // The nation's discord URL
53
54
"king": {
54
55
"name":"tuzzzie",
55
56
"uuid":"8391474f-4b57-412a-a835-96bd2c253219"
@@ -185,6 +186,30 @@ Example **POST** response
185
186
],
186
187
"Colonist": [],
187
188
"Diplomat": []
189
+
},
190
+
"embargoes": {
191
+
"own": [ // A JSON array representing all nations that this nation has placed an embargo on
192
+
{
193
+
"name":"woodland",
194
+
"uuid":"625a3d73-b179-4335-a512-58366c90dcfe"
195
+
}
196
+
],
197
+
"against": [] // A JSON array representing all nations that have placed an embargo on this nation
198
+
},
199
+
"pacts": { // Container for 'active' and 'pending' JSON dictionaries for pacts this nation is involved in, where the key is the name of the other nation in the pact, and the value is a detailed pact object
200
+
"active": { // A JSON dictionary representing active pacts this nation has
201
+
"LizardLand": {
202
+
"sender":"dev",
203
+
"receiver":"LizardLand",
204
+
"status":"ACTIVE",
205
+
"stats": {
206
+
"createdAt":1779459092037,
207
+
"expiresAt":1779545525988,
208
+
"duration":1
209
+
}
210
+
}
211
+
},
212
+
"pending": {} // A JSON dictionary representing pending pacts this nation has.
0 commit comments