Sample REST API based on Express.js demonstrating StarCraft2-API features.
Note that this project is for illustrative purposes only. It is not designed to run as a production server.
git clone https://github.com/lukemnet/starcraft2-api-example.git
cd starcraft2-api-example
npm install
Register a client app with Blizzard Battle.net Developer Portal. Note down client id and client secret.
Copy and rename the file .env.sample
to .env
. Edit it accordingly:
API_PORT='8080'
API_BATTLENET_KEY='your client app id'
API_BATTLENET_SECRET='your client app secret'
With Node:
npm start
With Nodemon:
nodemon start.js
GET /queryStaticProfileData/:regionId
Returns all static SC2 profile data (achievements, categories, criteria, and rewards).
GET /queryProfileMetadata/:regionId/:realmId/:profileId
Returns metadata for an individual’s profile.
GET /queryProfile/:regionId/:realmId/:profileId
Returns data about an individual SC2 profile.
GET /queryLadderSummary/:regionId/:realmId/:profileId
Returns a ladder summary for an individual SC2 profile.
GET /queryPlayerLadder/:regionId/:realmId/:profileId/:ladderId
Returns data about an individual profile’s ladder.
GET /queryGrandmasterLeaderboard/:regionId
Returns ladder data for the current season’s grandmaster leaderboard.
GET /querySeason/:regionId
Returns data about the current season.
GET /queryPlayerAccount/:regionId/:accountId
Returns metadata for an individual’s account.
GET /queryLegacyProfile/:regionId/:realmId/:profileId
Retrieves data about an individual SC2 profile.
GET /queryLegacyLadders/:regionId/:realmId/:profileId
Retrieves data about an individual SC2 profile’s ladders.
GET /queryLegacyMatchHistory/:region/:realmId/:profileId
Returns data about an individual SC2 profile’s match history.
GET /queryLegacyLadder/:regionId/:ladderId
Returns data about an individual SC2 ladder.
GET /queryLegacyAchievements/:regionId
Returns data about the achievements available in SC2.
GET /queryLegacyRewards/:regionId
Returns data about the rewards available in SC2.
GET /queryLeagueData/:regionId/:seasonId/:queueId/:teamType/:leagueId
Returns data for the specified season, queue, team, and league.
Author: lukemnet
Source Code: https://github.com/lukemnet/starcraft2-api-example
#nodejs #node #javascript