This thread will share the same essence as VPNMON-R3 Custom OVPN Server List Generation Tutorials and Examples; however, this is for generating WireGuard server lists.
I currently only have Nord and Proton as VPN providers, so I'll focus on those for now.
Current VPN Providers Supported that utilize API functionality and include WireGuard details:
As shown below, the "WG/VPN Client Slot Server List Automation" menu allows you to View/Edit and Execute these statements, which will then pull the required VPN Server IPs from these various VPN Providers, and copy them into local server lists that VPNMON-R3 uses to reconnect your connections to.
NordVPN
Step 1) Nord uses a single private key for all VPN servers. You will need to visit Nord and generate an access token before you can locate your private key.
Step 2) Obtain your private key
Use this private key in the following curl examples.
Step 3) Generate your server list query using the Private Key you generated above. Examples:
I currently only have Nord and Proton as VPN providers, so I'll focus on those for now.
Current VPN Providers Supported that utilize API functionality and include WireGuard details:
- NordVPN
As shown below, the "WG/VPN Client Slot Server List Automation" menu allows you to View/Edit and Execute these statements, which will then pull the required VPN Server IPs from these various VPN Providers, and copy them into local server lists that VPNMON-R3 uses to reconnect your connections to.
NordVPN
Step 1) Nord uses a single private key for all VPN servers. You will need to visit Nord and generate an access token before you can locate your private key.
- Go to this NordVPN link.
- Click the "Set up NordVPN manually" button.
- After completing the email verification, you will be directed to a page that allows you to generate an access token. Click the "Generate new token" button.
- Leave the token expiration as is (private keys don't seem to change, so it is fine if it expires in 30 days). Click the "Generate token" button.
- Copy the access token for use in the next step and close the pop-up dialog.
Step 2) Obtain your private key
Bash:
curl -s -u token:"{ACCESS_TOKEN_FROM_PREVIOUS_STEP}" "https://api.nordvpn.com/v1/users/services/credentials" | jq -r .nordlynx_private_key
Step 3) Generate your server list query using the Private Key you generated above. Examples:
- Top 5 Recommended WireGuard NordVPN Servers: This example shows you how to export all recommended NordVPN Server IPs based on a NordVPN algorithm per your location, and should be the fastest with the lowest load. Copy and paste the curl statements into an SSH window on your router to test their output.
First, determine the ID for your chosen country. (Exact number is of great importance!). The ID is in [ ] directly next to your country name.
Bash:curl --silent "https://api.nordvpn.com/v1/servers/countries" | jq --raw-output '.[] | . as $parent | .cities[] | [$parent.name, $parent.id, .name, .id] | "\(.[0]) [\(.[1])] - \(.[2]) [\(.[3])]"'
Bash:curl --silent --retry 3 --connect-timeout 3 --max-time 6 --retry-delay 1 --retry-all-errors "https://api.nordvpn.com/v1/servers/recommendations?filters\[country_id\]=228&filters\[servers_groups\]\[identifier\]=legacy_standard&filters\[servers_technologies\]\[identifier\]=wireguard_udp&limit=5" | jq --raw-output '.[] | . as $parent | .technologies | .[] | select(.identifier == "wireguard_udp") | [$parent.name, $parent.station, .metadata[0].value] | "\(.[0]),\(.[1]),51820,{REPLACE_WITH_YOUR_PRIVATE_KEY},\(.[2])"'
Code:United States #9397,185.203.218.154,51820,PRIVATE_KEY,e8LKAc+f9xEzq9Ar7+MfKRrs+gZ/4yzvpRJLRJ/VJ1w= United States #9391,185.203.218.142,51820,PRIVATE_KEY,e8LKAc+f9xEzq9Ar7+MfKRrs+gZ/4yzvpRJLRJ/VJ1w= United States #9392,185.203.218.144,51820,PRIVATE_KEY,e8LKAc+f9xEzq9Ar7+MfKRrs+gZ/4yzvpRJLRJ/VJ1w=
Bash:curl --silent --retry 3 --connect-timeout 3 --max-time 6 --retry-delay 1 --retry-all-errors "https://api.nordvpn.com/v1/servers/recommendations?filters\[country_id\]=228&filters\[servers_groups\]\[identifier\]=legacy_standard&filters\[servers_technologies\]\[identifier\]=wireguard_udp&limit=5" | jq --raw-output '.[] | . as $parent | .technologies | .[] | select(.identifier == "wireguard_udp") | [$parent.locations[].country.city.name, ($parent.name | split("#") | .[1]), $parent.station, .metadata[0].value] | "\(.[0]) #\(.[1]),\(.[2]),51820,{REPLACE_WITH_YOUR_PRIVATE_KEY},\(.[3])"'
Code:Miami #6610,37.120.215.35,51820,PRIVATE_KEY,e8LKAc+f9xEzq9Ar7+MfKRrs+gZ/4yzvpRJLRJ/VJ1w= Miami #9382,185.203.218.124,51820,PRIVATE_KEY,e8LKAc+f9xEzq9Ar7+MfKRrs+gZ/4yzvpRJLRJ/VJ1w= Miami #9396,185.203.218.152,51820,PRIVATE_KEY,e8LKAc+f9xEzq9Ar7+MfKRrs+gZ/4yzvpRJLRJ/VJ1w= Miami #5940,185.245.86.54,51820,PRIVATE_KEY,e8LKAc+f9xEzq9Ar7+MfKRrs+gZ/4yzvpRJLRJ/VJ1w= Miami #9394,185.203.218.148,51820,PRIVATE_KEY,e8LKAc+f9xEzq9Ar7+MfKRrs+gZ/4yzvpRJLRJ/VJ1w=
- All NordVPN Servers in a certain Country: This example shows you how to export all VPN Server IPs for a certain country. Copy and paste the curl statements into an SSH window on your router to test their output.
First, determine the name of your chosen country using the same query as above that provided the ID number. (Exact spelling is of great importance!)
Once you have found your country's name, replace it with the corresponding name in the curl statement below; repeat for the private key. In this example, I'm using "United States". If the output creates a five-column list that looks like a CSV, you can copy/paste this statement into your VPNMON-R3 Server List Automation Slot and execute it in order to generate a list.
Bash:curl --silent --retry 3 --connect-timeout 3 --max-time 6 --retry-delay 1 --retry-all-errors https://api.nordvpn.com/v1/servers?limit=16354 | jq --raw-output '.[] | select(.locations[0].country.name == "United States") | . as $parent | .technologies | .[] | select(.identifier == "wireguard_udp") | [$parent.locations[].country.city.name, ($parent.name | split("#") | .[1]), $parent.station, .metadata[0].value] | "\(.[0]) #\(.[1]),\(.[2]),51820,{REPLACE_WITH_YOUR_PRIVATE_KEY},\(.[3])"'
- All NordVPN Servers in a certain City: In this example, I will show you how to filter all VPN Servers for a certain city. Copy and paste the curl statements into an SSH window on your router to test their output.
Use the same query above to obtain country names/IDs to also determine accurate city names/IDs.
Once you have found your country/city in the list, replace the city name (exact spelling) in the curl statement below. In this example, I'm using "New York". If the output creates a five-column list that looks like a CSV, you can copy/paste this statement into your VPNMON-R3 Server List Automation Slot and execute it in order to generate a list.
Bash:curl --silent --retry 3 --connect-timeout 3 --max-time 6 --retry-delay 1 --retry-all-errors https://api.nordvpn.com/v1/servers?limit=16354 | jq --raw-output '.[] | select(.locations[0].country.city.name == "New York") | . as $parent | .technologies | .[] | select(.identifier == "wireguard_udp") | [$parent.locations[].country.city.name, ($parent.name | split("#") | .[1]), $parent.station, .metadata[0].value] | "\(.[0]) #\(.[1]),\(.[2]),51820,{REPLACE_WITH_YOUR_PRIVATE_KEY},\(.[3])"'
Last edited: