Clash of Clans icon

Clash of Clans

Comprehensive Clash of Clans API integration with advanced features

Overview

This node integrates with the Clash of Clans API to retrieve various types of game-related data. Specifically, the "Get Player" operation fetches detailed profile information about a player using their unique player tag. This is useful for scenarios such as tracking player statistics, monitoring progress, or integrating player data into dashboards and reports.

Practical examples include:

  • Fetching a player's current level, trophies, and clan affiliation.
  • Monitoring player achievements or battle logs by extending to related operations.
  • Verifying player identity via token verification (other operations).

Properties

Name Meaning
Player Tag The unique identifier of the player, must start with #. Used to specify which player's profile to retrieve.

Output

The output is a JSON object containing the following fields:

  • operation: The name of the executed operation (getPlayer).
  • url: The full URL used to query the Clash of Clans API for the player.
  • data: The raw response data from the API representing the player's profile information. This typically includes details like player name, level, trophies, clan info, achievements, etc.
  • timestamp: The ISO timestamp when the data was fetched.
  • metadata: Additional metadata including:
    • operationType: Categorizes the operation type (e.g., "player").
    • apiVersion: The version of the API used ("v1").
    • processedAt: Timestamp indicating when the response was processed.

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential for authenticating requests to the official Clash of Clans API.
  • The node makes HTTP requests to https://api.clashofclans.com/v1.
  • Proper configuration of the API key credential in n8n is necessary for successful execution.

Troubleshooting

  • Invalid Player Tag: If the player tag does not start with # or is malformed, the API will likely return an error. Ensure the tag format is correct.
  • Authentication Errors: Missing or invalid API token will cause authorization failures. Verify that the API key credential is correctly set up and has proper permissions.
  • API Rate Limits: Excessive requests may lead to rate limiting by the Clash of Clans API. Implement retry logic or reduce request frequency if encountering HTTP 429 errors.
  • Network Issues: Connectivity problems can cause request failures. Check network access and proxy settings if applicable.
  • Unhandled Operation: If an unsupported operation is selected, the node throws an error indicating the operation is not supported.

Links and References

Discussion