API Documentation

Documentation on how to integrate our API in your service

Advertisement

Heads up! With the release of API revision 3 coming soon, use of the API will require an authorization token generated on the dashboard using a registered account. This system is put in place to reduce spam and other forms of abuse. Revision 3 is still unreleased and currently has no ETA, but a mid-2024 release time is to be expected. Additionally, these docs will be moving to the dashboard.

Overview

The goal of this API documentation is to accurately and precisely describe the functionality of this service in plain terms. This page will go over everything you need to know before implementing our API into your service. If you believe there is anything missing, any typos, or incorrect information on this page, please reach out to me via email at [email protected].

Standards

The majority of this API uses the standardized REST API, which in simple terms means you will be making HTTP requests to our service. We currently only support endpoints using the GET and POST methods. All status endpoints return a response body in JSON format, except if the response status code is not in the 200-299 success range, in which the body will be plain text. No other data formatting standard is available at this time, and there is currently no future plan to support anything other than JSON. All JSON returned from this service will have whitespace and any unnecessary characters removed to reduce network bandwidth and wasted information. You may learn more about the properties you receive from these routes by reading the documented response body from the route on this page.

Cache

To reduce the amount of spam and deliberate denial-of-service attacks of our service, we implement a caching system for all of the data we fetch, including but not limited to status responses and server icons. Each route has its own cache duration, unique to the pathname of the request. Please note that adding query parameters to the request will not force a fresh request, it will still return the cached response. All routes with data retrieved from the cache will contain a header in the response with the key X-Cache-Hit which will contain a boolean value whether or not our service used a value from cache. The response will also contain a X-Cache-Time-Remaining header if the cache was hit, which contains an integer with the amount of seconds remaining until the cache expires for this request. Any request made after this cache expiration time will result in fresh data being retrieved on our end. No exceptions will be made to the cache duration. If you want to bypass the cache, we recommend that you self-host the ping-server available on our GitHub organization.

Supported Versions

All Minecraft servers, including modern and legacy Java Edition servers, and Bedrock Edition servers, are supported. Make sure you are using the correct endpoint when retrieving a server status, as attempting to use the Java Edition status route with a Bedrock Edition host (or vise-versa) will result in a response saying the server is offline unless the server explicitly has cross-play supported. If the server you specify does not use the standard port value (25565 for Java Edition, 19132 for Bedrock Edition), then you will need to specify the port by using the following format: <host>:<port>.

Error Handling

You may encounter an error from any API endpoint if you attempt to use any malformed input, such as an incorrectly formatted server address or a strange value for a query parameter. Whether or not you expect it, you should always handle in case the server returns an error, always in the form of a non-200 status code response. If you do receive a non-200 status code response, the body will always contain a plain text string describing the error, with the Content-Type header set to text/plain. An example of a standard error is Invalid address value, returned if the server address provided is not in a recognized <host>:<port> or <host> format.

Revisions

Over the lifetime of this service, there has been a few changes that breaks compatibility with existing users who rely on consistent and non-changing data. When this happens, we release a new major version of the API called a revision, which is why you see /v2 in the URL of all API requests. As time goes on, we can no longer support previous revisions and have to shut them down. You may refer to the table below to see any major revisions from the past up until present time. If you use our API, it is generally recommended to come back to this page every so often to confirm the revision you are using is not becoming deprecated.

RevisionBase URLRelease DateDeprecation DateChangelog
Revision 1https://api.mcstatus.io/v1September 2021February 2023Initial API release
Revision 2https://api.mcstatus.io/v2July 2022

Routes

Java Status

Retrieves the status of any Java Edition Minecraft server. <address> should be replaced with the connection address of the server. For example, play.hypixel.net is a valid connection address as well as play.hypixel.net:25565.

GEThttps://api.mcstatus.io/v2/status/java/<address>

Bedrock Status

Retrieves the status of any Bedrock Edition Minecraft server. <address> should be replaced with the connection address of the server. For example, pe.mineplex.com is a valid connection address as well as pe.mineplex.com:19132.

GEThttps://api.mcstatus.io/v2/status/bedrock/<address>

Java Widget

Returns a widget image containing information about the Java Edition server. This widget can be embedded into any website or any source that allows images via URL. The image is generated on every request, but the status of the server may be cached.

GEThttps://api.mcstatus.io/v2/widget/java/<address>

Icon

Returns just the icon/favicon of any Java Edition Minecraft server. If connection to the server fails or if the server is offline then the default icon is returned. The address value is optional, and if not provided then the default icon is returned.

GEThttps://api.mcstatus.io/v2/icon/<address>

Send Vote

Allows you to send a Votifier vote to the specified server. All data should be sent as query parameters.

POSThttps://api.mcstatus.io/v2/vote

Libraries

We try and provide official support for integrating our service into many languages. The list of official and unofficial libraries are below.

Support

If you require any additional assistance or found a bug you would like to report, please send an email to [email protected]. We will be more than happy to provide any assistance.