getScores() method returns quality scores based on Cloudflare’s Aggregated Internet Measurement (AIM) framework. AIM translates raw network metrics into use-case-specific quality ratings that are directly meaningful to end users.
getScores() requires all measurements to be complete. Call it inside the onFinish callback, or after confirming results.isFinished === true. Calling it mid-test may return an empty object or incomplete scores if the required input metrics are not yet available.How scores are computed
Each AIM use case (e.g., streaming, gaming) is defined by a set of input metrics and a scoring function. The engine:- Computes a point value for each input metric (download, upload, latency, jitter, packet loss, loaded latency increase).
- Sums the points for the use case.
- Maps the total to one of five classification bands using configurable thresholds.
Results object.
getScores()
Returns an object keyed by use case name. Each value contains a numeric score and a classification.
Example output
Score shape
Aggregate numeric score for the use case. Higher is better. The scale and maximum value depend on the use case definition and the configured
aimMeasurementScoring and aimExperiencesDefs options.Numeric index representing the quality band. Maps as follows:
| Index | Name |
|---|---|
0 | bad |
1 | poor |
2 | average |
3 | good |
4 | great |
Human-readable label for the quality band. Equivalent to
classificationNames[classificationIdx].Displaying scores
UseclassificationName for UI labels and classificationIdx when mapping to colors or icons programmatically.
Checking score availability
Because scores depend onisFinished, guard against calling getScores() before the test completes:
