Skip to content

Commit 03a36f2

Browse files
update API html
1 parent 39e70a0 commit 03a36f2

File tree

1 file changed

+63
-58
lines changed

1 file changed

+63
-58
lines changed

assets/api/index.html

+63-58
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,88 @@
11
<!doctype html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/png" href="/icon.png" />
6-
<link rel="stylesheet" href="/index.css" />
7-
<meta name="viewport" content="width=device-width" />
3+
<head>
4+
<meta charset="UTF-8"/>
5+
<link rel="icon" type="image/png" href="/icon.png"/>
6+
<link rel="stylesheet" href="/index.css"/>
7+
<meta name="viewport" content="width=device-width"/>
88
<meta
9-
property="og:title"
10-
content="mcping.me minecraft server testing API"
9+
property="og:title"
10+
content="mcping.me minecraft server testing API"
1111
/>
12-
<meta property="og:type" content="website" />
13-
<meta property="og:image" content="https://mcping.me/icon.png" />
14-
<meta property="og:url" content="https://mcping.me/api/" />
15-
<meta property="og:site_name" content="mcping.me" />
12+
<meta property="og:type" content="website"/>
13+
<meta property="og:image" content="https://mcping.me/icon.png"/>
14+
<meta property="og:url" content="https://mcping.me/api/"/>
15+
<meta property="og:site_name" content="mcping.me"/>
1616
<meta
17-
property="og:description"
18-
content="A simple REST API for pinging Minecraft Java Edition and Bedrock edition servers. Also included: A system to test if some minecraft services are working. Free for all to use."
17+
property="og:description"
18+
content="A simple REST API for pinging Minecraft Java Edition and Bedrock edition servers. Also included: A system to test if some minecraft services are working. Free for all to use."
1919
/>
2020
<meta
21-
name="description"
22-
content="A simple REST API for pinging Minecraft Java Edition and Bedrock edition servers. Also included: A system to test if some minecraft services are working. Free for all to use."
21+
name="description"
22+
content="A simple REST API for pinging Minecraft Java Edition and Bedrock edition servers. Also included: A system to test if some minecraft services are working. Free for all to use."
2323
/>
2424
<title>Minecraft Server Testing API - mcping</title>
25-
</head>
25+
</head>
2626

27-
<body id="apiBody">
28-
<h1>MCping API</h1>
29-
<p>
30-
The MCping API is very simple. There is a Java API at /api/java/, and a
31-
bedrock api at /api/bedrock/. To specify what server to ping, you append
32-
that server to the end of the URL, like so:
33-
<a href="/api/java/mcping.me">/api/java/mcping.me</a>.
34-
</p>
35-
<p>
36-
The response will look as below, with an "icon" base64 PNG field added if
37-
the server has an icon. The latency is in milliseconds, from Toronto,
38-
Canada. Keep in mind that some servers may use signcode colors for the
39-
MOTD and player sample. Your application should handle this. The player
40-
sample is often used for advertising, so take it with a grain of salt. The
41-
Bedrock API response is the same, with the caveat of never returning the
42-
icon. The bedrock player list may also be synthetic.
43-
</p>
44-
<pre><code id="examplePingResponse">{
45-
"latency": 47,
27+
<body id="apiBody">
28+
<h1>MCping API</h1>
29+
<p>
30+
The MCping API is very simple. There is a Java API at /api/java/, and a
31+
bedrock api at /api/bedrock/. To specify what server to ping, you append
32+
that server to the end of the URL, like so:
33+
<a href="/api/java/mcping.me">/api/java/mcping.me</a>.
34+
</p>
35+
<p>
36+
The response will look as below, with an "icon" base64 PNG field added if
37+
the server has an icon. The latency is in milliseconds, from Toronto,
38+
Canada. Keep in mind that some servers may use signcode colors for the
39+
MOTD and player sample. Your application should handle this. The player
40+
sample is often used for advertising, so take it with a grain of salt. The
41+
Bedrock API response is the same, with the caveat of never returning the
42+
icon. The bedrock player list may also be synthetic.
43+
</p>
44+
<pre><code id="examplePingResponse">{
45+
"latency": 42,
4646
"players": {
47-
"online": 0,
47+
"online": 1,
4848
"maximum": 20,
49-
"sample": []
49+
"sample": [
50+
{
51+
"uuid": "bbb47773bb48438e806b7731b2724e84",
52+
"name": "mcping_me"
53+
}
54+
]
5055
},
5156
"motd": "Minecraft Support Discord Testing Server",
5257
"version": {
5358
"protocol": 765,
5459
"broadcast": "1.20.4"
5560
}
5661
}</code></pre>
57-
<p>
58-
There is also a Mojang Services API, at
59-
<a href="/api/services">/api/services</a>. This is useful for checking if
60-
the authservers or Xbox Services are having issues. Example response
61-
below. The possible values for each field are
62-
<code>DefiniteProblems</code>, <code>PossibleProblems</code>, and
63-
<code>Operational</code>.
64-
</p>
65-
<pre><code class="language-json">{
62+
<p>
63+
There is also a Mojang Services API, at
64+
<a href="/api/services">/api/services</a>. This is useful for checking if
65+
the authservers or Xbox Services are having issues. Example response
66+
below. The possible values for each field are
67+
<code>DefiniteProblems</code>, <code>PossibleProblems</code>, and
68+
<code>Operational</code>.
69+
</p>
70+
<pre><code class="language-json">{
6671
"Xbox services": "Operational",
6772
"SessionServer": "Operational",
6873
"Mojang API": "Operational",
6974
"Minecraft API": "Operational"
7075
}</code></pre>
71-
<p>
72-
In the root document (<a href="https://mcping.me/"
73-
><code>https://mcping.me/</code></a
74-
>), you can specify an auto-ping URL fragment. These are of the format
75-
<code>#ping;&lt;edition&gt;&semi;&lt;hostname&gt;</code>, and will
76-
automatically initialize a ping for the specified edition to the specified
77-
hostname and port. For example, you could have
78-
<a href="https://mcping.me/#ping;j;hypixel.net"
79-
><code>https://mcping.me/#ping;j;hypixel.net</code></a
80-
>.
81-
</p>
82-
</body>
76+
<p>
77+
In the root document (<a href="https://mcping.me/"
78+
><code>https://mcping.me/</code></a
79+
>), you can specify an auto-ping URL fragment. These are of the format
80+
<code>#ping;&lt;edition&gt;&semi;&lt;hostname&gt;</code>, and will
81+
automatically initialize a ping for the specified edition to the specified
82+
hostname and port. For example, you could have
83+
<a href="https://mcping.me/#ping;j;hypixel.net"
84+
><code>https://mcping.me/#ping;j;hypixel.net</code></a
85+
>.
86+
</p>
87+
</body>
8388
</html>

0 commit comments

Comments
 (0)