Returns one series per kind and distinct label combination, each with one point per window. Points within a series are ordered oldest first, and series are ordered stably, so a client diffing two responses does not see them shuffle.
Results are always scoped to the tenant owning the credential. There is no parameter for selecting a tenant, by design.
The range is half-open [from, to) on window starts. Matching rows return whole committed window totals, including partial windows and later corrections. This is not filtering individual raw observations. Default limits are 8,784 hours, 500 series and 50,000 points. Series/point limits return truncated=true; an 8 MiB materialized-read budget returns 422.
Windows older than the deployment's full-resolution retention (30 days by default) are kept as hourly totals for a year, so a range reaching back that far returns hourly points for its older part. Use a step of an hour or more for an even series across both.
Base URL
These addresses are for local development. Replace them with your own deployed service URLs.
http://localhost:8082 Local query API; replace with the deployed query URL.
Request example
Replace credential and batch-key placeholders before running. JavaScript examples use Node.js 24; Python examples use the standard library. Browser clients need a same-origin proxy or suitable CORS configuration. See safe retries for production retry handling.
curl --request GET 'http://localhost:8082/v1/query?metric=http.requests&from=-15m&agg=sum' \
--header 'Authorization: Bearer <YOUR_API_KEY>'const response = await fetch("http://localhost:8082/v1/query?metric=http.requests&from=-15m&agg=sum", {
method: "GET",
headers: {
"Authorization": "Bearer <YOUR_API_KEY>"
}
});
if (!response.ok) throw new Error(await response.text());
const result = await response.json();
console.log(result);import json
from urllib.request import Request, urlopen
request = Request(
"http://localhost:8082/v1/query?metric=http.requests&from=-15m&agg=sum",
method="GET",
headers={
"Authorization": "Bearer <YOUR_API_KEY>"
}
)
with urlopen(request, timeout=30) as response:
result = json.load(response)
print(result)Authentication
An API key in the form fxg_<key id>_<secret>, sent as
Authorization: Bearer fxg_....
The server stores only a SHA-256 digest of the secret. Every authentication failure returns an identical 401 regardless of cause, so a probing client cannot use the response to tell a valid key ID from an invalid one.
Credentials select the tenant. See tenant provisioning and key rotation.
Parameters
metricquery · stringrequiredExample: http.request.duration_ms
fromquery · stringoptionalRFC 3339, or a negative duration relative to to such as -15m.
Defaults to one hour before to.
Example: -15m
toquery · stringoptionalRFC 3339, or a negative duration relative to now. Defaults to now.
aggquery · stringoptionalWhich statistic to read from each window. The percentiles are estimated from stored histogram buckets and are only available for histogram metrics; asking for one of a gauge or counter returns an empty series and a warning rather than a fabricated zero.
avg"sum" "count" "avg" "min" "max" "last" "p50" "p90" "p95" "p99"label.*query · stringoptionalRestricts results to series carrying all the given labels, e.g.
label.service=checkout&label.status=500. The prefix exists so a
label can never collide with this API's own parameters -- a metric
labelled agg would otherwise be unqueryable.
stepquery · stringoptionalWidth of each returned point: a duration such as 5m or 1h
(whole seconds, at most 24h), or auto. Omit it to read stored
windows as they are.
Stored windows are merged into buckets inside the database: counts
and sums add, minimum and maximum take the extreme, last is the
value with the latest event, and histograms add bucket by bucket,
so percentiles over a bucket are computed from all of its
observations. Buckets are multiples of the step since the Unix
epoch, so they do not move when a chart pans, and the range is
widened outward to whole buckets so neither edge reports a partial
total. auto chooses the finest of 1m, 2m, 5m, 10m, 15m, 30m, 1h,
2h, 3h, 6h, 12h and 24h that keeps a series at or under 720 points.
Use a step that is a multiple of the stored window size (one minute by default). Otherwise each window is counted in the bucket containing its start, and the response carries a warning saying so.
Responses
Expand a response to inspect its headers and complete schema.
200The matching series.
The matching series.
application/json
QueryResult ↗metricstringrequiredkindstringoptional"gauge" "counter" "histogram" "mixed"aggregationstringrequiredfromstringrequiredThe resolved start of the range, so a caller can see what a relative range meant.
date-timetostringrequireddate-timestepstringoptionalThe width of each point when the query merged stored windows,
including the width step=auto chose. Absent when stored windows
were returned as they are. Points are bucket starts.
seriesQuerySeries[]requiredArray items · QuerySeries
QuerySeries ↗Object properties
kindstringrequired"gauge" "counter" "histogram"labelsobjectrequiredAdditional values · string
pointsobject[]requiredArray items · object
Object properties
tstringrequiredThe window start.
date-timevnumberrequiredtruncatedbooleanoptionalTrue when a limit cut the response short, so a caller can tell an incomplete answer from an empty one.
warningsstring[]optionalFacts a caller needs that are not errors, such as a percentile requested of a metric that has no histogram.
Array items · string
Illustrative response
Values are examples; they are not a response from a hosted Fluxgate service.
{
"metric": "http.requests",
"kind": "counter",
"aggregation": "sum",
"from": "2026-10-02T12:00:00Z",
"to": "2026-10-02T12:15:00Z",
"series": [
{
"kind": "counter",
"labels": {
"service": "checkout"
},
"points": [
{
"t": "2026-10-02T12:00:00Z",
"v": 42
}
]
}
],
"truncated": false
}401Missing or invalid credentials.
Missing or invalid credentials.
Response headers
WWW-AuthenticatestringThe Bearer challenge.
application/problem+json
Problem ↗typestringrequiredurititlestringrequiredstatusintegerrequireddetailstringoptionalHuman-readable explanation. Do not branch on this.
codestringrequiredStable machine-readable identifier. Branch on this.
"bad_request" "validation_failed" "unauthorized" "forbidden" "not_found" "method_not_allowed" "conflict" "payload_too_large" "unsupported_media_type" "rate_limited" "timeout" "service_unavailable" "internal_error"request_idstringoptionalerrorsFieldError[]optionalArray items · FieldError
FieldError ↗Object properties
fieldstringrequiredDotted path to the offending value, including the batch index.
messagestringrequiredWhat the submitter must change.
422A parameter was invalid or the read exceeded its byte budget. For an oversized result, use a coarser step (step=auto), narrow the time range, or add label filters.
A parameter was invalid or the read exceeded its byte budget. For an oversized result, use a coarser step (step=auto), narrow the time range, or add label filters.
Response headers
X-Request-IdstringCorrelation ID, echoed on every response. Quote it when reporting a problem.
application/problem+json
Problem ↗typestringrequiredurititlestringrequiredstatusintegerrequireddetailstringoptionalHuman-readable explanation. Do not branch on this.
codestringrequiredStable machine-readable identifier. Branch on this.
"bad_request" "validation_failed" "unauthorized" "forbidden" "not_found" "method_not_allowed" "conflict" "payload_too_large" "unsupported_media_type" "rate_limited" "timeout" "service_unavailable" "internal_error"request_idstringoptionalerrorsFieldError[]optionalArray items · FieldError
FieldError ↗Object properties
fieldstringrequiredDotted path to the offending value, including the batch index.
messagestringrequiredWhat the submitter must change.
500An RFC 9457 problem document.
An RFC 9457 problem document.
Response headers
X-Request-IdstringCorrelation ID, echoed on every response. Quote it when reporting a problem.
application/problem+json
Problem ↗typestringrequiredurititlestringrequiredstatusintegerrequireddetailstringoptionalHuman-readable explanation. Do not branch on this.
codestringrequiredStable machine-readable identifier. Branch on this.
"bad_request" "validation_failed" "unauthorized" "forbidden" "not_found" "method_not_allowed" "conflict" "payload_too_large" "unsupported_media_type" "rate_limited" "timeout" "service_unavailable" "internal_error"request_idstringoptionalerrorsFieldError[]optionalArray items · FieldError
FieldError ↗Object properties
fieldstringrequiredDotted path to the offending value, including the batch index.
messagestringrequiredWhat the submitter must change.
503Capacity exhausted; respect Retry-After before retrying.
Capacity exhausted; respect Retry-After before retrying.
Response headers
X-Request-IdstringCorrelation ID, echoed on every response. Quote it when reporting a problem.
application/problem+json
Problem ↗typestringrequiredurititlestringrequiredstatusintegerrequireddetailstringoptionalHuman-readable explanation. Do not branch on this.
codestringrequiredStable machine-readable identifier. Branch on this.
"bad_request" "validation_failed" "unauthorized" "forbidden" "not_found" "method_not_allowed" "conflict" "payload_too_large" "unsupported_media_type" "rate_limited" "timeout" "service_unavailable" "internal_error"request_idstringoptionalerrorsFieldError[]optionalArray items · FieldError
FieldError ↗Object properties
fieldstringrequiredDotted path to the offending value, including the batch index.
messagestringrequiredWhat the submitter must change.
504The query exceeded its processing deadline.
The query exceeded its processing deadline.
Response headers
X-Request-IdstringCorrelation ID, echoed on every response. Quote it when reporting a problem.
application/problem+json
Problem ↗typestringrequiredurititlestringrequiredstatusintegerrequireddetailstringoptionalHuman-readable explanation. Do not branch on this.
codestringrequiredStable machine-readable identifier. Branch on this.
"bad_request" "validation_failed" "unauthorized" "forbidden" "not_found" "method_not_allowed" "conflict" "payload_too_large" "unsupported_media_type" "rate_limited" "timeout" "service_unavailable" "internal_error"request_idstringoptionalerrorsFieldError[]optionalArray items · FieldError
FieldError ↗Object properties
fieldstringrequiredDotted path to the offending value, including the batch index.
messagestringrequiredWhat the submitter must change.