curl "https://api.shortkit.dev/v1/metrics/views?timeframe[]=7:days" \
-H "Authorization: Bearer sk_live_your_secret_key"
import requests
resp = requests.get(
"https://api.shortkit.dev/v1/metrics/views",
headers={"Authorization": "Bearer sk_live_your_secret_key"},
params={"timeframe[]": "7:days"},
)
metric = resp.json()["data"]
print(f"Views: {metric['value']}")
const resp = await fetch(
"https://api.shortkit.dev/v1/metrics/views?timeframe[]=7:days",
{
headers: { Authorization: "Bearer sk_live_your_secret_key" },
}
);
const { data: metric } = await resp.json();
console.log(`Views: ${metric.value}`);
{
"data": {
"value": 12450,
"total_views": 12450
},
"timeframe": [1740700800, 1741305600],
"meta": {
"request_id": "req_m001"
}
}
Analytics & Events
Get Metric
Returns a single aggregate value for a metric over a timeframe.
GET
/
v1
/
metrics
/
{metric}
curl "https://api.shortkit.dev/v1/metrics/views?timeframe[]=7:days" \
-H "Authorization: Bearer sk_live_your_secret_key"
import requests
resp = requests.get(
"https://api.shortkit.dev/v1/metrics/views",
headers={"Authorization": "Bearer sk_live_your_secret_key"},
params={"timeframe[]": "7:days"},
)
metric = resp.json()["data"]
print(f"Views: {metric['value']}")
const resp = await fetch(
"https://api.shortkit.dev/v1/metrics/views?timeframe[]=7:days",
{
headers: { Authorization: "Bearer sk_live_your_secret_key" },
}
);
const { data: metric } = await resp.json();
console.log(`Views: ${metric.value}`);
{
"data": {
"value": 12450,
"total_views": 12450
},
"timeframe": [1740700800, 1741305600],
"meta": {
"request_id": "req_m001"
}
}
Path parameters
Metric to query. See Metrics Overview for the full list.
Query parameters
Aggregation function:
sum or avg. Only applies to aggregate metrics (watch_time, playing_time, video_startup_time). Count metrics ignore this parameter.Narrow the views to one dimension value, as
dimension:value (for example sdk_version:0.2.93 or os_name:iOS). Repeat to combine dimensions. See Dimensions for the full list.curl "https://api.shortkit.dev/v1/metrics/views?timeframe[]=7:days" \
-H "Authorization: Bearer sk_live_your_secret_key"
import requests
resp = requests.get(
"https://api.shortkit.dev/v1/metrics/views",
headers={"Authorization": "Bearer sk_live_your_secret_key"},
params={"timeframe[]": "7:days"},
)
metric = resp.json()["data"]
print(f"Views: {metric['value']}")
const resp = await fetch(
"https://api.shortkit.dev/v1/metrics/views?timeframe[]=7:days",
{
headers: { Authorization: "Bearer sk_live_your_secret_key" },
}
);
const { data: metric } = await resp.json();
console.log(`Views: ${metric.value}`);
{
"data": {
"value": 12450,
"total_views": 12450
},
"timeframe": [1740700800, 1741305600],
"meta": {
"request_id": "req_m001"
}
}
Examples
Completions over 30 days:curl "https://api.shortkit.dev/v1/metrics/completions?timeframe[]=30:days" \
-H "Authorization: Bearer sk_live_your_secret_key"
curl "https://api.shortkit.dev/v1/metrics/video_startup_time?measurement=avg&timeframe[]=24:hours" \
-H "Authorization: Bearer sk_live_your_secret_key"