Query RUM data
curl --request POST \
--url 'https://api.flashcat.cloud/rum/data/query?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"end_time": 1712707200000,
"queries": [
{
"format": "table",
"id": "errors_by_type",
"sql": "SELECT error_type, count(*) AS errors FROM errors GROUP BY error_type ORDER BY errors DESC LIMIT 10"
}
],
"start_time": 1712620800000
}
'import requests
url = "https://api.flashcat.cloud/rum/data/query?app_key="
payload = {
"end_time": 1712707200000,
"queries": [
{
"format": "table",
"id": "errors_by_type",
"sql": "SELECT error_type, count(*) AS errors FROM errors GROUP BY error_type ORDER BY errors DESC LIMIT 10"
}
],
"start_time": 1712620800000
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
end_time: 1712707200000,
queries: [
{
format: 'table',
id: 'errors_by_type',
sql: 'SELECT error_type, count(*) AS errors FROM errors GROUP BY error_type ORDER BY errors DESC LIMIT 10'
}
],
start_time: 1712620800000
})
};
fetch('https://api.flashcat.cloud/rum/data/query?app_key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flashcat.cloud/rum/data/query?app_key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'end_time' => 1712707200000,
'queries' => [
[
'format' => 'table',
'id' => 'errors_by_type',
'sql' => 'SELECT error_type, count(*) AS errors FROM errors GROUP BY error_type ORDER BY errors DESC LIMIT 10'
]
],
'start_time' => 1712620800000
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flashcat.cloud/rum/data/query?app_key="
payload := strings.NewReader("{\n \"end_time\": 1712707200000,\n \"queries\": [\n {\n \"format\": \"table\",\n \"id\": \"errors_by_type\",\n \"sql\": \"SELECT error_type, count(*) AS errors FROM errors GROUP BY error_type ORDER BY errors DESC LIMIT 10\"\n }\n ],\n \"start_time\": 1712620800000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.flashcat.cloud/rum/data/query?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"end_time\": 1712707200000,\n \"queries\": [\n {\n \"format\": \"table\",\n \"id\": \"errors_by_type\",\n \"sql\": \"SELECT error_type, count(*) AS errors FROM errors GROUP BY error_type ORDER BY errors DESC LIMIT 10\"\n }\n ],\n \"start_time\": 1712620800000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/rum/data/query?app_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"end_time\": 1712707200000,\n \"queries\": [\n {\n \"format\": \"table\",\n \"id\": \"errors_by_type\",\n \"sql\": \"SELECT error_type, count(*) AS errors FROM errors GROUP BY error_type ORDER BY errors DESC LIMIT 10\"\n }\n ],\n \"start_time\": 1712620800000\n}"
response = http.request(request)
puts response.read_body{
"data": {
"errors_by_type": {
"data": {
"fields": [
{
"name": "error_type",
"nullable": true,
"type": "VARCHAR"
},
{
"name": "errors",
"nullable": false,
"type": "BIGINT"
}
],
"values": [
[
"TypeError",
"ReferenceError"
],
[
1523,
342
]
]
}
}
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "InvalidParameter",
"message": "The specified parameter is not valid."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "Unauthorized",
"message": "You are unauthorized."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "AccessDenied",
"message": "Access Denied."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "RequestTooFrequently",
"message": "Request too frequently."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "InternalError",
"message": "We encountered an internal error, and it has been reported. Please try again later."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}Data query
Query RUM data
Run one or more SQL-style RUM data queries over a bounded time range.
POST
/
rum
/
data
/
query
Query RUM data
curl --request POST \
--url 'https://api.flashcat.cloud/rum/data/query?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"end_time": 1712707200000,
"queries": [
{
"format": "table",
"id": "errors_by_type",
"sql": "SELECT error_type, count(*) AS errors FROM errors GROUP BY error_type ORDER BY errors DESC LIMIT 10"
}
],
"start_time": 1712620800000
}
'import requests
url = "https://api.flashcat.cloud/rum/data/query?app_key="
payload = {
"end_time": 1712707200000,
"queries": [
{
"format": "table",
"id": "errors_by_type",
"sql": "SELECT error_type, count(*) AS errors FROM errors GROUP BY error_type ORDER BY errors DESC LIMIT 10"
}
],
"start_time": 1712620800000
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
end_time: 1712707200000,
queries: [
{
format: 'table',
id: 'errors_by_type',
sql: 'SELECT error_type, count(*) AS errors FROM errors GROUP BY error_type ORDER BY errors DESC LIMIT 10'
}
],
start_time: 1712620800000
})
};
fetch('https://api.flashcat.cloud/rum/data/query?app_key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flashcat.cloud/rum/data/query?app_key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'end_time' => 1712707200000,
'queries' => [
[
'format' => 'table',
'id' => 'errors_by_type',
'sql' => 'SELECT error_type, count(*) AS errors FROM errors GROUP BY error_type ORDER BY errors DESC LIMIT 10'
]
],
'start_time' => 1712620800000
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flashcat.cloud/rum/data/query?app_key="
payload := strings.NewReader("{\n \"end_time\": 1712707200000,\n \"queries\": [\n {\n \"format\": \"table\",\n \"id\": \"errors_by_type\",\n \"sql\": \"SELECT error_type, count(*) AS errors FROM errors GROUP BY error_type ORDER BY errors DESC LIMIT 10\"\n }\n ],\n \"start_time\": 1712620800000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.flashcat.cloud/rum/data/query?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"end_time\": 1712707200000,\n \"queries\": [\n {\n \"format\": \"table\",\n \"id\": \"errors_by_type\",\n \"sql\": \"SELECT error_type, count(*) AS errors FROM errors GROUP BY error_type ORDER BY errors DESC LIMIT 10\"\n }\n ],\n \"start_time\": 1712620800000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/rum/data/query?app_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"end_time\": 1712707200000,\n \"queries\": [\n {\n \"format\": \"table\",\n \"id\": \"errors_by_type\",\n \"sql\": \"SELECT error_type, count(*) AS errors FROM errors GROUP BY error_type ORDER BY errors DESC LIMIT 10\"\n }\n ],\n \"start_time\": 1712620800000\n}"
response = http.request(request)
puts response.read_body{
"data": {
"errors_by_type": {
"data": {
"fields": [
{
"name": "error_type",
"nullable": true,
"type": "VARCHAR"
},
{
"name": "errors",
"nullable": false,
"type": "BIGINT"
}
],
"values": [
[
"TypeError",
"ReferenceError"
],
[
1523,
342
]
]
}
}
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "InvalidParameter",
"message": "The specified parameter is not valid."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "Unauthorized",
"message": "You are unauthorized."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "AccessDenied",
"message": "Access Denied."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "RequestTooFrequently",
"message": "Request too frequently."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "InternalError",
"message": "We encountered an internal error, and it has been reported. Please try again later."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}Time range alignment and caching
So that repeated queries can reuse cached results, the time range of aggregation queries is aligned to a grid:format=time_series: the start is rounded down and the end rounded up to theinterval. The number and positions of buckets do not change; the first and last buckets now cover their full interval instead of a partial one.- Aggregate (non-time-series) queries: the start is rounded down and the end rounded up to
max(1 minute, range ÷ 1226 rounded up to the next standard interval step), for example 24h aligns to 2 minutes, 7d to 10 minutes, and 30d to 1 hour. Ranges shorter than 100 grid steps are neither aligned nor cached. At most one grid step of extra data is included at the start; the end rounds into the future, which holds no data. - Detail/list queries (no aggregation, pagination), and queries whose SQL calls functions that depend on when they run, such as
now(), are neither aligned nor cached.
Restrictions
| Aspect | Value |
|---|---|
| Rate limits | 1,000 requests/minute; 50 requests/second per account |
| Permissions | None — any valid app_key can call this operation |
Usage
- Send 1 to 10 queries in one request; each query
idbecomes a key in the response object. start_timeandend_timeare Unix epoch milliseconds, at most 31 days apart. The server adds the time-range and account filters itself; you do not need them insql.FROMnames a RUM scope table:sessions,views,actions,errors,resources,long_tasks,vitals,issuesorsourcemaps(the singular form is also accepted). Column names are thefield_keyvalues returned byPOST /rum/field/list.- A query whose top-level
ANDconditions pinapplication_id(=orIN) must name applications the caller can read: a private application the caller’s team does not own fails the whole request withAccessDenied, an unknown one withResourceNotFound, and one request may name at most 50 distinct applications. A query that names no application silently skips the private applications the caller cannot read. - Malformed SQL, an invalid
time_zoneor an out-of-range time window fails the whole request withInvalidParameter. A query that fails later (unknown table or column, invalidsearch_after_ctx, database error) only setserroron its own entry, with codeInternalError; the other queries still returndata. Adqlthe parser rejects also fails only its own entry, with codeInvalidParameterand a message naming the query. valuesis column-major:values[i]holds every row’s value of columnfields[i].tablequeries return at most 1,000 rows; a missingLIMITor one above 1,000 is replaced with 1,000. A non-aggregate query withORDER BYand noOFFSETreturnssearch_after_ctxwhen the page is full — send it back with the samesqlto get the next page.time_seriesqueries get atscolumn prepended (bucket start, Unix milliseconds), grouped and ordered by it. The bucket width, returned asintervalin milliseconds, is the smallest step from a fixed ladder (1, 2, 5, 10, 20, 50, 100, 200, 500 ms; 1, 2, 5, 10, 15, 30 s; 1, 2, 5, 10, 15, 30 min; 1, 2, 3, 6, 12 h; 1, 2, 3, 7 d; 30, 60, 90, 180 d) that is at least bothintervaland the window length divided bymax_points.- On large time windows an aggregate query may run on sampled data; the response then carries
sampling, andCOUNT,SUMandCOUNT(DISTINCT)columns are already multiplied byscale_factor. Setdisable_sampling: trueto always query the full data.
Authorizations
Body
application/json
Batch of RUM data queries over a bounded time range.
Response
Success
Success response envelope. On every 2xx response, request_id identifies the call (also mirrored in the Flashcat-Request-Id header) and data holds the endpoint-specific payload. Failure responses use a different shape — see ErrorResponse.
Was this page helpful?