In this tutorial, you will learn how to connect the Riot Games API to Google Sheets in 5 steps:

  1. Install the Apipheny Add-on
  2. Obtain your Riot API Key
  3. Choose an Endpoint URL
  4. Enter Riot API into Apipheny
  5. Run the Riot API request

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

To pull data from Riot Games into Google Sheets, you’ll first have to install and open the Apipheny Google Sheets add-on.

Apipheny is a 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. Click here for more information about Apipheny. There’s a 30-day free trial included, then it’s $19-$29/month.

1. Install Apipheny by opening the following link in on desktop and then clicking the Install button: https://gsuite.google.com/marketplace/app/apipheny/966163326746

Install Apipheny
Install Apipheny

2. After you’ve installed Apipheny, open a Google Sheet and then click on the Add-Ons 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 Sheet:

Open Apipheny

Step 2.) Obtain your Riot API Key

Sign in to your Riot Developer Account and in the Dashboard section, you should see your Development API Key:

Riot Games Development API key
Riot Games Development API key

The key is initially obscured, but by clicking the Show button you can see the key.

Then just copy and paste the key somewhere safe, because you’ll need it in the following steps.

NOTE: The Riot API key expires after 24 hours. If it’s been more than 24 hours since you last got your key, you must log in again and generate a new key by clicking the REGENERATE API KEY button.

Step 3.) Get your Riot Endpoint URL

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

First, open the Riot API documentation page: https://developer.riotgames.com/apis

The menu on the left contains a list of APIs, each with its own endpoints:

Riot Games API documentation
Riot Games API documentation

Clicking on an API displays a list of associated endpoints. For instance, the Champion-Mastery-V4 API displays a list of 3 endpoints.

Clicking each endpoint expands a section listing the endpoint’s specific documentation.

An example endpoint is Scores by Summoner:

https://.api.riotgames.com/lol/champion-mastery/v4/scores/by-summoner/{encryptedSummonerId}

The documentation for this endpoint contains the HTTP method used (GET), the link you should append to the root API URL for querying this endpoint, a short description of the endpoint’s purpose, the endpoint’s response classes, possible errors and available parameters:

Scores by Summoner API endpoint documentation
Scores by Summoner API endpoint documentation

All API calls to Riot should be made to the https://<platform_id>.api.riotgames.com base domain, where <platform_id> is the Region Platform that you’re making the request on.

Riot API root/base domain:
https://<platform_id>.api.riotgames.com

For example, users in North America will use NA1, those in Western Europe will use EUW1. See the Regional Endpoints page for more platform IDs: https://developer.riotgames.com/docs/tft

Step 4.) Enter the Riot API URL Into Apipheny

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 3, we explained how you can find the Riot REST API endpoint that you need. Now copy your complete API URL into the Apipheny add-on, where it says API URL Path, followed by any GET parameters required for your query.

For this example, we are using the following endpoint for retrieving the user’s information:

https://<platform_id>.api.riotgames.com/lol/summoner/v4/summoners/by-name/<your_username>?api_key=<YOUR-API-KEY>

In this URL, <your_username> is the name of your account and <YOUR-API-KEY> is the key you generated in Step 2.

Headers are not required for this API request, so you can leave that section blank in Apipheny.

Riot API request in Apipheny
Riot API request in Apipheny

Step 5.) Run the Riot API Request

Lastly, click the Run button at the bottom of the Apipheny add-on and then wait for the Riot Games data to be imported into your Google Sheet:

Riot Games API data in Google Sheets
Riot Games API data in Google Sheets

After making a successful request to the Riot API, try querying a different endpoint, or try using one of the more advanced features in the Apipheny add-on.

Related articles:

Related Posts

Leave a Comment