This API can be accessed through either POST requests or GET requests. The available endpoints for each can be found under API Requests below:
API Requests:
All paths below extend the path for this page:- POST:
All POST data should have Content-Type of 'application/json', and be formatted the same as the objects returned by api.swgoh.help or swgoh-comlink.
See Accepted Unit Formats for a description of what those objects look like, and which properties must be included here. - GET:
Static Data -- defaults to maxium non-modded stats.
Query String Options:
The following options can be added to the query string of the request for any endpoints.For Example:
- flags -- a comma-separated list of the following options:
- gameStyle: adjusts the stat objects to return 'final' stats (the total seen in-game) instead of 'base' stats. Also applies same conversion as percentVals.
Example: - calcGP: Runs GP calculations along with any other calculations, and stores the resulting value in the unit's '.gp' property. Ship GP calculations require the crew to also be provided in the requested roster.
- onlyGP: Same as calcGP, but skips all other calculations.
- withoutModCalc: skips calculating mod stats on characters to speed up the calculation. Irrelevent to GET requests.
- percentVals: converts Crit Chance and Armor/Resistance from their flat values (default) to the percent values as displayed in-game.
Example: - useMax: calculates stats based on the maximum values for each unit requested. Overrides the useValues options.
Example: (NOTE: on Static Data GET requests, useMax is implied if useValues is missing) - scaled: returns all stats as their 'scaledValueDecimal' equivalents -- 10,000 times the common value. Non-modded stats should all be integers at this scale.
Example: - unscaled: returns all stats as their 'unscaledDecimalValue' equivalents -- 100,000,000 times the common value. All stats should be integers at this scale.
Example: - statIDs: leaves the stat object unlocalized and indexed by the stat ID. Ignores any specified language option.
Example: - enums: indexes the stat object by the unlocalized enum string used as a key in the game's localization files. Ignores any specified language option.
Example: - noSpace: in conjunction with the language option below, this flag will convert the localization string into standard camelCase with no spaces.
Example:
- gameStyle: adjusts the stat objects to return 'final' stats (the total seen in-game) instead of 'base' stats. Also applies same conversion as percentVals.
- useValues -- a JSON-style object (quotes optional, brackets required) with parameters to use for all units in the request.
The object is of the following structure:
Any properties can be skipped, and the default values will be used instead (max values for GET requests, unit values for POST data).
Some properties have multiple ways to define them, as follows:- equipped: (defaults to "all")
"all" defines all possible gear pieces are equipped.
"none" defines no gear pieces are equipped.
An Array can define which gear slots have gear equipped, i.e. [1,2,6] says the top two and the bottom right slots are filled.
An integer 1-6 can define how many pieces are equipped, without specific slots (crew definition only). - skills: (defaults to "max")
"max" defines all skills are maxed.
"maxNoZeta" defines all non-zeta skills are maxed, while Zeta abilities are still rank 7.
An integer 1-8 defines all skills to be at that rank if possible, or as close to it if they max at a lower rank (such as contracts). - relic: (defaults to 9)
1 - Relic Locked (gear <13).
2 - Relic Unlocked (but still level 0).
3-9 - Relic Levels 1-7, respectively. 'Tier' value here is Relic Level + 2, as defined in game data.
- equipped: (defaults to "all")
- language -- a string with the language code for the desired language.
Accepted Unit Formats:
All objects from api.swgoh.help's or swgoh-comlink's /player endpoint are accepted in POST data.The main types of object returned from that endpoint is referred to here as the Player-style (the /player endpoint) The minimum required data is outlined below. The useValues options may allow you to skip some of these fields, if necessary.
-
Player-Style
Only the .roster object within the player profile returned by /player is required and outlined below, but the full object -- an array of full player profiles -- is also accepted.
Game Data Assets:
All the raw game data used by this API is exposed on this site as well.However, the raw JSON data needed to use the calculator can be requested from the following GET endpoints:
- -- The base 'gameData' object used by the stat calculator. Built from many collections in the game /data endpoint.
- -- The current data version info, along with the supported localization languages.
- -- The English Localization object used.
- -- The Stat Enum object from in-game data. Text is formatted to match that used in the raw localization files that can be pulled off your device, mapping stat enums to the localization keys.