---
title: "Get comparisons (Account Authorization)"
method: GET
path: "/api/v1/profile/insight/comparison/{externalId}"
tags: ["Insights"]
---

# Get comparisons (Account Authorization)

`GET /api/v1/profile/insight/comparison/{externalId}`

## Request

- Base URL: `https://api.sahha.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.sahha.ai/api/v1/profile/insight/comparison/{externalId}`
- Auth: API key in header `Authorization`

Gets comparison data for a profile with account authorization. Can be filtered by name, category, and date range.

## Path parameters

- `externalId` string, required

## Query parameters

- `startDateTime` string, date-time
- `endDateTime` string, date-time
- `name` string
- `category` string
- `periodicity` string
- `version` number, float

## Response `200`

Success

- ComparisonDto[]
  - `id` string, uuid: Unique identifier for the comparison.
  - `type` string: The type of the data structure, always 'comparison'.
  - `category` string: The category of the comparison, such as 'score', 'factor', or 'biomarker'.
  - `name` string: The name of the metric being compared.
  - `value` number, double: The current value of the metric being compared.
  - `unit` string: The unit of measurement for the values.
  - `isHigherBetter` boolean, nullable: Indicates if higher values are better for this comparison.
  - `startDateTime` string, date-time: The start datetime for the comparison period.
  - `endDateTime` string, date-time: The end datetime for the comparison period.
  - `periodicity` string: The time period the comparison represents, e.g., 'daily', 'weekly'.
  - `data` ComparisonDataPointDto[]: The collection of comparison data points.
    - `type` string: The type of comparison (e.g., 'demographic', 'global', 'baseline').
    - `value` number, double: The reference value for this comparison type.
    - `percentile` integer, nullable: The percentile ranking within the reference group, if applicable.
    - `difference` number, double: The absolute difference between the current value and this reference value.
    - `percentageDifference` number, double: The percentage difference between the current value and this reference value.
    - `state` string, nullable: A qualitative assessment of the comparison result (e.g., 'low', 'medium', 'high').
    - `properties` object: Additional properties specific to this comparison type.
  - `createdAtUtc` string, date-time: The UTC timestamp when this comparison was created.
  - `version` number, float: The version of the comparison algorithm used.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized

---

[API](https://skmtc.dev/sahha/apis/sahha-platform-v1.md) - [All operations](https://skmtc.dev/sahha/apis/sahha-platform-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/sahha/apis/sahha-platform-v1/revisions/c7f918b46707?raw)
