Skip to content
This repository has been archived by the owner. It is now read-only.
Unofficial node library for
Branch: master
Clone or download
Latest commit c68b37f Oct 30, 2018

Build Status npm version Coverage Status dependencies Status devDependencies Status Discord Known Vulnerabilities


INFORMATION 2018-09-16

swgoh is providing an API at, I strongly recommend using that, because this library currently is scrapping data from HTML. I will probably move this library to use API, but that will be a breaking change and not backwards compatible because the interface contract will change aka the data return will be different.


Node library to get information of swgoh parsing, you can get profile, characters, guild members, ships, units and mods.

Code Example


const swgoh = require("swgoh").swgoh
import {swgoh} from 'swgoh';
const username= "pikax";
swgoh.profile(username).then(function (p) {

  return swgoh.guild(p.guildUrl);

const allyCode= "495616697";

const guild = "/g/232/requiem/"; // or {id:232}



// login
const user = {
    username: 'pikax',
    password: 'MySuperSecurePassword'

swgoh.login(user.username, user.password); //Promise<boolean>

//cached characters & ships
import {getCharacters, getShips} from 'swgoh';

Get assets

The asset location by default is to swogh/static/img, but you can reset to using the environment config USE_SWGOH_ASSET=1

in code:

process.env.USE_SWGOH_ASSET = 1;

import {swgoh} from 'swgoh';

Get custom asset location

You can set a custom asset location by specifying it using environment config SWGOH_ASSET_LOCATION={assetpath}

in code

process.env.SWGOH_ASSET_LOCATION = "https://assets.mysupawebsite.web/swgoh";

import {swgoh} from 'swgoh';


With TB just released, this library provides easy way to get data from


yarn add swgoh
npm i swgoh


All notable changes to this project will be documented in this file.

KNOWN issues is capping the number of mods you can get in your profile, I can't fix this without making breaking changes, you should use swoghApi.


  • Toon info parsing
  • Login support

[0.8.0] 2018-10-30

  • Added Ally methods to use allyCode

[0.7.1] 2018-09-16

  • Trim toon description
  • fix star count on ships

[0.7.0] 2018-09-15

  • Update static and dependencies
  • Remove collectionScore property from the contract, since doesn't provide it anymore
  • Add profileAlly(allyCode) method, same as profile(username) but you pass the ally, username will be dropped.
  • username is no longer username, now is playername, username will be dropped.

[0.6.0] 2018-08-26

[0.5.11] 2018-07-14

[0.4.10] 2018-06-29

[0.4.9] 2018-05-26

[0.4.8] 2018-05-17

[0.4.7] 2018-04-26

  • Cache for Characters (Bossk added)

[0.4.6] 2018-04-12

[0.4.5] 2018-02-10

  • Improved retrieving mods performance

[0.4.4] 2018-02-10

  • Added lastUpdatedUTC to profile #5

[0.4.2] 2018-02-08

  • Updated cached files

[0.4.1] 2018-01-07

  • Cache for Characters & Ship stats
  • Added Jest Tests

[0.3.2] 2017-12-02

[0.3.1] 2017-09-28

  • Player mods collection

[0.2.1] 2017-09-22

[0.1.3] 2017-09-20

  • Fix "Profile Data undefined" when not showing AllyCode on Swgoh (#2)

[0.1.2] 2017-09-20

  • Added support for ships

[0.1.1] 2017-08-19

  • Fixed issue with stars when getting collection

[0.1.0] 2017-08-19

  • First release, support collection (toons), player info and guild info.




The developer of this application does not have any affiliation with the Capital Games, Disney, Lucasfilm Limited or

You can’t perform that action at this time.