coc.supercell
About
coc.supercell
is a Node.js module that allows you to easily interact with the Clash Of Clans API.
Installation
npm install coc.supercell
yarn add coc.supercell
Example usage
Fetch a clan:
import { Client, ClanTypes } from "coc.supercell";
const client = new Client({ token: "XXXXX" });
const myClan = await client.clans.fetch("#2Q0U9YVYC");
console.log(myClan.name, myClan.type === ClanTypes.OPEN);
// -> Zenitsu
// -> false
console.log(myClan.members.length, myClan.members.map(x => x.level));
// -> 5
// -> [128, 83, 52, 45, 30]