Plex
The Plex integration works the same way as the Jellyfin integration — a collector script reads from your Plex server’s API and syncs play history, library stats, and user activity to numbrs.
Estimated setup time: 10 minutes
What it tracks
Section titled “What it tracks”- Play history — titles played, users, timestamps, and duration
- Library stats — item counts per library section
- Active streams — who’s watching what right now
Prerequisites
Section titled “Prerequisites”- Plex Media Server (any version)
- A Plex token (see below)
- Python 3
- Your numbrs credentials — see Integrations Overview for where to find them
Get your Plex token
Section titled “Get your Plex token”From Plex Web:
- Open Plex in your browser
- Play any media item, then click the three-dot menu → Get Info
- At the bottom of the info panel, click View XML
- In the URL that opens in a new tab, find
X-Plex-Token=...— that’s your token
From the Preferences file (macOS):
grep -o 'PlexOnlineToken="[^"]*"' \ ~/Library/Application\ Support/Plex\ Media\ Server/Preferences.xmlFrom the Preferences file (Linux):
grep -o 'PlexOnlineToken="[^"]*"' \ /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Preferences.xmlRun the collector
Section titled “Run the collector”Download the script from the Integrations page in the numbrs app, or find it in the repo at collectors/plex.sh.
Run manually first:
NUMBRS_SUPABASE_URL="https://YOUR_PROJECT.supabase.co" \NUMBRS_SUPABASE_SERVICE_KEY="your-service-role-key" \NUMBRS_OWNER_ID="your-user-id" \PLEX_URL="http://192.168.1.x:32400" \PLEX_TOKEN="your-plex-token" \bash ~/numbrs-plex-collector.shSet up cron
Section titled “Set up cron”*/15 * * * * NUMBRS_SUPABASE_URL=https://YOUR_PROJECT.supabase.co NUMBRS_SUPABASE_SERVICE_KEY=your-key NUMBRS_OWNER_ID=your-id PLEX_URL=http://192.168.1.x:32400 PLEX_TOKEN=your-plex-token bash /Users/YOUR_USERNAME/numbrs-plex-collector.sh >> /tmp/numbrs-plex.log 2>&1Troubleshooting
Section titled “Troubleshooting”“Unauthorized” error
The Plex token is wrong or expired. Try fetching a fresh one using the methods above.
“Connection refused”
Check that PLEX_URL is correct and that Plex is running. The default port is 32400. Test with: curl http://192.168.1.x:32400/identity
No play history showing
Plex only keeps play history if you have an active Plex Pass. Without it, the history endpoint may return empty. Library stats and active streams still work.
Next steps
Section titled “Next steps”- Dashboard Builder — build a media stats dashboard
- Jellyfin — similar integration for Jellyfin
- Integrations Overview — how all collector-based integrations work