This post is making use of the speedtest command line version of Ookla’s speedtest tools, which you can get here for various OSes: https://www.speedtest.net/apps/cli
Specifically, I was looking for a linux solution, and while it’s straight forward on the Mac, where the --csv flag produces a CSV string that includes a proper timestamp of the measurement, the interface or API for the homebrew CLI versions of Mac and Linux are quite different.