Actions24
- Get Capital District Info
- Get Clan
- Get Clan Capital Info
- Get Clan Capital Raid Log
- Get Clan Members
- Get Clan Rankings
- Get Clan War Log
- Get Current War
- Get CWL Group
- Get CWL War
- Get League Info
- Get League Season Rankings
- Get League Seasons
- Get Location Info
- Get Location Rankings
- Get Locations
- Get Player
- Get Player Achievement Progress
- Get Player Battle Log
- Get Player Rankings
- Get Player Upcoming Chests
- Get War Leagues
- Search Clans
- Verify Player Token
Overview
This node integrates with the Clash of Clans API to retrieve various types of game data. Specifically, the "Get Player Battle Log" operation fetches the battle log for a specified player, providing detailed information about recent battles they participated in. This is useful for players, clan leaders, or analysts who want to track player activity, review battle outcomes, or analyze performance trends.
Practical examples:
- A clan leader monitoring members' recent battles to strategize upcoming wars.
- A player reviewing their own battle history to improve tactics.
- An analytics dashboard displaying recent player battles and statistics.
Properties
| Name | Meaning |
|---|---|
| Player Tag | The unique identifier of the player whose battle log is being retrieved. Must start with #. |
| Pagination | Parameters to control the number of results and pagination markers: |
| - Limit: Maximum number of battle log entries to return (minimum 1). | |
| - After: Return only items occurring after this marker (for pagination). | |
| - Before: Return only items occurring before this marker (for pagination). |
Output
The output JSON contains an object with the following structure:
{
"operation": "getPlayerBattleLog",
"url": "https://api.clashofclans.com/v1/players/{playerTag}/battlelog",
"data": { /* Battle log data from Clash of Clans API */ },
"timestamp": "ISO timestamp when data was fetched",
"metadata": {
"operationType": "player",
"apiVersion": "v1",
"processedAt": "ISO timestamp"
}
}
- The
datafield holds the raw battle log response from the Clash of Clans API, which includes details such as battle types, participants, results, and timestamps. - No binary data is output by this node.
Dependencies
- Requires an API key credential for the Clash of Clans API with appropriate permissions.
- The node makes HTTP requests to the official Clash of Clans API endpoint (
https://api.clashofclans.com/v1). - Proper configuration of the API token in n8n credentials is necessary.
Troubleshooting
Common issues:
- Invalid or missing player tag (must start with
#): The API will reject requests without a properly formatted player tag. - API authentication errors due to invalid or expired API token.
- Pagination parameters may cause empty results if markers are incorrect or out of range.
- Network connectivity issues affecting API calls.
- Invalid or missing player tag (must start with
Error messages:
"Operation 'getPlayerBattleLog' not supported": Indicates a misconfiguration or unsupported operation selected.- HTTP 401 Unauthorized: Check that the API token credential is valid and has not expired.
- HTTP 404 Not Found: Usually means the player tag does not exist or is mistyped.
Resolutions:
- Verify the player tag format and correctness.
- Ensure the API token credential is correctly set up and active.
- Adjust pagination parameters carefully to valid values.
- Confirm network access to the Clash of Clans API endpoint.
Links and References
- Official Clash of Clans API documentation: https://developer.clashofclans.com/#/documentation
- n8n documentation on creating and using API credentials: https://docs.n8n.io/credentials/overview/