Skip to content

Get Metric

GET
/api/v1/query/metrics/{metric_name}
curl --request GET \
--url 'https://example.com/api/v1/query/metrics/example?start_time=example&end_time=example&granularity=hour'

Get aggregated metrics for a specific metric name.

Common metrics: count, unique_users, unique_sessions. Granularity accepts standard bucket sizes (minute through year, plus “all”); unknown values are rejected with a 400. Results are always bounded to the caller’s projects; an explicit project_id outside them reads as not found. A 503 means the analytics backend is temporarily unavailable.

metric_name
required
Metric Name
string
start_time
required
Start Time

ISO 8601 start time

string

ISO 8601 start time

end_time
required
End Time

ISO 8601 end time

string

ISO 8601 end time

granularity
Granularity

Time granularity

string
default: hour

Time granularity

platform
Platform

Filter by platform

string

Filter by platform

event_name
Event Name

Filter by event name

string

Filter by event name

project_id
Project Id

Filter by project

string

Filter by project

Successful Response

Media typeapplication/json
Response Get Metric Api V1 Query Metrics Metric Name Get
object
key
additional properties
any
Examplegenerated
{}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}