A script that uploads battle data from the SplatNet 2 app ("Nintendo Switch Online," for use with Splatoon 2) to http://stat.ink/, a site for visualizing and aggregating statistics from Splatoon and Splatoon 2.
$ python splatnet2statink.py [-M [N]] [-r] [-s] [-t]
The -M
flag runs the script in monitoring mode, uploading new battle results as you play games. The script checks for new battles every N
seconds; if no N
is provided, the script defaults to 300 (5 minutes).
The -r
flag, for use with monitoring mode, checks to see if there are recent battle records present on SplatNet 2 that haven't been uploaded to stat.ink and, if so, posts them.
The -s
flag suppresses uploading the scoreboard result image.
The -t
flag sends the data to stat.ink as a dry run, without uploading, for testing/validation purposes.
Note: Executing the script via ./splatnet2statink.py
is also possible on macOS or Linux. If you've downloaded this repository using the "Clone or download" button above (instead of via git clone
), the script must first be made executable by running chmod +x splatnet2statink.py
.
- Complete battle stats
- Lobby/mode, stage, weapon
- Result, final count/percent, turf inked
- Kills, deaths, assists, specials
- Rank & rank after, level & level after
- Battle start & end times
- Splatfest title & power
- Ranked power level & league power
- Monitoring for new battle results in real-time
- Scoreboard stats & player ranking
- Scoreboard/battle result image upload
- Full automation of SplatNet cookie generation/acquisition via user log-in
- Non-English language game support
- Gear + ability recognition
-
Download and install Python 2.7 (pre-installed on macOS) and the package manager pip.
-
From the command line (macOS: Terminal; Windows: Command Prompt/PowerShell), install the required Python libraries:
pip install requests pip install msgpack-python
If you're on Windows with multiple versions of Python installed, you'll have to use
py -2 -m pip
instead. If thepy
command is not recognized, use\Python27\python.exe \Python27\Scripts\pip.exe
(given you've installed Python 2.7 in the default directory). -
Running the script for the first time will prompt you to enter your stat.ink API key, which can be found in your profile settings. If you're using the app in a language other than English, you may choose choose to enter your language code (locale) as well.
-
You will then be asked to enter your
iksm_session
token. This can be obtained by following the mitmproxy instructions here. This token, along with your stat.ink API key and language, will automatically be saved intoconfig.txt
for you, and a cookie (used to access your SplatNet battle results) will be generated. You're now ready to upload battles!
Have any questions, issues, or suggestions? Feel free to message me on Twitter or Reddit.
日本語のセットアップ手順はこちら。質問があれば、ツイッター(@frozenpandaman)で連絡してください。日本語OK。
If you wish to access the SplatNet site from your computer rather than via the phone app, navigate to https://app.splatoon2.nintendo.net/home (it should show a forbidden error). Use a cookie editor (such as EditThisCookie for Chrome) to edit the iksm_session
cookie to be the same value as cookie
in config.txt
(generated after running the script for the first time), and refresh the page. If you only wish to access SplatNet 2 and don't have a stat.ink API key, simply enter "skip" for this step during setup.
Splatoon 2 stage rotation information (including Salmon Run) and current SplatNet gear are viewable at https://splatoon2.ink/.