Count facet value distribution
curl --request POST \
--url 'https://api.flashcat.cloud/rum/facet/count?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"end_time": 1712707200000,
"facet_key": "error_type",
"limit": 10,
"scope": "error",
"start_time": 1712620800000
}
'import requests
url = "https://api.flashcat.cloud/rum/facet/count?app_key="
payload = {
"end_time": 1712707200000,
"facet_key": "error_type",
"limit": 10,
"scope": "error",
"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,
facet_key: 'error_type',
limit: 10,
scope: 'error',
start_time: 1712620800000
})
};
fetch('https://api.flashcat.cloud/rum/facet/count?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/facet/count?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,
'facet_key' => 'error_type',
'limit' => 10,
'scope' => 'error',
'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/facet/count?app_key="
payload := strings.NewReader("{\n \"end_time\": 1712707200000,\n \"facet_key\": \"error_type\",\n \"limit\": 10,\n \"scope\": \"error\",\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/facet/count?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"end_time\": 1712707200000,\n \"facet_key\": \"error_type\",\n \"limit\": 10,\n \"scope\": \"error\",\n \"start_time\": 1712620800000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/rum/facet/count?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 \"facet_key\": \"error_type\",\n \"limit\": 10,\n \"scope\": \"error\",\n \"start_time\": 1712620800000\n}"
response = http.request(request)
puts response.read_body{
"data": {
"items": [
{
"count": 1523,
"facet_value": "TypeError"
},
{
"count": 342,
"facet_value": "ReferenceError"
},
{
"count": 89,
"facet_value": "SyntaxError"
}
]
},
"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"
}Facets
Count facet value distribution
Return the top N values for a facet field within a time range, sorted by occurrence count descending.
POST
/
rum
/
facet
/
count
Count facet value distribution
curl --request POST \
--url 'https://api.flashcat.cloud/rum/facet/count?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"end_time": 1712707200000,
"facet_key": "error_type",
"limit": 10,
"scope": "error",
"start_time": 1712620800000
}
'import requests
url = "https://api.flashcat.cloud/rum/facet/count?app_key="
payload = {
"end_time": 1712707200000,
"facet_key": "error_type",
"limit": 10,
"scope": "error",
"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,
facet_key: 'error_type',
limit: 10,
scope: 'error',
start_time: 1712620800000
})
};
fetch('https://api.flashcat.cloud/rum/facet/count?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/facet/count?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,
'facet_key' => 'error_type',
'limit' => 10,
'scope' => 'error',
'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/facet/count?app_key="
payload := strings.NewReader("{\n \"end_time\": 1712707200000,\n \"facet_key\": \"error_type\",\n \"limit\": 10,\n \"scope\": \"error\",\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/facet/count?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"end_time\": 1712707200000,\n \"facet_key\": \"error_type\",\n \"limit\": 10,\n \"scope\": \"error\",\n \"start_time\": 1712620800000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/rum/facet/count?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 \"facet_key\": \"error_type\",\n \"limit\": 10,\n \"scope\": \"error\",\n \"start_time\": 1712620800000\n}"
response = http.request(request)
puts response.read_body{
"data": {
"items": [
{
"count": 1523,
"facet_value": "TypeError"
},
{
"count": 342,
"facet_value": "ReferenceError"
},
{
"count": 89,
"facet_value": "SyntaxError"
}
]
},
"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 start is rounded down and the end rounded up tomax(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. Results may be up to 60 seconds stale for the most recent data.
Restrictions
| Aspect | Value |
|---|---|
| Rate limits | 300 requests/minute; 100 requests/second per account |
| Permissions | None — any valid app_key can call this operation |
Usage
- Use
POST /rum/field/listwithis_facet: trueto discoverfacet_keyvalues for each scope. facet_keymust be a facet field (is_facet: true) of the requestedscopewithshow_type: listand a non-arrayvalue_type; otherwise the call returnsInvalidParameter.- Events where
facet_keyisnullare not counted. Passfacet_valueto count only events equal to that value; its JSON type must match the field’svalue_type. - Pass
dqlto filter events before counting. Passsqlas a bareWHEREcondition; the wordSELECTanywhere in it (case-insensitive) is rejected. - Events of private applications the caller cannot access are not counted, as in
POST /rum/data/query. limitdefaults to 100; maximum is 100.start_time/end_timeare required Unix epoch milliseconds, at most 31 days apart.- For
scope: sourcemap,typeandkindchoose which symbol store is counted.
Authorizations
Body
application/json
Parameters for counting facet value distribution.
RUM data scope to query. One of:
| Value | Meaning |
|---|---|
session | User sessions |
view | Page views |
action | User actions |
error | Error events |
resource | Resource loads |
long_task | Long tasks |
vital | Performance vitals (Web Vitals, etc.) |
issue | Aggregated error-tracking issues |
sourcemap | Sourcemap / symbol files |
Available options:
session, view, action, error, resource, long_task, vital, issue, sourcemap Symbol-store platform, used only when scope is sourcemap. Defaults to browser when omitted; web and javascript are accepted aliases of browser.
| Value | Store queried |
|---|---|
browser / web / javascript | JavaScript sourcemaps (excluding HarmonyOS ArkTS and React Native rows) |
android | Android ProGuard/R8 mappings; with kind=native, Android NDK .so symbols |
ios | iOS dSYM symbols |
miniprogram | WeChat mini program sourcemaps |
harmony | HarmonyOS ArkTS sourcemaps; with kind=native, HarmonyOS .so symbols |
flutter | Flutter Dart AOT symbols |
electron | Electron Breakpad symbols |
react-native | React Native JS sourcemaps |
Available options:
browser, web, javascript, android, ios, miniprogram, harmony, flutter, electron, react-native 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?