cfspeedtest icon indicating copy to clipboard operation
cfspeedtest copied to clipboard

JSON output lacks a lot of info

Open ogarcia opened this issue 3 weeks ago • 0 comments

Currently, if you run a normal test with the system, it gives you an output similar to the following:

Starting Cloudflare speed test
City: Your city
Country: Your Country
Ip: Your IP
Asn: 0000
Colo: XXX
latency test    [==============================]
Avg GET request latency 12.83 ms (RTT excluding server processing time)

Download 100KB  [==============================]   13.70 mbit/s | 100KB in   58ms -> status: 200 OK
Download 1MB    [==============================]  113.22 mbit/s |   1MB in   70ms -> status: 200 OK
Download 10MB   [==============================]  388.68 mbit/s |  10MB in  205ms -> status: 200 OK
Download 25MB   [==============================]  449.45 mbit/s |  25MB in  444ms -> status: 200 OK
Upload 100KB    [==============================]   30.30 mbit/s | 100KB in   26ms -> status: 200 OK
Upload 1MB      [==============================]  182.06 mbit/s |   1MB in   43ms -> status: 200 OK
Upload 10MB     [==============================]  444.47 mbit/s |  10MB in  179ms -> status: 200 OK
Upload 25MB     [==============================]  541.34 mbit/s |  25MB in  369ms -> status: 200 OK

Summary Statistics
Type     Payload |  min/max/avg in mbit/s
Download  100KB  |  min 10.47   max 16.97   avg 14.17
Download  1MB    |  min 60.83   max 119.06  avg 100.61
Download  10MB   |  min 318.87  max 388.68  avg 364.95
Download  25MB   |  min 359.26  max 458.02  avg 441.08
Upload    100KB  |  min 3.52    max 34.26   avg 27.79
Upload    1MB    |  min 86.27   max 187.40  avg 144.33
Upload    10MB   |  min 344.91  max 513.63  avg 449.82
Upload    25MB   |  min 427.31  max 655.15  avg 523.75

But if you tell it that you want the output as JSON, it only gives you the results of the speed test itself, omitting information about the city, country, IP, etc., and even (most importantly for me) the latency test results. It would be very interesting if all these results were added to the JSON because then they could be sent with a CURL as a payload for a webhook, and from there, you could use your imagination.

On the other hand, I don't know if it's possible, but another interesting option would be to indicate that you only want to do the XX megabyte test. Personally, I would be interested in simply doing the 25 or 100MB test and skipping the rest.

By the way, great project 🥇

ogarcia avatar Nov 16 '25 13:11 ogarcia