Clash Royale is a freemium strategy game by Supercell. In this tutorial, I’ll show you how to get a Clash Royale API token and how to make requests to the Clash Royale API in Google Sheets:
Apipheny is an API connector for Google Sheets. You can use Apipheny to connect your Google Sheets to unlimited API data sources, make unlimited API requests, and more. There is a 30 day free trial included.
1.) Install Apipheny by opening the following link on desktop and then clicking the Install button in the Google Marketplace: https://apipheny.io/install
2.) After you’ve installed Apipheny, open a Google Sheet and then click on the Extensions dropdown in the menu at the top.
In the dropdown list you should see Apipheny. Click Apipheny then click Import API to open the Apipheny sidebar in your Google Sheet.
Tip: you can open a new Google Sheet by entering this URL in your browser: sheet.new
To get your Key and Token, first log in to your Clash Royale developer account, or sign up for one if you haven’t already.
After logging in to your developer account, click on your username and then click My Account:
The My Keys section will then be displayed.
Click the Create New Key button:
Next, complete the key name and description.
Add an allowed IP address by completing the corresponding field and clicking the +Add IP Address button.
Finally, click the Create Key button:
Your Clash Royale API key will then be created.
Then, click the arrow next to your key to display your token:
Your Clash Royal API token will then be displayed.
Copy and paste your token to a safe location, because you’ll need it in the next steps:
In this section, I’ll show you how to browse the Clash Royale API documentation to find an API endpoint that retrieves the specific information you need from your Clash Royale account.
If you already know your API URL endpoint, or you want to use the same example URL as us, just skip to Step 4.
First, open the Clash RoyaleAPI documentation page: https://developer.clashroyale.com/#/documentation
The main page contains a list of endpoint’s categories: clans, players, cards, tournaments, locations and global tournaments:
Clicking on the corresponding Show/Hide link for a category will expand a list of specific endpoints.
Clicking one of the available Clah Royale API’s endpoints will open its documentation page, containing the endpoint’s HTTP method and URL, a short description of its purpose, a list of the accepted parameters and response messages, as well as a sample request and its associated sample response.
The example endpoint we’ll take a look at is /players/{playerTag}/battlelog from the Players category. The corresponding URL for this endpoint is:
https://api.clashroyale.com/v1/players/playerTag/battlelog
All API calls to Clash Royale should be made with this base URL:
https://api.clashroyale.com/v1/
Okay, now we’re in the home stretch. 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) as required by your Clash Royale API endpoint. For this example, we are using the GET method.
API URL: In Step 3, I explained how you can find the Clash Royale API endpoint that you need. Now copy the 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 Clans endpoint, which retrieves all the information about a clan. The corresponding URL for this endpoint is:
https://api.clashroyale.com/v1/clans
If you’re following the same example as us, just copy and paste the URL above into the “API URL” field in Apipheny.
Headers: In the Headers section of the Apipheny add-on, add two rows, with the following keys and values:
Header 1 Key: Accept Value: application/json
Header 2 Key: Authorization Value: Bearer your_token
your_token is the value of the token you obtained previously, in Step 2. There should be a literal space between Bearer and your_token
This is what your API request should look like when entered into Apipheny:
The last step is to click the Run button at the bottom of the Apipheny add-on and then your Clash Royale data will be imported into your Google Sheet:
After making a successful request to the Clash Royale API, try querying a different Clash Royale API endpoint, or try using one of the more advanced features in the Apipheny add-on, such as:
Make a GET request
Make a POST request
PUT, PATCH, & DELETE Requests
Save requests for later
Schedule requests for automatic updates
Reference cell values in requests
=APIPHENY custom function
Stack multiple URLs in a single request
Run all saved requests at once
Modify your request settings
Import & export saved API settings
Ahrefs API
Airtable API
Alpha Vantage API
Asana API
Binance API
Clickup API
Coingecko API
Coinmarketcap API
Coinbase API
Constant Contact API
Discord API
Drift API
Etsy API
Eventbrite API
Facebook Graph API
Facebook Ads API
Figma API
Github API
Google SERP API
Hubspot API
Hunter API
What is an API?
What is an API URL?
What are parameters?
What is an endpoint?
What is an API key/token?
What is basic authentication?
What are headers?
What is a GET request?
What is a POST request?