Show what you're playing on your Nintendo Switch system as Discord Rich Presence.
It polls an nxapi presence server for your Switch's status and shows it to Discord.
- A Nintendo account linked to a presence server - see SETUP.md, which shows you how to set this up
- Discord installed and running on the PC
- Python 3.13+, unless you're using a build
Download the relevant package for your system from releases.
Unix systems:
git clone https://github.com/zydezu/nxapi-CLI
cd nxapi-cli
uv pip install -r requirements.txt # use a venv of your choice
uv run start.pyWindows systems:
git clone https://github.com/zydezu/nxapi-CLI
cd nxapi-cli
pip install -r requirements.txt
python start.pyRunning as a Windows service
Use NSSM: nssm install nxapicli.
The .exe must stay put, e.g. C:\nxapi-cli\nxapi-cli.exe.
Running as a systemd service
mkdir -p ~/.config/systemd/user ~/.config/environment.d/
bash -c 'echo "PATH=${HOME}/.local/bin:" > ~/.config/environment.d/90-path.conf'
bash -c 'echo "
[Unit]
Description=Enables nxapi-cli
Wants=network-online.target
After=network-online.target
[Service]
ExecStart=/usr/bin/python3 $HOME/nxapi-cli/start.py
Restart=on-failure
StandardOutput=journal
StandardError=journal
WorkingDirectory=$HOME/nxapi-cli
[Install]
WantedBy=default.target
" > ~/.config/systemd/user/nxapi-cli.service'
systemctl --user daemon-reload
systemctl --user enable --now nxapi-cliCheck on it with systemctl --user status nxapi-cli, or follow the log with
journalctl --user -xeu nxapi-cli.
Tip
Read SETUP.md, on how to link your Nintendo Switch user to the presence server. Do this before running this script!
You'll be guided through a setup, where you're asked for your presence URL and are then able to configure all the options.
Settings are saved to ~/.config/nxapi-cli/nxapicliconfig.json (%APPDATA%\nxapi-cli\ on Windows).
The prompt takes either a bare NSA ID, or the whole
https://nxapi-presence.fancy.org.uk/api/presence/<nsaid> URL from your browser, so you can
paste this in.
To change things afterwards, edit the JSON, or delete it and let the config setup run again.
Portable mode
Drop an empty file named portable.txt next to the script and the config is read from and
saved to that folder instead of the OS config directory - useful for running off a USB drive.
Note
profile_url needs the /profile/<token> address from nxapi-auth's Your User > Settings > Public
profile. The @username page looks similar but has no JSON API, so the lounge link can't
be resolved from it. This only matters if one_button is off.
Warning
The "Add Friend" button is only shown while public profile is enabled, if it's off the "Add friend" and "View profile" button wont show.
Important
Discord doesn't show buttons on your own account showing the presence, only other users can see the buttons.
Using your own images
Create an application at the Discord Developer Portal,
put its ID in client_id, then upload images under Rich Presence > Art Assets named after
the lowercase title ID (e.g. 0400c3f00006e000). The Home Menu falls back to home_menu.
To test the Discord side without a console awake: python tests/test_presence.py --simulate
- nxapi by samuelthomas2774 - the presence server and the endpoint this reads
- nxapi-auth by Ellie - account linking, presence API access, public profiles and friend-code links. See SETUP.md
- pypresence - Discord RPC