---
title: "One metric aggregated per country (or region) — worldmap source"
method: POST
path: "/v1/analytics.getMetricByScope"
tags: ["analytics"]
---

# One metric aggregated per country (or region) — worldmap source

`POST /v1/analytics.getMetricByScope`

## Request body

- AnalyticsGetMetricByScopeRequestBody
  - `$schema` string, uri — A URL to the JSON Schema for this object.
  - `agg` 'avg' | 'median' | 'count', required — Aggregation applied within each dimension bucket.
  - `dimension` 'country' | 'region', required — Group rows by this dimension. One bucket per distinct value.
  - `domain` string, required — Analytics domain ID. See analytics.listMetrics.
  - `metric` string, required — Metric ID within the domain.

## Response `200`

OK

- AnalyticsMetricByScope
  - `$schema` string, uri — A URL to the JSON Schema for this object.
  - `buckets` AnalyticsScopeBucket[], nullable, required
    - `count` integer, required — Sample size — accounts contributing to this bucket.
    - `countryCode` string — Country ISO alpha-2 code, e.g. "DE". Stable join key for map data.
    - `countryName` string — Country name, e.g. "Germany"
    - `region` string — Region name, e.g. "Europe"
    - `value` number, double, required — The metric's aggregated value for this bucket.

## 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/2e8ba266b27f/schema)
