Access the Nintendo Switch Online and Nintendo Switch Parental Controls app APIs.

Overview

nxapi

Access the Nintendo Switch Online and Nintendo Switch Parental Controls app APIs. Includes Discord Rich Presence, friend notifications and data downloads.

Features

  • Command line and menu bar app interfaces

  • Interactive Nintendo Account login for the Nintendo Switch Online and Nintendo Switch Parental Controls apps

  • Automated login to the Nintendo Switch Online app API

    • This uses splatnet2statink and flapg APIs by default.
    • Alternatively a custom server using a rooted Android device/emulator is included.
  • Get Nintendo Switch account information, friends list and game-specific services

  • Show Discord Rich Presence using your own or a friend's Nintendo Switch presence

    Screenshot showing Splatoon 2 as a Discord activity

  • Show notifications for friend Nintendo Switch presences

    Screenshot showing a presence notification

  • [Electron app] Open game-specific services

    • Including NookLink, which doesn't work in web browsers as it requires custom JavaScript APIs.
  • Nintendo Switch Online app API proxy server

    • This allows a single account to fetch presence for multiple users.
    • Data will be cached for a short time to reduce the number of requests to Nintendo's server.
    • This automatically handles authentication when given a Nintendo Account session token. This makes it much easier to access the API from a browser, in scripts or in other software.
  • Download all personalised SplatNet 2 data, including battle and Salmon Run results

    • This supports monitoring the authenticated user's presence and only checking for new data when playing Splatoon 2 online.
  • Download island newspapers from and send messages and reactions using NookLink

  • Download all Nintendo Switch Parental Controls usage records

The API library and types are exported for use in JavaScript/TypeScript software. The app/commands properly cache access tokens and try to handle requests to appear as Nintendo's apps - if using nxapi as a library you will need to handle this yourself.

Do I need a Nintendo Switch Online membership?

No.

The only requirement to use this is that your Nintendo Account is linked to a Network Service Account, i.e. you've linked your Nintendo Account to a Nintendo Switch console at some point. It doesn't matter if your account is no longer linked to any console.

You will need to have had an online membership (free trial is ok) to use any game-specific services if you want to access those. SplatNet 2 can be used without an active membership, but NookLink and Smash World both require an active membership just to open them.

For Parental Controls data, you don't need to have linked your account to a console. You will need to use Nintendo's app to add a console to your account though, as this isn't supported in nxapi and the Parental Controls API is a bit useless without doing this.

Will my Nintendo Switch console be banned for using this?

No.

Will my Nintendo Account/Network Service Account be banned for using this?

It's extremely unlikely:

  • Other projects (e.g. splatnet2statink, splatoon2.ink) have used the same reverse engineered APIs for a long time (pretty much since they've existed) and no one has ever been banned for using them. splatnet2statink in monitoring mode updates every 5 minutes by default - monitoring commands (Discord presence, friend notifications and SplatNet 2 monitoring) in nxapi only update slightly more frequently (every 1 minute), so there's not much higher risk than using splatnet2statink.
  • Unlike console bans, account bans would prevent you from accessing digital content or online services you've paid for. (If your console was banned you'd still be able to use it and you could just buy another one to access your account.)
  • Nintendo can't stop you watching their app's network activity, which is all the reverse engineering required to develop this.

For Discord Rich Presence, you can create an additional account, add your main account as a friend and use the --friend-nsaid option to avoid automating your main account. Once set up, you can remove the additional account from any console. You can also set up an API proxy server (with a HTTPS reverse proxy), authenticate using a separate account, and set up API proxy authentication tokens to allow up to 300 users (max. Nintendo Switch friends) to set up Discord Rich Presence (or, get their Nintendo Switch presence in a simple HTTP request to use for anything else) without any additional requests to Nintendo.

Why is a token sent to one/two different non-Nintendo servers?

It's required to generate some data to make Nintendo think you're using the real Nintendo Switch Online app. (This isn't required for Parental Controls data.) See the splatnet2statink and flapg section below for more information.

Currently it's too hard to do this locally. nxapi includes a service to do this using a rooted Android device/emulator. Hopefully at some point this will become easier.

This is really annoying. Initially the Nintendo Switch Online app didn't perform any sort of client attestation at all, then Nintendo added a HMAC of the id_token, timestamp and request ID to app/web service login requests, using a secret key embedded in the app, which was soon discovered. Nintendo later updated the app to use a native library (libvoip, which is also used for the app's VoIP features) to do this, and still no one knows how it works. (To make things even more confusing, the function, genAudioH/genAudioH2, always returns a different result, even when given the same inputs.)

The reason Nintendo added this is probably to try and stop people automating access to their app's API. I really hope that's wrong though, as then Nintendo would be prioritising that over account security, as most people seem ok with sharing account credentials to access the API. (And it's not stopping anyone accessing the API outside of the app anyway.)

Electron app

nxapi includes an Electron menu bar app. Currently it can only be used by installing from source (there's no packaged version yet).

The app can currently be used to:

  • Login to a Nintendo Account, both for the Nintendo Switch Online app and Parental Controls app.
    • This will open the Nintendo Account login page in the app, just like signing into Nintendo's own apps.
    • Accounts are shared with the nxapi command line interface.
  • Share an authenticated Nintendo Account's presence to Discord.
    • Using a custom presence URL or a friend's presence is not supported.
    • Only one user can be selected - selecting another user will stop sharing the first user's presence.
  • Showing notifications for an authenticated user/friend's presence.
    • Multiple users can be selected, but this doesn't work yet.
  • Access game-specific services.
    • These will be opened in the app.

Screenshot of the menu bar app open with SplatNet 2 and NookLink open in the background

After installing nxapi from source the app can be run using this command:

nxapi app

This command has no options, but environment variables can still be used.

Install

Install with npm

Node.js and npm must already be installed.

# From registry.npmjs.com
npm install --global nxapi

# From gitlab.fancy.org.uk
npm install --global --registry https://gitlab.fancy.org.uk/api/v4/packages/npm/ @samuel/nxapi

# From npm.pkg.github.com
npm install --global --registry https://npm.pkg.github.com @samuelthomas2774/nxapi

Install from source

Node.js and npm must already be installed.

git clone https://gitlab.fancy.org.uk/samuel/nxapi.git # or download as an archive
cd nxapi

# Install locally
npm install
npx tsc
npm link

# Build Docker image
docker build . --tag gitlab.fancy.org.uk:5005/samuel/nxapi
# # Run in Docker
# docker run -it --rm -v ./data:/data gitlab.fancy.org.uk:5005/samuel/nxapi ...

Nintendo Switch Online

Login to the Nintendo Switch Online app

# Interactive login
# Generates a link to login with a Nintendo Account, asks for the link then automatically gets a session token
nxapi nso auth

# Login with an existing token
# Use with a token obtained via MITM the app, or with `nxapi nso auth --no-auth`
# The same session token as for the Nintendo Switch Parental Controls app cannot be used
nxapi nso token

# Get the authenticated user
nxapi nso user

Discord Presence

# Show the authenticated user's presence
nxapi nso presence

# Show a friend's presence
# Use `nxapi nso friends` to show all friend's Nintendo Switch account IDs
nxapi nso presence --friend-nsaid 0123456789abcdef

# Show the authenticated user's friend code in Discord
nxapi nso presence --friend-code
nxapi nso presence --friend-code -

# Show a custom friend code in Discord
# Use this if you are showing presence of a friend of the authenticated user
nxapi nso presence --friend-code 0000-0000-0000
nxapi nso presence --friend-code SW-0000-0000-0000

# Show inactive presence
# This will show a "Not playing" status if any consoles linked to the user's account is online but the user
# is not selected in a game
# Don't enable this if you are not the only user of all consoles linked to your account
nxapi nso presence --show-inactive-presence

# Also show friend notifications (see below)
nxapi nso presence --friend-notifications
nxapi nso presence --user-notifications --friend-notifications
nxapi nso presence --user-notifications

# Set update interval to 60 seconds
nxapi nso presence --update-interval 60

# Fetch presence from a custom URL (see `nxapi nso http-server`)
nxapi nso presence --presence-url "http://[::1]:12345/api/znc/user/presence"
nxapi nso presence --presence-url "http://[::1]:12345/api/znc/friend/0123456789abcdef/presence"

Friend presence notifications

This uses node-notifier to display native desktop notifications.

# Show notifications for all friends
nxapi nso notify

# Show notifications for all friends + the current user
nxapi nso notify --user-notifications

# Show notifications for only the current user
nxapi nso notify --user-notifications --no-friend-notifications

# Set update interval to 60 seconds
nxapi nso notify --update-interval 60

Friends

# Show Nintendo Switch friends in a table
nxapi nso friends

# JSON
nxapi nso friends --json
nxapi nso friends --json-pretty-print

Nintendo Switch Online app announcements/alerts

# Show app announcements in a table
nxapi nso announcements

# JSON
nxapi nso announcements --json
nxapi nso announcements --json-pretty-print

Web services/game-specific services

# Show web services in a table
nxapi nso webservices

# JSON
nxapi nso webservices --json
nxapi nso webservices --json-pretty-print

# Get an access token for a web service
# This should be sent with the first request to the web service URL in the `x-gamewebtoken` header
nxapi nso webservicetoken 5741031244955648
nxapi nso webservicetoken 5741031244955648 --json
nxapi nso webservicetoken 5741031244955648 --json-pretty-print

API proxy server

Use this to access the Nintendo Switch Online app API from a browser/other HTTP client easily.

# Start the server listening on all interfaces on a random port
nxapi nso http-server

# Start the server listening on a specific address/port
# The `--listen` option can be used multiple times
nxapi nso http-server --listen "[::1]:12345"

# Use the API proxy server in other commands
nxapi nso ... --znc-proxy-url "http://[::1]:12345/api/znc"
ZNC_PROXY_URL=http://[::1]:12345/api/znc nxapi nso ...

# Start the server using another API proxy server
nxapi nso http-server --znc-proxy-url "http://[::1]:12345/api/znc"
ZNC_PROXY_URL=http://[::1]:12345/api/znc nxapi nso http-server

# Allow requests without a Nintendo Account session token
# Anyone connecting to the API proxy server will be able to use any already authenticated user with their Nintendo Account ID
# Don't set this if anyone can connect to the server!
nxapi nso http-server --listen "[::1]:12345" --no-require-token

# Limit the frequency of friends/announcements/web services requests to 60 seconds
nxapi nso http-server --update-interval 60

# Make API requests using curl
curl --header "Authorization: na $NA_SESSION_TOKEN" "http://[::1]:12345/api/znc/auth"
curl --header "Authorization: na $NA_SESSION_TOKEN" "http://[::1]:12345/api/znc/announcements"
curl --header "Authorization: na $NA_SESSION_TOKEN" "http://[::1]:12345/api/znc/friends"
curl --header "Authorization: na $NA_SESSION_TOKEN" "http://[::1]:12345/api/znc/friends/presence"
curl --header "Authorization: na $NA_SESSION_TOKEN" "http://[::1]:12345/api/znc/friend/0123456789abcdef"
curl --header "Authorization: na $NA_SESSION_TOKEN" "http://[::1]:12345/api/znc/friend/0123456789abcdef/presence"
curl --header "Authorization: na $NA_SESSION_TOKEN" "http://[::1]:12345/api/znc/webservices"
curl --header "Authorization: na $NA_SESSION_TOKEN" "http://[::1]:12345/api/znc/webservice/5741031244955648/token"
curl --header "Authorization: na $NA_SESSION_TOKEN" "http://[::1]:12345/api/znc/activeevent"
curl --header "Authorization: na $NA_SESSION_TOKEN" "http://[::1]:12345/api/znc/user"
curl --header "Authorization: na $NA_SESSION_TOKEN" "http://[::1]:12345/api/znc/user/presence"

# Watch for changes to the user and all friends presence
curl --header "Authorization: na $NA_SESSION_TOKEN" --no-buffer "http://[::1]:12345/api/znc/presence/events"

# Make API requests using curl without a session token
# The `--no-require-token` must be set when running the server, and the user must have previously authenticated to the server, either with the API proxy server or using commands on the server
curl "http://[::1]:12345/api/znc/announcements?user=0123456789abcdef"
curl "http://[::1]:12345/api/znc/friends?user=0123456789abcdef"
curl "http://[::1]:12345/api/znc/friends/presence?user=0123456789abcdef"
curl "http://[::1]:12345/api/znc/friend/0123456789abcdef?user=0123456789abcdef"
curl "http://[::1]:12345/api/znc/friend/0123456789abcdef/presence?user=0123456789abcdef"
curl "http://[::1]:12345/api/znc/webservices?user=0123456789abcdef"
curl "http://[::1]:12345/api/znc/webservice/5741031244955648/token?user=0123456789abcdef"
curl "http://[::1]:12345/api/znc/activeevent?user=0123456789abcdef"
curl "http://[::1]:12345/api/znc/user?user=0123456789abcdef"
curl "http://[::1]:12345/api/znc/user/presence?user=0123456789abcdef"
curl --no-buffer "http://[::1]:12345/api/znc/presence/events?user=0123456789abcdef"

splatnet2statink and flapg

The splatnet2statink and flapg APIs are used by default to automate authenticating to the Nintendo Switch Online app's API and authenticating to web services. An access token (id_token) created by Nintendo must be sent to these APIs to generate some data that is required to authenticate the app. These APIs run the Nintendo Switch Online app in an Android emulator to generate this data. The access token sent includes some information about the authenticated Nintendo Account and can be used to authenticate to the Nintendo Switch Online app and web services.

Specifically, the tokens sent are JSON Web Tokens. The token sent to login to the app includes this information and is valid for 15 minutes, and the token sent to login to web services includes this information and is valid for two hours.

Alternatively nxapi includes a custom server using Frida on an Android device/emulator that can be used instead of these.

This is only required for Nintendo Switch Online app data. Nintendo Switch Parental Controls data can be fetched without sending an access token to a third-party API.

SplatNet 2

All SplatNet 2 commands may automatically request a web service token. This will involve the splatnet2statink and flapg APIs (or a custom server). This can be disabled by setting --no-auto-update-session, however this will cause commands to fail if there isn't a valid SplatNet 2 token.

User

# Show the authenticated SplatNet 2 user
nxapi splatnet2 user

Download user records

# Download user records to the splatnet2 directory in nxapi's data path
# Data that already exists will not be redownloaded
nxapi splatnet2 dump-records
# Download user records to data/splatnet2
nxapi splatnet2 dump-records data/splatnet2
# Don't include user records (when downloading other data)
nxapi splatnet2 dump-records --no-user-records

# Include lifetime inkage challenge images
nxapi splatnet2 dump-records --challenges

# Include profile image (share button on the home page)
nxapi splatnet2 dump-records --profile-image
nxapi splatnet2 dump-records --profile-image --favourite-stage "Starfish Mainstage" --favourite-colour purple

# Download user records even if they already exist and haven't been updated
nxapi splatnet2 dump-records --no-new-records

# Include hero (Octo Canyon) records
# If this option is included hero records will always be downloaded even if they haven't been updated
nxapi splatnet2 dump-records --hero-records
# Only download hero records
nxapi splatnet2 dump-records --no-user-records --hero-records

# Include timeline (CPOD FM on the home page)
# If this option is included the timeline will always be downloaded even if it hasn't been updated
nxapi splatnet2 dump-records --timeline
# Only download the timeline
nxapi splatnet2 dump-records --no-user-records --timeline

Download battle/Salmon Run results

# Download battle and Salmon Run results to the splatnet2 directory in nxapi's data path
# Data that already exists will not be redownloaded
nxapi splatnet2 dump-results
# Download battle and Salmon Run results to data/splatnet2
nxapi splatnet2 dump-results data/splatnet2

# Include battle summary image (share button on the battles list)
nxapi splatnet2 dump-results --battle-summary-image

# Include battle result images (share button on the battle details page)
nxapi splatnet2 dump-results --battle-images

# Only download battle results
nxapi splatnet2 dump-results --no-coop
# Only download Salmon Run results
nxapi splatnet2 dump-results --no-battles

# Download summary data even if user records haven't been updated
# Individual battle results/images/Salmon Run results still won't be redownloaded if they exist
nxapi splatnet2 dump-results --no-check-updated

Monitor SplatNet 2 for new user records/battle/Salmon Run results

This will constantly check SplatNet 2 for new data.

# Watch for new battle and Salmon Run results and download them to the splatnet2 directory in nxapi's data path
nxapi splatnet2 monitor

# Watch for new battle and Salmon Run results and download them to data/splatnet2
nxapi splatnet2 monitor data/splatnet2

# Include profile image (share button on the home page)
nxapi splatnet2 monitor --profile-image
nxapi splatnet2 monitor --profile-image --favourite-stage "Starfish Mainstage" --favourite-colour purple

# Include battle summary image (share button on the battles list)
nxapi splatnet2 monitor --battle-summary-image

# Include battle result images (share button on the battle details page)
nxapi splatnet2 monitor --battle-images

# Only download battle results
nxapi splatnet2 monitor --no-coop
# Only download Salmon Run results
nxapi splatnet2 monitor --no-battles

# Set update interval to 1800 seconds (30 minutes)
nxapi splatnet2 monitor --update-interval 1800

SplatNet 2 monitoring can also be used with nxapi nso notify and nxapi nso presence. Data will only be downloaded from SplatNet 2 if the authenticated user is playing Splatoon 2 online.

This can be used with nxapi nso presence --presence-url ... (the presence URL must return the status of the user authenticating to SplatNet 2). When used with --friend-nsaid the friend's presence will be shared on Discord but the authenticated user's presence will still be used to check if SplatNet 2 data should be updated.

# Watch for new battle and Salmon Run results and download them to the splatnet2 directory in nxapi's data path
# All options support both the notify and presence commands
nxapi nso notify --splatnet2-monitor
nxapi nso presence --splatnet2-monitor

# Watch for new battle and Salmon Run results and download them to data/splatnet2
nxapi nso presence --splatnet2-monitor --splatnet2-monitor-directory data/splatnet2
nxapi nso presence --splatnet2-monitor --sn2-path data/splatnet2

# Include profile image (share button on the home page)
nxapi nso presence --splatnet2-monitor --splatnet2-monitor-profile-image
nxapi nso presence --splatnet2-monitor --sn2-profile-image

nxapi nso presence --splatnet2-monitor --splatnet2-monitor-profile-image --splatnet2-monitor-favourite-stage "Starfish Mainstage" --splatnet2-monitor-favourite-colour purple
nxapi nso presence --splatnet2-monitor --sn2-profile-image --sn2-favourite-stage "Starfish Mainstage" --sn2-favourite-colour purple

# Include battle summary image (share button on the battles list)
nxapi nso presence --splatnet2-monitor --splatnet2-monitor-battle-summary-image
nxapi nso presence --splatnet2-monitor --sn2-battle-summary-image

# Include battle result images (share button on the battle details page)
nxapi nso presence --splatnet2-monitor --splatnet2-monitor-battle-images
nxapi nso presence --splatnet2-monitor --sn2-battle-images

# Only download battle results
nxapi nso presence --splatnet2-monitor --no-splatnet2-monitor-coop
nxapi nso presence --splatnet2-monitor --no-sn2-coop
# Only download Salmon Run results
nxapi nso presence --splatnet2-monitor --no-splatnet2-monitor-battles
nxapi nso presence --splatnet2-monitor --no-sn2-battles

# Set update interval to 60 seconds
nxapi nso presence --splatnet2-monitor --splatnet2-monitor-update-interval 60
nxapi nso presence --splatnet2-monitor --sn2-update-interval 60

NookLink

All NookLink commands may automatically request a web service token. This will involve the splatnet2statink and flapg APIs (or a custom server). This can be disabled by setting --no-auto-update-session, however this will cause commands to fail if there isn't a valid NookLink token.

User

# Show NookLink users in a table
nxapi nooklink users

# Show the authenticated NookLink user
nxapi nooklink user

# Show the authenticated NookLink user's island and other players
nxapi nooklink island

# Use a specific NookLink user linked to the selected Nintendo Account
# If more than 1 NookLink users exist by default the first user will be used
nxapi nooklink user --islander 0x0123456789abcdef
# --user can also be used to selecte a different Nintendo Account
nxapi nooklink user --user 0123456789abcdef
nxapi nooklink user --user 0123456789abcdef --islander 0x0123456789abcdef

Newspapers

# Show the latest newspaper issue in a table
nxapi nooklink newspaper
# JSON
nxapi nooklink newspaper --json
nxapi nooklink newspaper --json-pretty-print

# List newspaper issues in a table
nxapi nooklink newspapers
# JSON
nxapi nooklink newspapers --json
nxapi nooklink newspapers --json-pretty-print

# Show a specific newspaper issue in a table
nxapi nooklink newspaper 00000000-0000-0000-0000-000000000000
# JSON
nxapi nooklink newspaper 00000000-0000-0000-0000-000000000000 --json
nxapi nooklink newspaper 00000000-0000-0000-0000-000000000000 --json-pretty-print

Download newspapers

# Download all island newspapers to the nooklink directory in nxapi's data path
# Data that already exists will not be redownloaded
nxapi nooklink dump-newspapers

# Download all island newspapers to data/nooklink
nxapi nooklink dump-newspapers data/nooklink

Messages

# Send a message in an online Animal Crossing: New Horizons session
nxapi nooklink keyboard "Hello"

# Ask for a message interactively
nxapi nooklink keyboard

# List available reactions
nxapi nooklink reactions

# Send a reaction
nxapi nooklink post-reaction happyflower

Nintendo Switch Parental Controls

Login to the Nintendo Switch Parental Controls app

# Interactive login
# Generates a link to login with a Nintendo Account, asks for the link then automatically gets a session token
nxapi pctl auth

# Login with an existing token
# Use with a token obtained via MITM the app, or with `nxapi pctl auth --no-auth`
# The same session token as for the Nintendo Switch Online app cannot be used
nxapi pctl token

# Get the authenticated user
nxapi pctl user

Nintendo Switch consoles

# Show Nintendo Switch consoles in a table
nxapi pctl devices

# JSON
nxapi pctl devices --json
nxapi pctl devices --json-pretty-print

Daily summaries

# Show daily summary data in a table
# Use `nxapi pctl devices` to get the device ID
nxapi pctl daily-summaries 0123456789abcdef

# JSON
nxapi pctl daily-summaries 0123456789abcdef --json
nxapi pctl daily-summaries 0123456789abcdef --json-pretty-print

Monthly summaries

# Show monthly summaries in a table
# Use `nxapi pctl devices` to get the device ID
nxapi pctl monthly-summaries 0123456789abcdef

# JSON
nxapi pctl monthly-summaries 0123456789abcdef --json
nxapi pctl monthly-summaries 0123456789abcdef --json-pretty-print

# Show data for the February 2022 monthly summary in a table
nxapi pctl monthly-summary 0123456789abcdef 2022-02

# JSON
nxapi pctl monthly-summary 0123456789abcdef 2022-02 --json
nxapi pctl monthly-summary 0123456789abcdef 2022-02 --json-pretty-print

Download summary data

# Download all daily and monthly summary data from all devices to the summaries directory in nxapi's data path
# Data that already exists will not be redownloaded
nxapi pctl dump-summaries

# Download all daily and monthly summary data from all devices to data/summaries
nxapi pctl dump-summaries data/summaries

# Download all daily and monthly summary data from a specific device
# Use `nxapi pctl devices` to get the device ID
# The `--device` option can be used multiple times
nxapi pctl dump-summaries --device 0123456789abcdef

Misc. commands/options

Users

# Show all known Nintendo Accounts in a table
# This will only show cached data and does not make any requests to Nintendo servers
nxapi users list

# Use a specific user in a command
nxapi ... --user 0123456789abcdef
nxapi ... --token $NA_SESSION_TOKEN

# Set the default user for commands
nxapi users set 0123456789abcdef

# Remove all data for a user
nxapi users forget 0123456789abcdef

Data location

Data will be stored in an OS-specific local data location by default in the nxapi-nodejs directory.

# Store data in ./data
nxapi --data-path ./data ...
NXAPI_DATA_PATH=`pwd`/data nxapi ...

Debug logs

Logging uses the debug package and can be controlled using the DEBUG environment variable. All nxapi logging uses the api and cli namespaces.

# Show all debug logs from nxapi
DEBUG=api,api:*,cli,cli:* nxapi ...

# Show all API requests
DEBUG=api:* nxapi ...

# Show all debug logs
DEBUG=* nxapi ...

znca API server

A server for controlling the Nintendo Switch Online app on an Android device/emulator using Frida can be used instead of the splatnet2statink and flapg APIs.

This requires:

  • adb is installed on the computer running nxapi
  • The Android device is running adbd as root or a su-like command can be used to escalate to root
  • The frida-server executable is located at /data/local/tmp/frida-server on the Android device
  • The Nintendo Switch Online app is installed on the Android device

The Android device must be constantly reachable using ADB. The server will exit if the device is unreachable.

# Start the server using the ADB server "android.local:5555" listening on all interfaces on a random port
nxapi android-znca-api-server-frida android.local:5555

# Start the server listening on a specific address/port
# The `--listen` option can be used multiple times
nxapi android-znca-api-server-frida android.local:5555 --listen "[::1]:12345"

# Use a command to escalate to root to start frida-server and the Nintendo Switch Online app
# "{cmd}" will be replaced with the path to a temporary script in double quotes
nxapi android-znca-api-server-frida android.local:5555 --exec-command "/system/bin/su -c {cmd}"

# Make API requests using curl
curl --header "Content-Type: application/json" --data '{"type": "nso", "token": "...", "timestamp": "...", "uuid": "..."}' "http://[::1]:12345/api/znca/f"

# Use the znca API server in other commands
# This should be set when running any nso commands as the access token will be refreshed automatically when it expires
ZNCA_API_URL=http://[::1]:12345/api/znca nxapi nso ...

.env file

Some options can be set using environment variables. These can be stored in a .env file in the data location. Environment variables will be read from the .env file in the default location, then the .env file in NXAPI_DATA_PATH location. .env files will not be read from the location set in the --data-path option.

Links

Comments
  • User agent format when connecting to s2s API

    User agent format when connecting to s2s API

    Can you help me figure out why the "version" part of many of the user agents coming from your application here seem to be randomly generated numbers? This isn't what I'd expect to see or how stuff should be set up.

    image

    Thanks!

    bug Nintendo Switch Online 
    opened by frozenpandaman 12
  • windows scroll bar hell

    windows scroll bar hell

    i put this on the discord but i thought it'd be a good idea to put it here to make tracking of this issue easier.

    on windows, game-specific services have alot of scrollbars that look super ugly in use, for example: image

    as mentioned by two people, using css would probably make it look alot better.


    also a slight suggestion, would hiding the "file, edit, etc" bar be a possibility? it seems quite unnecessary to be there if im honest, and removing it shouldnt be too much of a hassle.

    enhancement web service/SplatNet 3 
    opened by oscie57 8
  • Samsung Android device support/application

    Samsung Android device support/application

    Samsung and Discord has a partnership so that Galaxy devices will show the game being currently played via Samsung's Game Launcher app. See this link for more information: https://support.discord.com/hc/en-us/articles/360031924632-Samsung-Integration-FAQ

    Do you think it's possible to take advantage of this feature to implement nxapi for Android? This will be for Samsung devices only, but they're the most popular Android device manufacturer so this will still be very useful to many.

    image

    image

    image

    image

    feature/discord 
    opened by VincentJoshuaET 5
  • Opening on startup

    Opening on startup

    Hello, I have a small suggestion to share Adding a window with general settings could be nice, it could list various options such as launching the application at system startup (in background or not) for example

    enhancement 
    opened by JulesSorensen 5
  • Automatically retry on `9403 Invalid token`

    Automatically retry on `9403 Invalid token`

    image

    I don't know if it's because of the server or the network/ISP I'm using, but the nxapi-app often fails to get the token and creates a dialog each time. This can happen several times an hour, and pressing retry does nothing wrong, but it's annoying. Retrying automatically for retryable errors and popping up the error only if it still can't be recovered would improve the experience. Thanks.

    enhancement Nintendo Switch Online 
    opened by eai04191 4
  • Warning via CLI (Windows, Git Bash)

    Warning via CLI (Windows, Git Bash)

    Figured I'd mention in case others run into this and load your history w/ unidentified-script requests...if not just me (I started the issue before realizing it's only Git Bash). Will have to look into a possible solution later... For now, I'll just use PowerShell or Command Prompt.


    https://github.com/samuelthomas2774/nxapi/blob/fe725f931a5cf3f1f779f78f85c20fe378d2a43c/src/cli.ts#L57-L58


    Git Bash:

    $ nxapi --version
    [warn] The nxapi command is not running in a terminal. If using the nxapi command in a script or other program, the NXAPI_USER_AGENT environment variable should be set. See https://gitlab.fancy.org.uk/samuel/nxapi#user-agent-strings.
    1.2.0
    

    ✔️ PowerShell:

    PS D:\> nxapi --version
    1.2.0
    

    ✔️ Command Prompt:

    D:\>nxapi --version
    1.2.0
    
    bug 
    opened by anthonybaldwin 3
  • Nintendo Switch Online app v2.2.0 (26/07/2022)

    Nintendo Switch Online app v2.2.0 (26/07/2022)

    Release notes (https://www.nintendo.co.uk/-1520024.html):

    • You can now send friend requests via friend code.
      • Users must use a Nintendo Switch console to respond to friend requests.
    • You can now copy your friend code as a URL and/or save it as a QR Code. You can receive friend requests from anyone with whom you share the URL or QR Code.
    • Various issues are now resolved.
    • Changed minimum OS version.
      • iOS version 14.0 or later is required to use this application.
    In-app announcement (iOS):

    Thank you for using the Nintendo Switch Online app.

    You can now update the app to Ver. 2.2.0.

    Please see below for a list of version changes.

    • You can now send friend requests via friend code. Note: Users must use a Nintendo Switch console to respond to friend requests.
    • You can now copy your friend code as a URL and/or save it as a QR Code. You can receive friend requests from anyone with whom you share the URL or QR Code.
    • Various other small changes have also been made.

    We hope you continue to enjoy the Nintendo Switch Online app.

    {
        "announcementId": 111,
        "priority": 0,
        "forceDisplayEndDate": 253402300799,
        "distributionDate": 1658887200,
        "title": "Ver. 2.2.0 update announcement",
        "description": "Thank you for using the Nintendo Switch Online app.\r\n \r\nYou can now update the app to Ver. 2.2.0.\r\n\r\nPlease see below for a list of version changes.\r\n \r\n- You can now send friend requests via friend code.\r\n  Note: Users must use a Nintendo Switch console to respond to friend requests.\r\n- You can now copy your friend code as a URL and/or save it as a QR Code. You can receive friend requests from anyone with whom you share the URL or QR Code.\r\n- Various other small changes have also been made.\r\n \r\n---\r\n \r\nWe hope you continue to enjoy the Nintendo Switch Online app."
    }
    
    In-app announcement (Android):

    Thank you for using the Nintendo Switch Online app.

    You can now update the app to Ver. 2.2.0.

    Please see below for a list of version changes.

    • You can now send friend requests via friend code. Note: Users must use a Nintendo Switch console to respond to friend requests.
    • You can now copy your friend code as a URL and/or save it as a QR Code. You can receive friend requests from anyone with whom you share the URL or QR Code.
    • Various other small changes have also been made.

    We hope you continue to enjoy the Nintendo Switch Online app.

    {
        "announcementId": 112,
        "priority": 0,
        "forceDisplayEndDate": 253402300799,
        "distributionDate": 1658887200,
        "title": "Ver. 2.2.0 update announcement",
        "description": "Thank you for using the Nintendo Switch Online app.\r\n \r\nYou can now update the app to Ver. 2.2.0.\r\n\r\nPlease see below for a list of version changes.\r\n \r\n- You can now send friend requests via friend code.\r\n  Note: Users must use a Nintendo Switch console to respond to friend requests.\r\n- You can now copy your friend code as a URL and/or save it as a QR Code. You can receive friend requests from anyone with whom you share the URL or QR Code.\r\n- Various other small changes have also been made.\r\n \r\n---\r\n \r\nWe hope you continue to enjoy the Nintendo Switch Online app."
    }
    

    Both announcements are exactly the same..

    Users must use a Nintendo Switch console to respond to friend requests.

    This is not strictly true - sending a friend request to a user who has sent you a friend request will add them as a friend immediately, it's just not possible to actually view received friend requests using the app.

    Other changes:

    • user.show_fast, event.list and event.invite API classes have been re-added, but are never used (the API endpoint isn't defined)
    • Added a fullScreen custom attribute for web services
      • When set to "true" the web view will not have a header and close button.
      • This also enables native scroll bounce on iOS! 😄
      • The app will show a loading screen and wait for the webpage to call the custom completeLoading function when it is ready to show. After a few seconds a button will appear to cancel loading the web service if it still hasn't loaded.
      • Will probably be used by SplatNet 3 (#11)...
    • See 2nd comment on new JavaScript APIs available to web services
      • No existing functions appear to have been changed or have new options.

    No breaking/behaviour API changes have been made (see 1st comment on new endpoints for friend requests). f tokens generated with v2.0.0 are still accepted.


    https://github.com/samuelthomas2774/nintendo-app-versions works :). Changes to the Nintendo Switch Online and Nintendo Switch Parental Controls apps on iTunes, Google Play and Nintendo EU/JP will be pushed to this repository automatically. Join Discord to enable notifications for the #nintendo-app-versions channel.

    Nintendo Switch Online 
    opened by samuelthomas2774 3
  • Do you have Nintendo Switch Online API for user games and playtime?

    Do you have Nintendo Switch Online API for user games and playtime?

    I want some apis for user games and playtime,

    The Nintendo Switch Parental Controls App has the apis, but this app require user must Link Device.

    Can you help me?

    opened by BoBoGithub 3
  • Error: [splatnet3] GraphQL error: PersistedQueryNotFound

    Error: [splatnet3] GraphQL error: PersistedQueryNotFound

    Getting this error everytime i load up Splatoon on my switch, and my Discord status no longer shows the enhanced Rich Presence data for Splatoon 3. Just started popping up after working for a while. image

    bug feature/discord web service/SplatNet 3 
    opened by spikeyscout 2
  • Fails to connect to Nintendo Switch API

    Fails to connect to Nintendo Switch API

    Working one day, then I get this log (in the console) the next:

    Last login: Tue Aug 23 11:42:05 on ttys001
    /Users/chancelp/Downloads/Nintendo\ Switch\ Online.app/Contents/MacOS/Nintendo\ Switch\ Online ; exit;
    chancelp@Chances-M1-MacBook-Air ~ % /Users/chancelp/Downloads/Nintendo\ Switch\ Online.app/Contents/MacOS/Nintendo\ Switch\ Online ; exit;
    objc[10408]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x7ffa46e8d980) and /Users/chancelp/Downloads/Nintendo Switch Online.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libGLESv2.dylib (0x110386ce0). One of the two will be used. Which one is undefined.
    Authenticating to Nintendo Switch Online app
    Authenticating to Nintendo Switch Online app
    (node:10406) UnhandledPromiseRejectionWarning: ReferenceError: __filename is not defined
    (Use `Nintendo Switch Online --trace-warnings ...` to show where the warning was created)
    (node:10406) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
    (node:10406) UnhandledPromiseRejectionWarning: ReferenceError: __filename is not defined
    (node:10406) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)
    (node:10406) UnhandledPromiseRejectionWarning: ReferenceError: __filename is not defined
    (node:10406) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 5)
    (node:10406) UnhandledPromiseRejectionWarning: ReferenceError: __filename is not defined
    (node:10406) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 6)
    (node:10406) UnhandledPromiseRejectionWarning: ReferenceError: __filename is not defined
    (node:10406) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 7)
    ^C
    Saving session...
    ...copying shared history...
    ...saving history...truncating history files...
    ...completed.
    
    [Process completed]
    

    This is running on macOS Ventura (M1 MBA, build 22A5321d) and splatnet2statink runs just fine under the same curcumstances. This was running just fine before the update

    bug Nintendo Switch Online feature/znca-api 
    opened by CatsLover2006 2
  • 403 forbidden error SplatNet3Monitor

    403 forbidden error SplatNet3Monitor

    Immediately when chill season started the splatoon 3 rich presence monitor broke entirely and keeps recieving 403 errors. Not sure if it's an app being outdated issue or if nintendo broke it.

    bug web service/SplatNet 3 
    opened by queenbiscuit311 1
  • FetchError ECONNRESET often when running in background

    FetchError ECONNRESET often when running in background

    I often get ECONNRESET fetch errors when running the presence monitor in the background, pictured below:

    image

    I also see this when using S3S, my guess is that this is due to rate limiting or server instability on Nintendo's part. I would say this happens every hour or two.

    These errors are definitely pretty annoying, since they make an error noise popup and make my task bar pop up and flash orange every time they happen. Since they represent transient network issues, I would expect that they are handled and retried silently without interrupting the user.

    opened by nightpool 0
  • Adding user with Japanese PC user name

    Adding user with Japanese PC user name

    It's throw error when adding user if the user name of PC was percent decoded. The error message is like this:

    Error adding account FetchError$1: request to https://accounts.nintendo.com/connect/1.0.0/api/session_token failed, reason: unable to get local issuer certificate at ClientRequest. (file:///C:/Users/username/AppData/Local/Programs/nx...:11) at ClientRequest.emit (node:events:539:35) at TLSSocket.socketErrorListener (node:_http_client:454:9) at TLSSocket.emit (node:events:527:28) at emitErrorNT (node:events:527:28) at emitErrorCloseNT (node:internal/streams/destroy:122:3) at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

    I founded, when I try adding user with the English PC user name (e.g.hilot) I successfully added user, but when I try with the Japanese name (e.g.ひろっとor山田) I couldn't add user. I'm not good at English, so if you didn't catch the meanings or situations I'm very sorry. Thank you

    opened by hilot06 0
  • Presence server event streams

    Presence server event streams

    This can be used by providing the event stream URL. Automatically upgrading to server-sent events is supported and can be enabled by setting NXAPI_PRESENCE_SSE=1; this is not enabled by default due to issues with handling errors emitted by eventsource as it does not provide the original Error object emitted by Node.js APIs that nxapi expects.

    enhancement feature/discord 
    opened by samuelthomas2774 0
  • API client library and storage providers

    API client library and storage providers

    Add complete wrappers for the API clients, similar to the CoralUser class used internally:

    • Automatically handle caching data
    • Automatically handle expiring the API client if not used for the normal duration of the access token
    • Automatically handle recreating the API client if remote configuration data changes when the token is renewed
      • #43
    • Automatically handle sending additional requests to appear like the official app
    • Use a storage provider to automatically handle getting/updating cached tokens

    Storage providers

    Add a storage provider interface implemented by JS library dependents for token management with API client wrappers.

    Make a default storage provider that uses a separate directory for each user and use that with the app/cli. (Users can then be removed just by deleting that directory.)

    Example

    import { addUserAgent, LocalStorageProvider, Storage } from 'nxapi';
    import { CoralUser } from 'nxapi/coral';
    
    addUserAgent('my-project/1.0.0 (+https://github.com/...)');
    
    const storage = await Storage.create(LocalStorageProvider, new URL('../data', import.meta.url));
    const coral = await CoralUser.create(storage, 'naid');
    
    // Get friends list
    // If updated in the last 30s the cached data is returned
    const friends = await coral.getFriends();
    

    https://github.com/samuelthomas2774/splatoon3-replay-lookup is using the client added in https://github.com/samuelthomas2774/nxapi/commit/788083b7f6b714f15ab321e0b0b05a0677ae7238. The API will change.

    enhancement 
    opened by samuelthomas2774 0
  • Presence monitoring error handling

    Presence monitoring error handling

    Show errors updating presence monitors in the main window instead of an error dialog. (Maybe show a banner like for updates, with a button to retry or show the full error message?) Also show a warning icon on any users with erroring monitors.

    The app currently logs and ignores some temporary errors, and clears Discord presence after 10 errors, but continues retrying automatically infinitely. Errors not identified as temporary (not meaning permanent) result in an error dialog.

    The app should notify the user that a non-temporary error occurred, but this should never focus the app and should be easy for the user to just ignore (pausing the monitor until retried):

    • Desktop notifications? That might still be too annoying.
    • macOS/Windows: bounce the dock icon/flash the window icon?
    • Menu app/tray?

    OS considerations:

    • macOS unhides the app and bounces the dock icon but doesn’t focus the app, so errors aren’t too invasive
      • From Big Sur error messages are centred which is annoying
      • macOS blocks the main thread while showing the error dialog
    • Windows focuses the app which means errors are really annoying
    • Some Linux desktop environments don’t scroll error messages

    Also: maybe show a panel for the proxy presence monitor when clicked like for users, instead of just opening the setup window immediately?

    enhancement feature/discord 
    opened by samuelthomas2774 0
Releases(v1.6.0)
  • v1.6.0(Dec 20, 2022)

    Electron app

    • Add open in background option on Windows
      • This also works on Linux. Starting the app with the --app-open-at-login=1 option causes the app to show the open in background option. This must be added to a login script manually.

    Windows users: The open at login option must be disabled before updating to prevent creating duplicate login items.

    Apple Silicon macOS users: A native ARM64 build is now available. Because the app isn't signed and notarised macOS will refuse to open it when downloaded using a web browser. Using the secondary click menu to open the app does not bypass this and the quarantine flag must be removed manually by running xattr -r -d com.apple.quarantine .../Nintendo\ Switch\ Online.app in a terminal.

    Discord Rich Presence

    • Add an option to show presence to the nearest hour
    • Add support for Big Run for Splatoon 3 presence
    • Fix error handling when using a presence URL
    • Fix clearing the activity when reconnecting to Discord
    • Update Discord title configuration

    SplatNet 3

    • GraphQL persisted queries are now upgraded automatically
      • Updated query IDs are fetched using nxapi's remote configuration.
      • The NXAPI_SPLATNET3_UPGRADE_QUERIES environment variable can be used to control when queries are upgraded:
        • If set to 0 persisted query IDs are never upgraded (not recommended).
        • If set to 1 persisted query IDs are upgraded if they do not contain potentially breaking changes (not recommended).
        • If set to 2 persisted query IDs are upgraded, but requests that contain potentially breaking changes are rejected. Removed queries are rejected.
        • If set to 3 (default) persisted query IDs are always upgraded, including requests that contain potentially breaking changes. Removed queries are rejected.
    • Add X Ranking leaderboard queries

    Presence server

    • Add presence API event streams
      • This can be used to continuously receive updated presence data more efficiently than polling the API. The API itself continuously fetches presence data and pushes new data to the client.
      • This can be used in a browser using the EventSource API.
      • nxapi will automatically use the event stream if the environment variable NXAPI_PRESENCE_SSE is set to 1.
      • An update event is emitted with no data when the server checks for new data.
      • A supported_events event is emitted with an array of supported events.
      • An event for each response key (friend, title, splatoon3, splatoon3_fest_team, splatoon3_vs_setting, splatoon3_coop_setting, splatoon3_fest) is emitted when the value is added/updated. No event is emitted if the value is removed.
    • Add Retry-After header to Coral API proxy and presence API errors
      • nxapi v1.5.0 and later uses this header to automatically retry temporary errors.
    • Presence API now tracks and returns the timestamp the user started playing the current title
    • Add SplatNet 3 proxy for use with the presence API server
    • Add environment variables to configure the presence API server
    • Coral API proxy and presence API now returns formatted JSON when accessed in a browser
    • Presence API now returns original high quality image URLs for Splatoon 3 stages
    • Splatoon 3 presence data is no longer returned by the presence API if the user is not playing Splatoon 3
    • Allow updating presence server data every 10 minutes if the requested user was not friends with the presence server user
    • Fix running presence server with the default user

    Other

    • Update Coral to v2.4.0
    • Update SplatNet 3 to v2.0.0-bd36a652
    • Response data in error messages is now limited to 100 characters
      • Full response bodies are still written to stdout.
    • Add automatic renewal of Moon (Nintendo Switch Parental Controls) and NookLink tokens
    • Internal changes to Coral API proxy and presence API
    • The update check is now skipped when running in a Docker container
    • Fix authentication limit is ignored when renewing Coral and SplatNet 3 tokens
    • Ignore SplatNet 3 ConfigureAnalyticsQuery errors (occurs when the user has never played Anarchy Battle and didn't import Splatoon 2 data)

    Build artifacts: https://gitlab.fancy.org.uk/samuel/nxapi/-/jobs/4566/artifacts/browse Full changelog: https://github.com/samuelthomas2774/nxapi/compare/v1.5.0...v1.6.0

    Source code(tar.gz)
    Source code(zip)
    Nintendo.Switch.Online-1.6.0-arm64-mac.zip(80.19 MB)
    Nintendo.Switch.Online-1.6.0-mac.zip(83.08 MB)
    Nintendo.Switch.Online-1.6.0.AppImage(90.44 MB)
    Nintendo.Switch.Online.Setup.1.6.0.exe(66.73 MB)
    nxapi-app_1.6.0_amd64.deb(63.46 MB)
    nxapi-app_1.6.0_amd64.snap(77.05 MB)
  • v1.5.0(Oct 28, 2022)

    Electron app

    • Added a preferences window
      • This includes all additional options for customising Discord activities.
      • For macOS and Windows, login item settings can also be found here.
      Screenshot 2022-10-28 at 15 43 58
    • Add support for SplatNet 3
      • The exit button and unnecessary scroll bars are now hidden.
      • Data can be refreshed using Cmd+R/Ctrl+R.
      • Added new web service JavaScript APIs used by SplatNet 3.
    • Add support for using web service deep links while the web service is open
    • The default browser can now be used to add an account by holding Shift when pressing the add account button
    • Web services in the menu are now fetched from the API instead of being hardcoded in the app
    • Improved error handling when launching web services and renewing web service tokens
    • Hide menus in web service windows on Windows and Linux
    • Fix user selection menu for deep links is closed immediately
    • Disabled Chromium's built-in hostname resolver
      • This was only enabled in macOS due to Electron's default settings and causes system encrypted DNS settings to be ignored.
    • fix: use correct title for Windows notifications by @Rexogamer in https://gitlab.fancy.org.uk/samuel/nxapi/-/merge_requests/1

    CLI

    • Add SplatNet 3 commands
      • Added nxapi splatnet3 user to show the authenticated user.
      • Added nxapi splatnet3 token to get an access token for SplatNet 3. The --json option is available for use with SplatNet3Api.createWithCliTokenData and scripts.
      • Added nxapi splatnet3 schedule --json to get the current schedule data as JSON.
      • Added nxapi splatnet3 battles to show the last 50 battles. (--json option supported.)
      • Added nxapi splatnet3 dump-records to download all history, hero and catalog records and stage and weapon stats.
      • Added nxapi splatnet3 dump-fests to download all Splatfest records.
      • Added nxapi splatnet3 dump-album to download all photo album items.
      • Added nxapi splatnet3 dump-results to download all battle and Salmon Run result data.
      • Added nxapi splatnet3 monitor to continuously download all battle and Salmon Run results and photo album items.
      • Added nxapi splatnet3 friends to show Nintendo Switch Online friends who have played Splatoon 3. (--json option supported.)
      • Added nxapi splatnet3 festivals to show Splatfests in your region. (--json option supported.)
      • Added nxapi splatnet3 festival {id} to show a specific Splatfest. (--json option supported.)
    • Added nxapi nso active-event to get the current Online Lounge/voice chat event
    • Add coop (salmon run) types and results for SplatNet 3 by @telgniw in https://github.com/samuelthomas2774/nxapi/pull/23
    • Fix an issue causing the CLI process to crash when showing desktop notifications
    • Fix importing node-notifier for desktop notifications

    JavaScript/TypeScript library

    • Add SplatNet 3 API client
      • This can be accessed from the nxapi/splatnet3 module.
      • SplatNet3Api instances can be created in the same way as SplatNet2Api.
      • API types are published separately in the splatnet3-types package.
    • All API functions now return the Response object
      • This can be accessed by importing the ResponseSymbol symbol from the nxapi module.
    • The Coral API functions now return the result object directly
      • The raw response object can be retrieved using the ResponseDataSymbol symbol from the nxapi/coral module.
      • The correlationId value can be retrieved using the CorrelationIdSymbol symbol from the nxapi/coral module.
      • This is compatible with existing code expecting the status, result and correlationId to exist on the returned object, however new code should expect to access the result object directly.
      • The symbol and deprecated raw response keys will not exist when serialised to JSON.

    Discord Rich Presence

    • Add detailed Rich Presence information using SplatNet 3 while playing Splatoon 3
      • This must be enabled in preferences or using the --splatnet3-monitor flag. When enabled the current game mode, rule and stages will appear in Discord. This only applies to online modes; hero mode and other offline modes will not show additional information in Discord.
      • This requires using a secondary account with your main account added as a friend to retrieve your presence data.
      • The secondary account must be able access to SplatNet 3. This means it must have an active Nintendo Switch Online membership and have Splatoon 3 data. Note that it is only necessary to get to the point where you have set a Splatfest region to be able to access SplatNet 3; completing the tutorial or playing an online battle is not necessary. This can be checked by attempting to open SplatNet 3 in the app or by running nxapi splatnet3 user.
        Screenshot showing Splatoon 3 as a Discord activity with SplatNet 3 presence information
    • Presence data is now saved so restarting the app while playing does not reset the start time
    • Temporary errors reported by an external presence URL will now be ignored and the request will be retried after a delay suggested by the server
    • Update Discord title configuration
    • Slight rich presence demo list improvements by @Adrthegamedev in https://github.com/samuelthomas2774/nxapi/pull/20

    Other

    • Add support for the updated flapg API
      • The flapg API no longer requires client authentication, so will still be supported without the splatnet2statink API.
      • This can be used by setting the NXAPI_ZNCA_API environment variable to flapg.
    • nxapi's f-generation server is now a separate repository
      • https://github.com/samuelthomas2774/nxapi-znca-api.
    • Fix getting web service tokens when the Coral token has expired

    Build artifacts: https://gitlab.fancy.org.uk/samuel/nxapi/-/jobs/4275/artifacts/browse Full changelog: https://github.com/samuelthomas2774/nxapi/compare/v1.4.0...v1.5.0

    Source code(tar.gz)
    Source code(zip)
    Nintendo.Switch.Online-1.5.0-mac.zip(83.05 MB)
    Nintendo.Switch.Online-1.5.0.AppImage(90.41 MB)
    Nintendo.Switch.Online.Setup.1.5.0.exe(66.70 MB)
    nxapi-app_1.5.0_amd64.deb(63.42 MB)
    nxapi-app_1.5.0_amd64.snap(77.03 MB)
  • v1.4.0(Aug 24, 2022)

    • Add friend code lookup and friend requests to the Electron app Screenshot 2022-08-13 at 00 26 25 3
    • Fixed authenticating to the Nintendo Switch Online app API (https://github.com/samuelthomas2774/nxapi/issues/17)
      • Nintendo updated the API on 23/08/2022 to properly validate the timestamp parameter sent in authentication requests. This change affects all software that authenticates to Nintendo's API automatically and requires an update to all clients and f parameter generation APIs. More information.
      • Due to this change the flapg API is no longer supported immediately. It can still be used, however until it is updated authentication may not work reliably.
    • Changed the default API for Coral client authentication to the imink API
      • ~~This also applies to v1.3.0, unless remote configuration is disabled.~~
      • The splatnet2statink and flapg APIs can still be used by setting the NXAPI_ZNCA_API environment variable to flapg, however the splatnet2statink API is deprecated and scheduled to be shut down by the end of 2022.
    • Update Discord title configuration
    • Friends last online timestamp now appears as a relative timestamp ("1 hour ago") and also appear in the friends list
    • Update NookLink version
      • Nintendo doesn't check this anyway, but this is now also fetched from my server so can be updated remotely.
    • [Breaking change] When creating a NooklinkApi or NooklinkUserApi object, a helper function should be used instead of calling the constructor directly
      • This matches the changes in v1.3.0 for CoralApi, MoonApi and SplatNet2Api, and is to prevent future updates breaking anything.
      • Added NooklinkApi.createWithSavedToken(data: NooklinkAuthData), which takes the data object returned by NooklinkApi.createWithCoral, NooklinkApi.loginWithCoral and NooklinkApi.loginWithWebServiceToken.
      • Added NooklinkUserApi.createWithSavedToken(data: NooklinkUserAuthData), which takes the data object returned by NooklinkApi.createUserClient.
      • Added NooklinkUserApi.createWithCliTokenData(data: NooklinkUserCliTokenData), which takes the JSON-encoded data output from nxapi nooklink user-token --json.
    • Added compatibility with imink's API request format to the znca API server
      • The timestamp parameter is no longer required and when not provided it will be generated and returned in the response. This parameter generally should not be provided to prevent causing issues when the value does not match the value that would be generated on the Android device/emulator. (https://github.com/samuelthomas2774/nxapi/issues/17)
      • Additionally the request_id/uuid parameter is also no longer required and will be generated and returned in the response if not provided. This value is safe to generate on the client, but providing this in the response makes it easier to use the API in Paw and other HTTP clients.
    • Remove the unidentified-script user agent string when running the API proxy server
    • Prevent detecting running the nxapi command in an automated script when redirecting output
    • Prevent making requests to match Nintendo's app's behaviour when not necessary
    • Fix an issue where an error is thrown when handling errors in the packaged Electron app
    • Fix an issue where multiple f parameter generation requests received by the znca API server at the same time result in invalid tokens being returned
    • Disable client hints for web services
      • This is not available in Nintendo's app and exposes the true client platform.
    • Fix an issue where standard OAuth 2.0/OpenID Connect errors from Nintendo are not handled properly
    • Fix an issue where updating Nintendo Switch Online app data never completes
    • Fix friend context menus not updating
    • Fix some issues with X Rank season calculation

    Build artifacts: https://gitlab.com/samuelthomas2774/nxapi/-/jobs/2930115184/artifacts/browse Full changelog: https://github.com/samuelthomas2774/nxapi/compare/v1.3.0...v1.4.0

    Source code(tar.gz)
    Source code(zip)
    Nintendo.Switch.Online-1.4.0-mac.zip(82.07 MB)
    Nintendo.Switch.Online-1.4.0.AppImage(88.48 MB)
    Nintendo.Switch.Online.Setup.1.4.0.exe(65.38 MB)
    nxapi-app_1.4.0_amd64.snap(75.38 MB)
  • v1.3.0(Aug 2, 2022)

    • Update Coral (Nintendo Switch Online) version to 2.2.0 (#14)
      • Added new web service JavaScript APIs in the Electron app.
    • Add commands for using friend codes and sending friend requests
      • nxapi nso friendcode to get your friend code URL
        • The URL includes a friendCodeHash parameter, which is required for Nintendo's app to open the link. It is not known how this is generated.
      • nxapi nso lookup 0000-0000-0000 to look up a friend code and get the user's name and image URL
      • nxapi nso add-friend 0000-0000-0000 to send a friend request using a friend code
    • Add API proxy routes for using friend codes
      • /api/znc/friendcode to get your friend code URL
      • /api/znc/friendcode/0000-0000-0000 to look up a friend code and get the user's name and image URL
    • The Nintendo eShop button added to Discord activites now links to a webpage for selecting a Nintendo eShop region
      • This allows selecting the correct Nintendo website region, instead of always using the region of the user sharing their presence.
      • For Splatoon 2, which has different versions for different regions, this webpage replaces the title ID with the correct title ID of the selected region.
      • Example (Splatoon 2, EU): https://fancy.org.uk/api/nxapi/title/0100f8f0000a2000/redirect
    • Improve reliability when using Discord Rich Presence
      • nxapi will now connect to Discord in the background, without blocking the update loop.
      • nxapi will continue to attempt to connect to Discord infinitely instead of throwing an error if it cannot connect after 10 attempts.
    • Update Discord title configuration
    • [Breaking change] When creating a CoralApi, MoonApi or SplatNet2Api object, a helper function should be used instead of calling the constructor directly
      • This is to prevent future updates breaking anything.
      • Added CoralApi.createWithSavedToken(data: CoralAuthData), which takes the data object returned by CoralApi.createWithSessionToken and CoralApi.loginWithSessionToken.
      • Added MoonApi.createWithSavedToken(data: MoonAuthData), which takes the data object returned by MoonApi.createWithSessionToken and MoonApi.loginWithSessionToken.
      • Added SplatNet2Api.createWithSavedToken(data: SplatNet2AuthData), which takes the data object returned by SplatNet2Api.createWithCoral, SplatNet2Api.loginWithCoral and SplatNet2Api.loginWithWebServiceToken.
      • Added SplatNet2Api.createWithCliTokenData(data: SplatNet2CliTokenDate), which takes the JSON-encoded data output from nxapi splatnet2 token --json.
      • Added SplatNet2Api.createWithIksmSession(iksm_session: string, unique_id: string).
    • Add an environment variable to set the user agent string when running the nxapi command in a script or other program
    • The API library and types are now exported in separate modules using the package.json exports field
    • Coral and Moon (Nintendo Switch Parental Controls) versions are now fetched from a configuration file on my server
      • This means future updates from Nintendo will not require an update.
      • This is done in a safe way, so that if Nintendo make changes to the behaviour of their apps, older versions of nxapi will refuse to connect to Nintendo APIs.
      • The configuration data can be seen using the nxapi util remote-config command.
      • This can be disabled using an environment variable: NXAPI_ENABLE_REMOTE_CONFIG=0. Remote configuration should not be disabled if nxapi has ever been run while it's enabled, as this can result in reporting older versions to Nintendo than have been used before, which is possible using Nintendo's apps (by updating the app, then restoring a full device backup created with an older version of the app installed), but should be extremely rare.
      • This can be overridden in development builds by creating a remote-config.json file in the data directory with the JSON-encoded configuration data.
    • The nxapi command will now refuse to attempt to authenticate to Nintendo services repeatedly within a short period
      • For the parental controls API, the limit is 4 attempts/15 minutes. For all other APIs, the limit is 4 attempts/60 minutes.
      • This is to prevent spamming Nintendo services with invalid requests if a program using the nxapi command does not handle errors properly.
      • This does not apply when running the nxapi command manually in a terminal, or when using the Electron app.
    • All HTTP error messages now include the response data in the stack trace

    Build artifacts: https://gitlab.com/samuelthomas2774/nxapi/-/jobs/2803844835/artifacts/browse Full changelog: https://github.com/samuelthomas2774/nxapi/compare/v1.2.0...v1.3.0

    Source code(tar.gz)
    Source code(zip)
    Nintendo.Switch.Online-1.3.0-mac.zip(77.15 MB)
    Nintendo.Switch.Online-1.3.0.AppImage(82.61 MB)
    Nintendo.Switch.Online.Setup.1.3.0.exe(61.48 MB)
    nxapi-app_1.3.0_amd64.snap(70.74 MB)
  • v1.2.0(Jul 2, 2022)

    • Rename ZncApi to CoralApi
      • ZncApi and znc will be removed later. Use CoralApi and coral instead.
    • Add commands to get the SplatNet 2 iksm_session cookie and NookLink user token
      • These commands are suitable for use in scripts. For example, curl --header "Cookie: iksm_session=`nxapi splatnet2 token`" https://app.splatoon2.nintendo.net/api/records works (but doesn't attempt to appear as a normal SplatNet 2 API request).
      • nxapi splatnet2 token will print the iksm_session cookie to stdout.
      • nxapi splatnet2 token --json will print the iksm_session cookie, region and unique player ID embedded in the SplatNet 2 HTML template to stdout.
      • nxapi nooklink user-token will print the authentication token for the selected NookLink user to stdout.
      • nxapi nooklink user-token --json will print the authentication token for the selected NookLink user and the NookLink user ID to stdout.
    • Add a command and helper functions for Splatoon 2 X Rank seasons
      • X Rank seasons are calculated locally (by the SplatNet 2 web app and nxapi). The SplatNet 2 API doesn't actually provide this information.
      • nxapi splatnet2 x-rank-seasons [--json] prints all X Rank seasons.
      • getSplatNet2XRankSeasons, getSplatNet2XRankSeason, getSplatNet2NextXRankSeason, getSplatNet2PreviousXRankSeason are exported for use in JavaScript/TypeScript code.
    • Add a function to set a User-Agent for s2s/flapg/imink/nxapi API requests
      • addUserAgent should be called when using nxapi as a dependency, e.g. addUserAgent('your-app-name/1.0.0').
    • Update Discord title configuration
      • Added custom application for Pokémon UNITE (#6)
    • Added an icon for the system tray menu
    • Remove unused dependencies from the app build
      • This makes the app quite a bit smaller.
    • Improved error handling in the app
    • Fix update message is not cleared after updating

    Build artifacts: https://gitlab.fancy.org.uk/samuel/nxapi/-/jobs/3707/artifacts/browse Full changelog: https://github.com/samuelthomas2774/nxapi/compare/v1.1.0...v1.2.0

    Source code(tar.gz)
    Source code(zip)
    Nintendo.Switch.Online-1.2.0-mac.zip(77.56 MB)
    Nintendo.Switch.Online-1.2.0.AppImage(82.93 MB)
    Nintendo.Switch.Online.Setup.1.2.0.exe(62.12 MB)
    nxapi-app_1.2.0_amd64.snap(71.03 MB)
  • v1.1.0(Jun 19, 2022)

    • Added guided Discord Rich Presence setup for authenticated users
      • When Discord Rich Presence is not enabled and a user that can access the selected user's presence has been added, a setup button will appear in the main window.
      • When pressed, the Discord Rich Presence window is opened with only authenticated friends listed.
    • The app now always stays open in the background
      • Previously the app would only stay open in the background on macOS
    • Update Discord title configuration
      • Added custom application for Monster Hunter Rise (#5)
    • The app now starts immediately, without waiting for presence monitors to start
    • Added a link to show friend's game in Nintendo eShop
    • Add support for game-specific service deeplinks
      • This is used by Happy Home Network in NookLink (which I don't have, so this hasn't been tested properly).
      • The Nintendo Switch Online app only allows launching game-specific services with the deepLinkingEnabled attribute set (only NookLink currently). nxapi allows launching any game-specific service, e.g. SplatNet 2: com.nintendo.znca://znca/game/5741031244955648.
      • NookLink uses https://dpl.sd.lp1.acbaa.srv.nintendo.net (acbaa = ACNH, dpl = deeplink?) to open these links. dpl.lp1.av5ja.srv.nintendo.net (av5ja = Splatoon 3) exists (but doesn't resolve)... so maybe SplatNet 3 uses deeplinks as well?
    • Add X-AppColorScheme header when loading game-specific services (#3)
    • Fix light button appearance on macOS

    Build artifacts: https://gitlab.fancy.org.uk/samuel/nxapi/-/jobs/3624/artifacts/browse Full changelog: https://github.com/samuelthomas2774/nxapi/compare/v1.0.0...v1.1.0

    Source code(tar.gz)
    Source code(zip)
    Nintendo.Switch.Online-1.1.0-mac.zip(101.18 MB)
    Nintendo.Switch.Online-1.1.0.AppImage(107.11 MB)
    Nintendo.Switch.Online.Setup.1.1.0.exe(82.93 MB)
    nxapi-app_1.1.0_amd64.snap(91.49 MB)
  • v1.0.0(Jun 12, 2022)

    Initial release of the full Electron app.

    macOS:

    https://github.com/samuelthomas2774/nxapi/blob/v1.0.0/resources/app.png

    Windows:

    Screenshot 2022-06-12 203300

    • Add support for sharing images/links from game-specific services
    • Fix issues with API requests

    Build artifacts: https://gitlab.fancy.org.uk/samuel/nxapi/-/jobs/3589/artifacts/browse Full changelog: https://github.com/samuelthomas2774/nxapi/compare/v0.3.0...v1.0.0

    Source code(tar.gz)
    Source code(zip)
    Nintendo.Switch.Online-1.0.0-mac.zip(101.18 MB)
    Nintendo.Switch.Online-1.0.0.AppImage(107.11 MB)
    Nintendo.Switch.Online.Setup.1.0.0.exe(82.93 MB)
    nxapi_1.0.0_amd64.snap(91.49 MB)
  • v0.3.0(May 26, 2022)

    • Updated znca version to 2.1.1
    • Add an option to use the imink API to generate f parameters
    • Add an option to use a specific Discord client by user ID
    • Enable start timestamp for all titles by default when sharing presence to Discord
      • The updated timestamp from Nintendo is used so this is now accurate
      • This makes the activity appear in the Active Now panel in Discord
    • Internal changes related to the Electron app

    Build artifacts: https://gitlab.fancy.org.uk/samuel/nxapi/-/jobs/3548/artifacts/browse Full changelog: https://github.com/samuelthomas2774/nxapi/compare/v0.2.1...v0.3.0

    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(May 7, 2022)

    • Fix not work in Windows by @YDKK in https://github.com/samuelthomas2774/nxapi/pull/2
    • Fix running from a path with spaces/other URL-encoded special characters

    Build artifacts: https://gitlab.fancy.org.uk/samuel/nxapi/-/jobs/3454/artifacts/browse Full changelog: https://github.com/samuelthomas2774/nxapi/compare/v0.2.0...v0.2.1

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(May 1, 2022)

    Build artifacts: https://gitlab.fancy.org.uk/samuel/nxapi/-/jobs/3405/artifacts/browse Full changelog: https://github.com/samuelthomas2774/nxapi/compare/v0.1.0...v0.2.0

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Mar 27, 2022)

Owner
Samuel Elliott
GitLab: https://repo.ml/samuel
Samuel Elliott
Exposes theming options available in Joy UI by providing color palette and typography controls.

Joy Theme Creator Note: Joy UI is currently in alpha - some things may not be finished or working as expected. This project exposes the theming option

Oliver Benns 10 Dec 28, 2022
Immersive (VR) controls for Three.js

Three.js Immersive Controls Immersive (VR) functionality Movement and rotation with VR controllers (move with left thumbstick, rotate with right thumb

Anthony DePasquale 20 Nov 12, 2022
A jQuery plugin to make your form controls look how you want them to. Now with HTML-5 attributes!

(jQuery) Uniform A jQuery plugin to make your form controls look how you want them to. Now with HTML-5 attributes! Works well with jQuery 1.6+, but we

Audith Softworks 2.2k Jan 2, 2023
Flappy Bird is an arcade-style game in which the player controls the bird Faby, which moves persistently to the right

Flappy Bird is an arcade-style game in which the player controls the bird Faby, which moves persistently to the right. The player is tasked with navigating Faby through pairs of pipes that have equally sized gaps placed at random heights. Faby automatically descends and only ascends when the player taps the touchscreen.

Ali Yaghoubi 5 Aug 16, 2022
INeedHelp is a Game Boy, Game Boy Advance, and Nintendo DS emulator written in JavaScript and TypeScript.

INeedHelp INeedHelp is a Game Boy Advance and Nintendo DS emulator written in JavaScript/TypeScript. FAQ Why is it called INeedHelp? You would need he

Powerlated 6 Jun 29, 2022
a cobbled together alternative UI to launchdarkly, allowing read/write access via LD API access token

discount-launchdarkly a cobbled together alternative UI to launchdarkly, allowing read/write access via LD API access token setup make sure you have a

null 9 Oct 19, 2022
La extensión web que muestra el precio de los juegos de la web de Xbox, PlayStation, Nintendo y Epic Games Store con los impuestos de Argentina incluidos. Conocé cuanto vas a pagar por tus juegos 💚💙❤️

Conocido anteriormente como Xboxito Impuestito - Conocé el precio real de los juegos Impuestito calcula y muestra el precio de los juegos de la web de

Luke ✨ 23 Dec 4, 2022
Piccloud is a full-stack (Angular & Spring Boot) online image clipboard that lets you share images over the internet by generating a unique URL. Others can access the image via this URL.

Piccloud Piccloud is a full-stack application built with Angular & Spring Boot. It is an online image clipboard that lets you share images over the in

Olayinka Atobiloye 3 Dec 15, 2022
A chat logs online saver for discord bots to save messages history & cleared messages online

Chat Logs NPM package that saves messages online to view it later Useful for bots where users can save messages history & cleared messages online Supp

TARIQ 8 Dec 28, 2022
KWin Script to switch to the next or previous non empty virtual desktop

kwin-cycle-non-empty-desktops KWin Script to switch to the next or previous non empty virtual desktop. Installation Method 1: From the KDE Store Go to

Shaan Subbaiah 1 Dec 5, 2022
❤️ A heart-shaped toggle switch component for React.

heart-switch A heart-shaped toggle switch component for React. Inspired by Tore Bernhoft's I heart toggle Dribbble shot. ?? Table of Contents ?? Getti

Anatoliy Gatt 413 Dec 15, 2022
Automatically switch Terminal profile based on dark / light mode

auto-terminal-profile Automatically switch the macOS Terminal profile based on the system-wide dark / light appearance mode Prerequisites Node.js 14-1

Patrik Csak 17 Jan 2, 2023
Switch case syntax for Svelte ✨

Svelte switch case Switch case syntax for your Svelte components. Demo · StackBlitz · NPM Package ⚡ Getting started Step 1: Add the preprocessor to yo

Lucas Portet 91 Dec 30, 2022
Pure CSS toggle switch

Pure CSS toggle switch demo install npm i toggle-switch-css or yarn add toggle-switch-css use <label class="toggle-switch my-toggle-switch"> <in

magic-akari 6 Sep 14, 2021
switch Alternate Style Sheets

alternate-stylesheets.js switch Alternate Style Sheets Installation npm $ npm install alternate-stylesheets yarn $ yarn add alternate-stylesheets Usag

sasaplus1 1 Dec 11, 2021
Storybook Addon Root Attributes to switch html, body or some element attributes (multiple) at runtime for you story

Storybook Addon Root Attributes What is this This project was inspired by le0pard/storybook-addon-root-attribute The existing library received only on

정현수 5 Sep 6, 2022
A pure CSS toggle switch for form input checkboxes

Toggle Switchy A pure CSS toggle switch for form input checkboxes Preview Installation CSS <link rel="stylesheet" href="toggle-switchy.css"> HTML <lab

Adam Culpepper 34 Dec 8, 2022
Some ideas for grid to slideshow switch animations using GSAP's Flip plugin.

Grid to Slideshow Switch Animations Some ideas for grid to slideshow switch animations using GSAP's Flip plugin. Article on Codrops Demo Installation

Codrops 31 Jun 22, 2023