---
title: "Bucket by X, aggregate Y, within a scope"
method: POST
path: "/v1/analytics.getBivariate"
tags: ["analytics"]
---

# Bucket by X, aggregate Y, within a scope

`POST /v1/analytics.getBivariate`

## Request body

- AnalyticsGetBivariateRequestBody
  - `$schema` string, uri — A URL to the JSON Schema for this object.
  - `agg` 'avg' | 'median' | 'count', required — How to aggregate Y inside each X bucket.
  - `domain` string, required
  - `scope` string, required
  - `scope_value` string — Country name/code or region name. Required for non-global scopes.
  - `x` string, required — Metric ID for the X axis (bucketed).
  - `y` string, required — Metric ID for the Y axis (aggregated within each X bucket).

## Response `200`

OK

- AnalyticsBivariate
  - `$schema` string, uri — A URL to the JSON Schema for this object.
  - `buckets` AnalyticsBivariateBucket[], nullable, required
    - `count` integer, required
    - `x_bucket` number, double, required
    - `y_value` number, double, required

## Other responses

- `400` — Bad Request
- `422` — Unprocessable Entity
- `500` — Internal Server Error

---

[API](https://skmtc.net/steamsets/apis/steamsets-api.md) · [All operations](https://skmtc.net/steamsets/apis/steamsets-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/steamsets/steamsets-api/versions/593d89718daa/schema)
