This project is a third-party package, and is strictly not affiliated with GuildWars2, ArenaNet, or NCSoft.
When used, no data is saved by, or sent to the developers, including but not limited to the logs, api tokens, or any objects returned by the endpoints.
Full support of all endpoints listed in the API:2 Wiki page
import { GW2Api, ApiLanguage } from "guildwars2-ts";
const api: GW2Api = new GW2Api({
// Token is not required for all of the endpoints
token: "YOUR-TOKEN-HERE",
language: ApiLanguage.English,
rateLimitRetry: true
});
(async () => {
// Obtain names of all characters on the account
await api.account.get().then(console.log);
// Obtain details about each of them
await api.characters.get().then((characters) => {
characters.forEach(async (character) => {
await api.characters.getCore(character).then(console.log);
});
});
})();
If you find any kinds of errors in the program code, or wish to add/update any of the functionality provided by this project, please feel free to open a pull request. Validation error logs are extremely helpful, so please include them in the request