Connecting the Minecraft API to Google Sheets

Minecraft is a popular online game. We can use the Minecraft API to import data from Minecraft into Google Sheets. In this tutorial, I’ll show you how to connect the Minecraft REST API to Google Sheets in 4 steps:

  1. Install the Apipheny add-on
  2. Choose a Minecraft Endpoint
  3. Enter your Minecraft API request into Apipheny
  4. Run the Minecraft API request in your Google Sheet

Step 1.) Install and open the Apipheny add-on in Google Sheets

To pull data from the Minecraft API to Google Sheets, first install and open the Apipheny Google Sheets add-on.

Apipheny is a no-code API integrator for Google Sheets that you can use to make unlimited API requests, connect to unlimited APIs, save API requests, schedule API requests, and more.

1. Install Apipheny by opening the following link on desktop and then clicking the Install button on the page: https://apipheny.io/install

Install Apipheny in the Google Workspace Marketplace
Install Apipheny in the Google Workspace Marketplace

2. After you’ve installed Apipheny, open a Google Sheet and then click on the Add-Ons or Extensions option in the top menu. In the add-ons menu, you should see Apipheny.

Click Apipheny > Import API to open the Apipheny sidebar in your Google Sheets.

Opening the Apipheny add-on in Google Sheets
Opening the Apipheny add-on in Google Sheets

Step 2.) Choose a Minecraft Endpoint

In this section, we’ll show you how to browse the Minecraft API documentation to find the API URL that retrieves the information you need from your account. If you already know your URL, or you want to use the same example URL as us, just skip to Step 3.

The Minecraft API is called Mojang. First, open its documentation page: https://wiki.vg/Mojang_API

The table of contents will be displayed, as a list of all the available endpoints for this API:

Minecraft API endpoints documentation
Minecraft API endpoints documentation

An example endpoint is UUID -> Name history, which returns all the usernames associated with an account in the past and the one they are using currently:

https://api.mojang.com/user/profiles//names

Each endpoint’s documentation contains the endpoint’s HTTP method (eg. GET), the URI, a short description of the endpoint’s purpose and an example response:

All API calls to Mojang should be made to the https://api.mojang.com/ base domain.

Step 3.) Enter your Minecraft API request into Apipheny

Now go back to your Google Sheet and make sure that the Apipheny add-on is open on the “Import” tab. With the Import tab open, enter these details into the add-on:

Method: At the top of the Apipheny sidebar, select the HTTP method (GET or POST) required by your API endpoint. For this example, we are using the GET method.

API URL: In Step 2, we explained how you can find the Mojang API endpoint that you need. Now copy and paste your complete Mojang API URL into the Apipheny add-on, where it says API URL Path, followed by any parameters required for your query (if applicable).

For this example, we are using the Username -> UUID at time endpoint, which returns the UUID for a username, at the timestamp provided. This is what the whole URL looks like:

https://api.mojang.com/users/profiles/minecraft/?at=
  • <username> represents your username
  • <timestamp> is the timestamp you want to get the UUID for
Minecraft API request entered into Apipheny
Minecraft API request entered into Apipheny

Step 4.) Run the Minecraft API request in your Google Sheet

Finally, the last step is to click the Run button at the bottom of the Apipheny add-on and then wait for the Mojang API data to be imported into your Google Sheet. Here’s what our request looked like when completed:

Minecraft data imported into Google Sheets
Minecraft data imported into Google Sheets

That’s it! You’ve successfully connected your Minecraft account to Google Sheets using the Mojang API, Google Sheets API, and the Apipheny add-on.

After making a successful request to the Mojang API, try querying a different Minecraft API endpoint, or try using one of the more advanced features in the Apipheny add-on, such as:

  • Save and schedule your Mojang API request
  • Make a POST request to the Mojang API (if available)
  • Use the custom =APIPHENY() function to call the Mojang API request inside your spreadsheet
  • Create an API request by referencing the value of a cell in your Mojang API URL with three curly braces eg. {{{Sheet1!A1}}}

Related articles:

Related Posts