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": "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"
}Count facet value distribution
Return the top N values for a facet field within a time range, sorted by occurrence count descending.
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": "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"
}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 discover availablefacet_keyvalues for each scope. - The
scopemust be one of:session,view,action,error,resource,long_task,vital,issue,sourcemap. - Pass
dqlto further filter events before counting. DQL syntax follows the RUM query language. - Pass
sqlwith a WHERE-clause only (no SELECT) for SQL-style filtering. - Default limit is 100; maximum is 100.
- Time range is required (
start_time/end_timein Unix epoch milliseconds). Maximum span is 31 days.
Authorizations
App key issued from the Flashduty console under Account → APP Keys. Required on every public API call. Keep it secret — it grants the same access as the owning account.
Body
Parameters for counting facet value distribution.
End of the time range, Unix epoch milliseconds. Maximum 31-day span.
1712707200000
Field key whose value distribution to count; must be a registered field of the given scope. List available fields via POST /rum/field/list.
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 |
session, view, action, error, resource, long_task, vital, issue, sourcemap Start of the time range, Unix epoch milliseconds.
1712620800000
RUM DQL filter expression applied before counting.
When set, filter events where facet_key equals this value before counting. Accepts string, number, or boolean.
Symbol kind, used only when scope is sourcemap and only meaningful for android/harmony: mapping (default) selects ProGuard/R8 mappings or ArkTS sourcemaps, native selects native .so symbols.
mapping, native Maximum number of top values to return. Default 100, maximum 100.
x <= 100SQL WHERE clause (no SELECT) for additional filtering.
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 |
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?