Minimal Python CLI for ranking Mullvad VPN relays by ICMP latency. It fetches the live relay list from Mullvad, filters the servers you care about, pings them concurrently, and prints the fastest results first.
- Uses Mullvad's live relay API.
- No third-party Python dependencies.
- Concurrent pinging for quick results.
- Local 24-hour API cache to avoid repeated relay-list downloads.
- Filters by country, active status, ownership, relay type, SOCKS support, and port speed.
- Warns when your default route appears to be a VPN tunnel, because that can make latency results misleading.
- Python 3.8+
- System
pingcommand
With Homebrew:
brew tap faeton/tap
brew install mullvad-server-pingRun directly from the repository:
python ping_mullvad.pyOr install it as a local CLI:
python -m pip install .
mullvad-server-pingNo Python packages are installed beyond this project itself.
mullvad-server-ping [-h] [-cc COUNTRY_CODE] [-cn COUNTRY_NAME]
[-a | --active | --no-active]
[-o | --owned | --no-owned]
[--socks] [-sp NETWORK_PORT_SPEED]
[-t THREADS] [-p | --progress | --no-progress]
[-v] [-l LIMIT] [--type SERVER_TYPE]-cc, --country-code: Filter by country code, such asus,se, orde.-cn, --country-name: Filter by exact country name, such asSweden.-a, --active/--no-active: Include only active or inactive relays.-o, --owned/--no-owned: Include only Mullvad-owned or rented relays.--socks: Include only relays with SOCKS metadata, and print SOCKS endpoint details.-sp, --network-port-speed: Filter by network port speed in Gbit/s, such as1or10.--type: Filter by relay type, such aswireguard,openvpn, orbridge.-t, --threads: Concurrent ping count. Default:100.-p, --progress/--no-progress: Show or hide progress. Default: enabled.-v, --verbose: Print extra progress details to stderr.-l, --limit: Number of fastest results to print. Default:10; use-1for all.
Rank the fastest reachable relays:
mullvad-server-pingShow the five fastest active WireGuard relays in Sweden:
mullvad-server-ping --country-code se --type wireguard --active -l 5Find fast 10 Gbit/s relays in Canada without the progress counter:
mullvad-server-ping --country-name Canada --network-port-speed 10 --no-progress -l 5Show relays with SOCKS metadata:
mullvad-server-ping --socks --active -l 10Example output:
se-sto-wg-301 185.213.154.66 18.42 ms
se-sto-wg-302 185.213.154.67 18.77 ms
se-got-wg-001 193.138.218.130 22.14 ms
de-fra-wg-401 146.70.117.2 29.80 ms
nl-ams-wg-201 169.150.196.2 33.01 ms
The relay list is cached in api_cache.json for 24 hours. The file is generated locally and ignored by Git.
Relay metadata comes from Mullvad's public endpoint:
https://api.mullvad.net/www/relays/all/
MIT