---
title: "Estimate home altitude from where the athlete is"
method: POST
path: "/profile/home-altitude/estimate"
tags: ["Profile"]
---

# Estimate home altitude from where the athlete is

`POST /profile/home-altitude/estimate`

## Request

- Base URL: `https://bodylab.lol/api/v1`
- URL: `https://bodylab.lol/api/v1/profile/home-altitude/estimate`
- Auth: HTTP bearer

For filling in home altitude, including on an account with nothing to compare against yet. The location is used for this request only and is never stored or logged, and nothing is saved: send the altitude with PATCH /profile, as a typed-in value, once the athlete accepts it. Estimates are rationed per athlete.

## Headers

- `X-Client-Platform` string
- `X-Client-Version` string

## Request body

- object
  - `location` object, required
    - `latitude` number, required
    - `longitude` number, required
    - `horizontalAccuracyM` number, required: How far off the position may be, metres (Core Location's horizontalAccuracy, the Geolocation API's accuracy).
    - `altitudeM` number, nullable: The device's measured altitude, metres above sea level, if it gave one.
    - `verticalAccuracyM` number, nullable: Core Location's verticalAccuracy; zero or negative marks the altitude invalid.
    - `locatedBy` 'device' | 'browser', required

## Response `200`

OK

- object
  - `outcome` string, required: estimated: an altitude was worked out (see estimate). no_elevation: none could be found for the location. too_coarse: the location is too rough to say. no_location: there was no location to work from. Known values: estimated, no_elevation, too_coarse, no_location. Treat unknown values as "other".
  - `estimate` object, nullable, required: Null unless the outcome is estimated.
    - `altitudeM` integer, required: The best single altitude, metres, rounded to 10, within the profile's home altitude bounds.
    - `lowM` integer, required: The lowest altitude the athlete could plausibly be at, given how rough the location is.
    - `highM` integer, required: The highest.
    - `source` string, required: How the altitude was worked out: device_altitude (the phone measured it), recordings (the athlete's own activities that started near where they are), elevation_data (a terrain model at their rough location), entered (typed in). Known values: device_altitude, recordings, elevation_data, entered. Treat unknown values as "other".

## Other responses

- `401`: Error: UNAUTHORIZED.
- `429`: Error: TOO_MANY_ESTIMATES.

---

[API](https://skmtc.dev/bodylab/apis/body-lab-api.md) · [All operations](https://skmtc.dev/bodylab/apis/body-lab-api/llms.txt) · [OpenAPI document](https://skmtc.dev/bodylab/apis/body-lab-api/revisions/544c201eaf88?raw)
