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 detailed information about various game entities. Specifically, the "Get Location Info" operation fetches detailed data about a specific location within the game, such as global or country-specific locations (e.g., Global, USA). This is useful for scenarios where you want to analyze or display statistics and metadata related to different geographic regions in Clash of Clans.

Practical examples include:

  • Displaying leaderboards or rankings filtered by location.
  • Gathering regional game statistics for analytics dashboards.
  • Integrating location-specific game data into community websites or apps.

Properties

Name Meaning
Location ID The unique identifier of the location to retrieve information for. Examples: 32000006 (Global), 32000007 (USA), etc.

Output

The node outputs a JSON object containing the response from the Clash of Clans API for the requested location. The structure includes:

  • operation: The operation performed ("getLocationInfo").
  • url: The full API endpoint URL used.
  • data: The detailed location information returned by the API, which typically includes metadata such as location name, country code, and other relevant stats.
  • timestamp: The ISO timestamp when the request was processed.
  • metadata: Additional metadata including operation type ("discovery"), API version ("v1"), and processing timestamp.

No binary data output is produced by this operation.

Example output JSON snippet:

{
  "operation": "getLocationInfo",
  "url": "https://api.clashofclans.com/v1/locations/32000006",
  "data": {
    "id": 32000006,
    "name": "Global",
    "countryCode": null,
    "isCountry": false,
    ...
  },
  "timestamp": "2024-06-01T12:00:00.000Z",
  "metadata": {
    "operationType": "discovery",
    "apiVersion": "v1",
    "processedAt": "2024-06-01T12:00:00.000Z"
  }
}

Dependencies

  • Requires an active Clash of Clans API key credential configured in n8n.
  • The node makes HTTP requests to the official Clash of Clans API at https://api.clashofclans.com/v1.
  • Proper internet connectivity and valid API token are necessary.

Troubleshooting

  • Common issues:

    • Invalid or missing API token will cause authentication errors.
    • Incorrect Location ID may result in 404 Not Found errors.
    • Network connectivity problems can lead to request timeouts or failures.
  • Error messages:

    • "Operation \"getLocationInfo\" not supported": Indicates an unsupported operation was selected; ensure the correct operation is chosen.
    • HTTP 401 Unauthorized: Check that the API token credential is correctly set up and valid.
    • HTTP 404 Not Found: Verify the Location ID is correct and exists in the Clash of Clans API.
  • Resolution tips:

    • Double-check the API credentials configuration.
    • Confirm the Location ID against official Clash of Clans documentation or API reference.
    • Use the "Continue on Fail" option in n8n to handle errors gracefully during batch processing.

Links and References

Discussion