speedtest-cli
Command line interface for testing internet bandwidth using speedtest
...Speedtest CLI brings the trusted technology and global server network behind Speedtest to the command line. Measure internet connection performance metrics like download, upload, latency and packet loss natively without relying on a web browser. Test the internet connection of your Linux desktop, a remote server or even lower-powered devices such as the Raspberry Pi with the Speedtest Server Network. Set up automated scripts to collect connection performance data, including trends over time.