Skip to content
zydezuPublic

About

A simple python-based RPC that reads data from https://nxapi-auth.fancy.org.uk/ and shows it on your Discord profile, uses on https://gitlab.fancy.org.uk/samuel/nxapi.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

25 Commits

Folders and files

Repository files navigation

nxapi-cli

Show what you're playing on your Nintendo Switch system as Discord Rich Presence.

ko-fi pypresence

It polls an nxapi presence server for your Switch's status and shows it to Discord.

2026-10-07_17-21-48_discord_enzeta_-_discord 2026-10-07_18-13-30_nxapi-app_nxapi_-_zy_reply_2_me

Requirements

  • 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

Usage

Download the relevant package for your system from releases.

Cloning

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.py

Windows systems:

git clone https://github.com/zydezu/nxapi-CLI
cd nxapi-cli
pip install -r requirements.txt
python start.py
Running 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-cli

Check on it with systemctl --user status nxapi-cli, or follow the log with journalctl --user -xeu nxapi-cli.

First run

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

Credits

  • 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

About

A simple python-based RPC that reads data from https://nxapi-auth.fancy.org.uk/ and shows it on your Discord profile, uses on https://gitlab.fancy.org.uk/samuel/nxapi.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages