Skip to main content

Measurements

Reference for the measurements endpoints of the Surfmeter API.

Surfmeter API – Measurements v1

The Surfmeter API lets you manage clients, users, capabilities, measurements, and organization-wide settings programmatically.


Servers​

Description URL
https://surfmeter-server.{host}/client_admin_api/v1 https://surfmeter-server.{host}/client_admin_api/v1

Measurements​


POST /measurements/search​

Input parameters

Parameter In Type Default Nullable Description
ApiKeyAuth header string N/A No API key used on every request. Create keys in the Surfmeter Dashboard under Keys → Surfmeter API Keys.

Request body

{
"body": null,
"source_only": true,
"index_scope": "web",
"size": 0,
"from": 0,
"search_after": [
null
],
"scroll": "string"
}

⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
"description": "Request data for the measurements search action. Wraps an Elasticsearch search request against the current data owner's analytics index. The `body` property is passed through to Elasticsearch as a Query DSL payload; additional top-level properties (`size`, `from`, `search_after`, `scroll`) control pagination and streaming behavior and are forwarded to the Elasticsearch client alongside the body.",
"type": "object",
"additionalProperties": false,
"required": [
"body"
],
"properties": {
"body": {
"additionalProperties": true,
"description": "Elasticsearch Query DSL payload. Treated as a passthrough: any valid Elasticsearch search request body (`query`, `aggs`, `sort`, `size`, `from`, `search_after`, `_source`, etc.) is accepted. May also be provided as a JSON-formatted string, in which case it is parsed server-side.",
"oneOf": [
{
"type": "object"
},
{
"type": "string"
}
]
},
"source_only": {
"type": "boolean",
"description": "If true, the response is reduced to a plain array of `_source` documents instead of the full Elasticsearch response envelope."
},
"index_scope": {
"type": "string",
"enum": [
"web",
"video",
"network",
"speedtest",
"conferencing",
"gaming",
"error_events"
],
"description": "Restricts the search to the indices of a single measurement type instead of all measurement indices. Useful for type-specific queries (e.g. `nested` queries on fields that only exist on web measurements) and to reduce the number of searched shards. `error_events` searches the player error events of client-analytics sessions instead (one document per error, with `measurement_id`, `client_uuid`, `media_time` and `error.{message,error_type,error_code,svta_code,fatal,http_status}`). `error_code` is the player's raw code and `svta_code` the SVTA2070 code, absent if the error is out of scope for the spec. An error without `fatal` is non-fatal. `http_status` is only set for HTTP failures. An unknown value is rejected with a 400."
},
"size": {
"type": "integer",
"description": "Maximum number of hits to return. Forwarded to the Elasticsearch client as a top-level parameter; equivalent to setting `size` inside `body`."
},
"from": {
"type": "integer",
"description": "Offset of the first hit to return, used for basic pagination. Forwarded to the Elasticsearch client as a top-level parameter."
},
"search_after": {
"type": "array",
"description": "Opaque cursor for deep pagination. Pass the `sort` array from the last hit of the previous page; requires a stable `sort` clause in `body`.",
"items": {}
},
"scroll": {
"type": "string",
"description": "Enables Elasticsearch scroll search with the given timeout (e.g. `\"1m\"`). When set, the response is streamed as NDJSON (`application/x-ndjson`) instead of a single JSON object."
}
}
}

Response 200 OK

Schema of the response body
{
"description": "Response for the measurements search action. Shape depends on the request: when `source_only=true` the response is an array of measurement source documents; otherwise it is the raw Elasticsearch search response envelope (hits, aggregations, etc.). When `scroll` is set, results are streamed as NDJSON and this schema does not apply.",
"oneOf": [
{
"description": "Returned when `source_only=true`: a plain array of measurement `_source` documents, without Elasticsearch metadata. Each item is a measurement document; its concrete shape depends on the measurement type (video, web, etc.).",
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
{
"description": "Default response: the Elasticsearch search response envelope. Only the outermost keys are described here; everything inside is passed through unchanged.",
"type": "object",
"additionalProperties": true,
"properties": {
"took": {
"type": "integer",
"description": "Time in milliseconds Elasticsearch spent executing the search."
},
"timed_out": {
"type": "boolean",
"description": "Whether the search timed out before completing."
},
"_shards": {
"type": "object",
"additionalProperties": true,
"description": "Per-shard execution summary reported by Elasticsearch."
},
"hits": {
"type": "object",
"additionalProperties": true,
"description": "Container for matching documents. Includes `total`, `max_score`, and `hits` (an array of hit objects with `_index`, `_id`, `_source`, `sort`, etc.)."
},
"aggregations": {
"type": "object",
"additionalProperties": true,
"description": "Aggregation results, present only when the request `body` contained an `aggs` clause."
},
"_scroll_id": {
"type": "string",
"description": "Scroll cursor, present only when the request used the `scroll` parameter."
}
}
}
]
}

GET /measurements/{id}​

Input parameters

Parameter In Type Default Nullable Description
ApiKeyAuth header string N/A No API key used on every request. Create keys in the Surfmeter Dashboard under Keys → Surfmeter API Keys.
id path string No

Response 200 OK


GET /measurements/{id}/client_reports​

Input parameters

Parameter In Type Default Nullable Description
ApiKeyAuth header string N/A No API key used on every request. Create keys in the Surfmeter Dashboard under Keys → Surfmeter API Keys.
data_type query string No Comma-separated data types to return. For the P.1203 reports of a conferencing measurement these are "target" (encoder target bitrate), "sent" (bitrate actually sent) and "received" (bitrate actually received).
id path string No
type query string No Comma-separated client report types to return, e.g. "P1203ClientReport" or "P1203ClientReport,ByteCountClientReport". An unknown type returns 400. Without it, all reports of the measurement are returned, which can be large.

Response 200 OK

{
"client_reports": [
{
"id": 0,
"type": "string",
"data_type": "string",
"client_time": "string",
"data": null
}
]
}

⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
"description": "Response for the measurement client reports action, ordered by client time",
"type": "object",
"additionalProperties": false,
"required": [
"client_reports"
],
"properties": {
"client_reports": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"id",
"type",
"data_type",
"client_time",
"data"
],
"properties": {
"id": {
"type": "integer"
},
"type": {
"type": "string",
"description": "Client report type, e.g. \"P1203ClientReport\"."
},
"data_type": {
"type": "string",
"description": "Kind of data in the report. For the P.1203 reports of a conferencing measurement: \"target\", \"sent\" or \"received\". Null for most other reports.",
"nullable": true
},
"client_time": {
"type": "string",
"description": "Time at which the client created the report (ISO 8601)."
},
"data": {
"description": "Report data. Its shape depends on the report type; a P1203ClientReport holds the P.1203 input (I11, I13, I23, IGen).",
"oneOf": [
{
"type": "object"
},
{
"type": "array"
}
]
}
}
}
}
}
}

GET /measurements/{id}/p1203_client_report​

Input parameters

Parameter In Type Default Nullable Description
ApiKeyAuth header string N/A No API key used on every request. Create keys in the Surfmeter Dashboard under Keys → Surfmeter API Keys.
id path string No

Response 200 OK


GET /measurements/{id}/network_performance_report​

Input parameters

Parameter In Type Default Nullable Description
ApiKeyAuth header string N/A No API key used on every request. Create keys in the Surfmeter Dashboard under Keys → Surfmeter API Keys.
id path string No

Response 200 OK


GET /measurements/{id}/lightweight_video_player_performance_report​

Input parameters

Parameter In Type Default Nullable Description
ApiKeyAuth header string N/A No API key used on every request. Create keys in the Surfmeter Dashboard under Keys → Surfmeter API Keys.
id path string No

Response 200 OK


Schemas​

MeasurementClientReportsResponse​

Name Type
client_reports Array<Properties: id, type, data_type, client_time, data>

MeasurementSearchData​

Name Type
body
from integer
index_scope string
scroll string
search_after Array<>
size integer
source_only boolean

MeasurementSearchResponse​

Type:

Security schemes​

<tr>
<td>ApiKeyAuth</td>
<td>apiKey</td>
<td></td>
<td>API key used on every request. Create keys in the Surfmeter Dashboard

under Keys → Surfmeter API Keys.

</tbody>
Name Type Scheme Description