Jump to content

VPN Service with API support

lfk

I have been using the Free ProtonVPN service recently.  One of the features I like is they have an API that can query endpoint load and speeds.  I built a script in my router that retrieve the status of all the endpoints via API and picks the fastest responding and configured the VPN to that endpoint and put that on a schedule to run every do often.

 

API for Proton if anyone is interested (https://api.protonmail.ch/vpn/logicals)

 

I'm now considering paying for the full service but before I commit to Proton I'm trying to find out if any other VPN providers have a similar API so I have some choices rather than being tied to proton.

 

Anyone have any idea if other VPN providers have a similar API?

Link to comment
Share on other sites

Link to post
Share on other sites

21 minutes ago, lfk said:

I have been using the Free ProtonVPN service recently.  One of the features I like is they have an API that can query endpoint load and speeds.  I built a script in my router that retrieve the status of all the endpoints via API and picks the fastest responding and configured the VPN to that endpoint and put that on a schedule to run every do often.

 

API for Proton if anyone is interested (https://api.protonmail.ch/vpn/logicals)

 

I'm now considering paying for the full service but before I commit to Proton I'm trying to find out if any other VPN providers have a similar API so I have some choices rather than being tied to proton.

 

Anyone have any idea if other VPN providers have a similar API?

No, but a firewall appliance like pfsense can monitor ping to multiple endpoints and dynamically switch which route to pick based on lowest ping. This would let you use any, or multiple VPN’s and not worry about it an API is changed or removed etc. 

Rig: i7 13700k - - Asus Z790-P Wifi - - RTX 4080 - - 4x16GB 6000MHz - - Samsung 990 Pro 2TB NVMe Boot + Main Programs - - Assorted SATA SSD's for Photo Work - - Corsair RM850x - - Sound BlasterX EA-5 - - Corsair XC8 JTC Edition - - Corsair GPU Full Cover GPU Block - - XT45 X-Flow 420 + UT60 280 rads - - EK XRES RGB PWM - - Fractal Define S2 - - Acer Predator X34 -- Logitech G502 - - Logitech G710+ - - Logitech Z5500 - - LTT Deskpad

 

Headphones/amp/dac: Schiit Lyr 3 - - Fostex TR-X00 - - Sennheiser HD 6xx

 

Homelab/ Media Server: Proxmox VE host - - 512 NVMe Samsung 980 RAID Z1 for VM's/Proxmox boot - - Xeon e5 2660 V4- - Supermicro X10SRF-i - - 128 GB ECC 2133 - - 10x4 TB WD Red RAID Z2 - - Corsair 750D - - Corsair RM650i - - Dell H310 6Gbps SAS HBA - - Intel RES2SC240 SAS Expander - - TreuNAS + many other VM’s

 

iPhone 14 Pro - 2018 MacBook Air

Link to comment
Share on other sites

Link to post
Share on other sites

Update to my own post,  NordVPN has one.

Link to comment
Share on other sites

Link to post
Share on other sites

On 7/20/2022 at 5:30 AM, LIGISTX said:

No, but a firewall appliance like pfsense can monitor ping to multiple endpoints and dynamically switch which route to pick based on lowest ping. This would let you use any, or multiple VPN’s and not worry about it an API is changed or removed etc. 

In my experience pfSense is a horrible choice for commercial VPNs, as it will bounce the firewall constantly if the servers are dropping packets.  Every time it switches routes it has to restart the firewall disconnecting existing sessions, its quite annoying.  Its the one thing I hate about pfSense.

Although I spent most of the time using AirVPN which has been really rough lately, so your mileage may vary.

Router:  Intel N100 (pfSense) WiFi6: Zyxel NWA210AX (1.7Gbit peak at 160Mhz)
WiFi5: Ubiquiti NanoHD OpenWRT (~500Mbit at 80Mhz) Switches: Netgear MS510TXUP, MS510TXPP, GS110EMX
ISPs: Zen Full Fibre 900 (~930Mbit down, 115Mbit up) + Three 5G (~800Mbit down, 115Mbit up)
Upgrading Laptop/Desktop CNVIo WiFi 5 cards to PCIe WiFi6e/7

Link to comment
Share on other sites

Link to post
Share on other sites

10 hours ago, Alex Atkin UK said:

In my experience pfSense is a horrible choice for commercial VPNs, as it will bounce the firewall constantly if the servers are dropping packets.  Every time it switches routes it has to restart the firewall disconnecting existing sessions, its quite annoying.  Its the one thing I hate about pfSense.

Although I spent most of the time using AirVPN which has been really rough lately, so your mileage may vary.

Hmm, I would argue your VPN’s shouldn’t be dropping packets, lol. 
 

You can also set up how much loss is acceptable before it switches, etc. 

 

I have a WireGuard VPN set up from site to site for some of my devices, it’s been extremely solid, but it’s also all self hosted, I don’t have to rely on any one else besides ISP’s. 

Rig: i7 13700k - - Asus Z790-P Wifi - - RTX 4080 - - 4x16GB 6000MHz - - Samsung 990 Pro 2TB NVMe Boot + Main Programs - - Assorted SATA SSD's for Photo Work - - Corsair RM850x - - Sound BlasterX EA-5 - - Corsair XC8 JTC Edition - - Corsair GPU Full Cover GPU Block - - XT45 X-Flow 420 + UT60 280 rads - - EK XRES RGB PWM - - Fractal Define S2 - - Acer Predator X34 -- Logitech G502 - - Logitech G710+ - - Logitech Z5500 - - LTT Deskpad

 

Headphones/amp/dac: Schiit Lyr 3 - - Fostex TR-X00 - - Sennheiser HD 6xx

 

Homelab/ Media Server: Proxmox VE host - - 512 NVMe Samsung 980 RAID Z1 for VM's/Proxmox boot - - Xeon e5 2660 V4- - Supermicro X10SRF-i - - 128 GB ECC 2133 - - 10x4 TB WD Red RAID Z2 - - Corsair 750D - - Corsair RM650i - - Dell H310 6Gbps SAS HBA - - Intel RES2SC240 SAS Expander - - TreuNAS + many other VM’s

 

iPhone 14 Pro - 2018 MacBook Air

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, LIGISTX said:

Hmm, I would argue your VPN’s shouldn’t be dropping packets, lol. 
 

You can also set up how much loss is acceptable before it switches, etc. 

 

I have a WireGuard VPN set up from site to site for some of my devices, it’s been extremely solid, but it’s also all self hosted, I don’t have to rely on any one else besides ISP’s. 

You're not wrong, but sadly AirVPN servers regularly have packet loss issues.  Its a hard thing to quantify though as dropping ICMP packets is not considered mission critical, ping is just a terrible way to measure reliability.  I think the only other way would be to use deep packet inspection to see if real-world traffic is dropping, but even that is problematic if the link is idle, and would dramatically increase CPU usage on the box running the VPN client.

I tried fiddling with the limits but it doesn't really help, because often the instability kicks in when the link is in use but disappears when its idle.  So it would mark the gateway down, then packet loss drops to 0, brings it back up, hits the limit again and drops it, rinse and repeat.  I just disable gateway monitoring action completely now and manually force the VPN to restart if it stops working.

This isn't limited to VPNs either though, I have a 5G backup connection that I also have to disable monitoring action as on a bad day pings can shoot up to 2000ms.

 

I will add that my Wireguard link to an IONOS hosted VPS in the US has been quite reliable, at least since I moved to FTTP.

 

Another PITA with Wireguard is to restart one VPN you have to restart the entire Wireguard service, so if you have more than one VPN you can end up fixing one and getting a worse server on another.  OpenVPN you can just restart the problematic instance.

Router:  Intel N100 (pfSense) WiFi6: Zyxel NWA210AX (1.7Gbit peak at 160Mhz)
WiFi5: Ubiquiti NanoHD OpenWRT (~500Mbit at 80Mhz) Switches: Netgear MS510TXUP, MS510TXPP, GS110EMX
ISPs: Zen Full Fibre 900 (~930Mbit down, 115Mbit up) + Three 5G (~800Mbit down, 115Mbit up)
Upgrading Laptop/Desktop CNVIo WiFi 5 cards to PCIe WiFi6e/7

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×