This library has been archived in favor of web API usage on GitHub pages via CORS.
This library allows you to import data from the SC2 Pulse API into Google Sheets.
This library only works with English locales. Set any English(United States, United Kingdom, etc.) locale in your sheet settings under File->Settings->Locale menu.
- Sheets menu->Extensions->Apps Script
- Copy the script
- Alternativaly, you can Libraries(+)->Add a library, script id
10zJF-kY_ODbhzLlYztV2Ju_nH9PGftxnUOThYRDmshBj62w0DqtjrxWT. This allows you to use built-in versioning system, but you will have to redefine function signatures and call the lib from there.
This section describes how to define functions if you are using the lib by id rather than copying it. You can't call library functions directly from your sheets, so you have to redefine required functions in Apps Script and call the lib there.
Add the following code in the Apps Script editor
function summary1v1(characterIds, depth, sortBy = "rating_last") {
return SC2Pulse.summary1v1(characterIds, depth, sortBy);
}
function summary1v1Clan(tag, region, depth, sortBy = "rating_last") {
return SC2Pulse.summary1v1Clan(tag, region, depth, sortBy);
}
function ladder(
count,
regions = null,
leagues = null,
ratingStart = null,
skipCheaters = null,
reveal = null,
season = null){
return SC2Pulse.ladder(count, regions, leagues, ratingStart, skipCheaters, reveal, season);
}Now you can use library functions as regular functions in your sheets.
=summary1v1(characterIds, depth, sortBy)
characterIdsCharacter ids. Int array. Can be found in URL, for examplehttps://www.nephest.com/sc2/?type=character&id=236695&m=1#player-stats-mmr, copy theidparameter, in this case the id is236695.depthSummary depth, days. Integer. Max value: 120.sortBySorting options, descending order. Case insensitive. String.PLAYER_CHARACTER_IDGAMESRATING_MAXRATING_AVGRATING_LAST
Example: =summary1v1({236695, 2918753}, 60)
=summary1v1Clan(tag, region, depth, sortBy)
tagClan tag. Case sensitive. String.regionClan region. Case insensitive. String.EUUSKRCN
depthSummary depth, days. Integer. Max value: 120.sortBySorting options, descending order. Case insensitive. String.PLAYER_CHARACTER_IDGAMESRATING_MAXRATING_AVGRATING_LAST
Example: =summary1v1Clan("Heroes", "EU", 30, "games")
=ladder(teamCount, regions, leagues, ratingStart, reveal, season)
teamCountNumber of teams to load. Integer.regionsOptional region filter. String array.leaguesOptional league filter. String array.ratingStartOptional MMR starting point, descending order. Integer. Default: 10000.skipCheatersOptional cheater filter. Boolean. Default: false.revealOptional revealing of player names when possible. Boolean. Default: false.seasonOptional season id. Integer. Default: current season.
Example: =ladder(600, {"us", "eu", "kr", "cn"}, {"bronze", "silver", "gold", "platinum", "diamond", "master", "grandmaster"}, 10000, false, false,)
- COUNTIF
- Conditional formatting
- Live example: https://docs.google.com/spreadsheets/d/15SRUDoxjLclBZMY-TZs_yUnZnI9M4-ZesXhf_BEE66E/edit#gid=0
- Google sets quotas for Apps Script libraries, so it may take up to 10 seconds to load the data. The delay is on Google's side.
