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 data. Specifically, the "Get Current War" operation fetches detailed information about the current clan war for a specified clan. This is useful for players, clan leaders, or analysts who want real-time insights into ongoing wars, including participating clans, war status, and battle details.

Practical examples:

  • A clan leader automates war monitoring by fetching current war data to update a Discord channel.
  • A player tracks their clan’s war progress and performance metrics in an external dashboard.
  • An analyst aggregates war data across multiple clans to study strategies and outcomes.

Properties

Name Meaning
Clan Tag The unique identifier of the clan whose current war information you want to retrieve. Must start with #.

Output

The node outputs a JSON object containing the current war information for the specified clan. The structure includes:

  • operation: The operation performed (getCurrentWar).
  • url: The full API endpoint URL used for the request.
  • data: The raw response from the Clash of Clans API representing the current war details. This typically includes war state, teams, attacks, and timing.
  • timestamp: The ISO timestamp when the data was fetched.
  • metadata: Additional metadata such as operation type (clan), API version (v1), and processing timestamp.

No binary data output is produced by this operation.

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 clan tag (must start with #): Ensure the clan tag is correctly formatted.
    • Expired or invalid API token: Verify that the API key credential is valid and has not expired.
    • Network connectivity problems: Check internet access and firewall settings.
    • API rate limits exceeded: The Clash of Clans API enforces rate limits; avoid excessive requests.
  • Error messages:

    • "Operation "getCurrentWar" not supported": Indicates an unsupported operation was requested; verify the operation name.
    • HTTP errors like 401 Unauthorized or 403 Forbidden: Usually related to authentication issues; check API token validity.
    • 404 Not Found: The clan tag may be incorrect or the clan currently has no active war.

Links and References

Discussion