speedtest.net api

speedtest.net is run by Ookla and their Speed Test application. Unfortunately they don’t provide any public APIs for speedtest.net which you could use.

Although I doubt either of these meet your needs, they do provide Speed Test Mini and a hosted reporting solution for their full Speed Test software package (which includes CSV exporting capabilities).

The reason you’re unable to use AJAX is because Chrome will not allow JavaScript to perform cross-site requests unless the Access-Control-Allow-Origin response header is set in the response from speedtest.net to permit such a request.

In a Chrome extension, however, you can allow cross-origin requests by adding the URL to the permissions section of your manifest.json file. For example:

"permissions": [
  "http://*/"
],

You could then use a bit of jQuery to retrieve the CSV data as a string (see this answer):

$.get('http://speedtest.net/csv.php?csv=1&ria=0&s=0', function(data) {
    var csv = new String(data);
    // do stuff with csv
}, dataType='text');

Leave a Comment