# \*/current, location data

### Request

**URL** `https://racemap.com/api/data/v1/:eventId/current` \
**Method** GET

**Live sample** <https://racemap.com/api/data/v1/66bf4318d1c783279d183dd3/current>\
Corresponding map <https://racemap.com/player/100KmDuathlon2018_API-live-sample>

#### Optional query parameters

Specify the query parameters when calling the API endpoint, e.g. to smoothen gap values.

{% tabs %}
{% tab title="participantId" %}
The <kbd>`participantId`</kbd> of a specified reference participant for the calculation of `gapAverage`, `gap`, `gapChase,` `gapDistance`, `gapAverageEx`, `gapEx`, `gapChaseEx` and `gapDistanceEx`.

* String for API <mark style="background-color:red;">**?**</mark>**participantId=66bf4318d1c783279d183e3d**
* Sample <https://racemap.com/api/data/v1/66bf4318d1c783279d183dd3/current?participantId=66bf4318d1c783279d183e3d>
* `starterId` and `refStarterId` can be used as aliases.
  {% endtab %}

{% tab title="startNumber" %}
The `startNumber` of a specified reference device for the calculation of `gapAverage`, `gap`, `gapChase` and `gapDistance`.

* String for API <mark style="background-color:red;">**?**</mark>**startNumber=053**
* Sample: [https://racemap.com/api/data/v1/66bf4318d1c783279d183dd3/current<mark style="background-color:red;">**?**</mark>**startNumber=053**](https://racemap.com/api/data/v1/66bf4318d1c783279d183dd3/current?startNumber=053)
  {% endtab %}

{% tab title="avgSpeedWindow" %}
Duration \[seconds] for the calculation of the average `speed` and `speedRaw` values.&#x20;

* `avgSpeedWindow` defines how far back in time the API looks from the latest known coordinate at the specified [`resultTime`](#resulttime). The other coordinate at the other side of the window is interpolated between recorded coordinates.
* If `avgSpeedWindow` is set to 120, the API calculates speed values based on the distance covered during the last 2 minutes.
* Default: 300
* Maximum: 1800
* String for API <mark style="background-color:red;">**?**</mark>**avgSpeedWindow=120**
* Sample <https://racemap.com/api/data/v1/66bf4318d1c783279d183dd3/current?avgSpeedWindow=120>
* `avgSpeedWindow` replaces the previous `currentSpeedDuration` parameter, which is supported for backward compatibility.
  {% endtab %}

{% tab title="resultTime" %}
UTC timestamp that defines the reference time for the API response.

* If `resultTime` is not provided, the API uses the current request time as default.
* The `resultTime` parameter allows you to call API data for any point in time in the past and future.
* Geodata with timestamps newer than `resultTime` are ignored from the response.  &#x20;
* String for API <mark style="background-color:red;">**?**</mark>**resultTime=2026-03-25T20:17:20.000Z**
* Sample <https://racemap.com/api/data/v1/66bf4318d1c783279d183dd3/current?resultTime=2026-03-25T20%3A17%3A20.000Z>
  {% endtab %}
  {% endtabs %}

You can call the same API endpoint with different query parameters at the same time. \
You can also combine parameters with <mark style="background-color:red;">**&**</mark> in one call eg. [https://racemap.com/api/data/v1/66bf4318d1c783279d183dd3/current?avgSpeedWindow=600<mark style="background-color:$danger;">**&**</mark>participantId=66bf4318d1c783279d183e3d](https://racemap.com/api/data/v1/66bf4318d1c783279d183dd3/current?avgSpeedWindow=600\&participantId=66bf4318d1c783279d183e3d)

### Response

#### Event object

<table><thead><tr><th width="190">Field</th><th width="499.59991455078125">Description [unit]</th><th>Sample</th><th data-hidden>line</th><th data-hidden></th></tr></thead><tbody><tr><td><code>name</code></td><td>Name of event</td><td><code>"100km Duathlon"</code></td><td>2</td><td></td></tr><tr><td><code>location</code></td><td>Location</td><td><code>"Dresden"</code></td><td>3</td><td></td></tr><tr><td><code>startTime</code></td><td>Start time in UTC</td><td><code>"2022-01-24T15:00:10.000Z"</code></td><td>4</td><td></td></tr><tr><td><code>endTime</code></td><td>End time in UTC</td><td><code>"2022-01-24T22:59:45.000Z"</code></td><td>5</td><td></td></tr><tr><td><code>resultTime</code></td><td>UTC timestamp for which you retrieve API data.</td><td><code>"2022-01-24T20:00:10.000Z"</code></td><td></td><td></td></tr><tr><td><code>starters</code></td><td>Array for participant objects </td><td></td><td></td><td></td></tr><tr><td><code>shadowTrackUrl</code></td><td>URL to download the <a href="/pages/c4cBCt9aXT8vj2RRgUgs">shadowtrack</a> as a geojson file </td><td></td><td></td><td></td></tr></tbody></table>

#### Participant object

<table><thead><tr><th width="189.71594043022614">Field</th><th width="500.2164627541642">Description [unit]</th><th>Sample</th><th data-hidden>line</th></tr></thead><tbody><tr><td><code>id</code></td><td>Unique RACEMAP ID of the participant</td><td><code>"61a2122f181c0a0ff7b53765"</code></td><td>10</td></tr><tr><td><code>name</code>*</td><td>Name</td><td><code>"CLV Megware"</code></td><td>12</td></tr><tr><td><code>startNumber</code>*</td><td>Bib number</td><td><code>"001"</code></td><td>11</td></tr><tr><td><code>markerColor</code>*</td><td>Color of dot in tracking map, hex code</td><td><code>"#ffffff"</code></td><td></td></tr><tr><td><code>tags</code>*</td><td>Object with optional attributes to filter participants eg. age group or nation, format <code>"tag": "value"</code></td><td><code>"age": "40", "sex": "male"</code></td><td></td></tr><tr><td><code>importId</code></td><td>User-defined ID with imported participant data, <a href="/pages/-LTq5TdE6GKt2S6dgesz">Generic API</a> (<code>importId</code>) or <a href="/pages/-LTh-oAm96bieBZVeffZ">RACE|RESULT API</a> (<code>Id</code>)</td><td><code>"UniqueImportId_1"</code> or <code>null</code> if no importId exists</td><td></td></tr><tr><td><code>current</code></td><td>Object for real-time location data and gap measurements and extrapolations</td><td>Inner values are <code>null</code> if no locations within <code>startTime</code> and <code>endTime</code> are known</td><td></td></tr><tr><td><code>device</code></td><td>Object for device information</td><td><code>null</code> if device is not used in tracker management</td><td></td></tr></tbody></table>

\*The parameter is imported or synchronized with RACEMAP from an external source.

#### Current object

* `current`-object provides the latest data for the specified [`resultTime`](#resulttime) parameter.
* (\*) These parameters are calculated only for events with a [shadowtrack](/live-tracking/shadowtrack.md#shadowtrack) and a [mapping of the geolocation](/live-tracking/shadowtrack.md#what-is-mapping) on the shadowtrack. The default `max mapping distance` is `100 m` and can be changed in the Advanced Settings of the event. If the geolocation can not be mapped the corresponding (\*) parameters are `null`.&#x20;
* `gapDistance`, `gap`, `gapChase`, `gapAverage`, `gapDistanceEx`, `gapEx`, `gapChaseEx` and `gapAverageEx` are calculated for the leader by default. \
  **Leader:** The device with the smallest `toFinish` value at `resultTime`. \
  **Attention:** Each time a leader reaches the finish, the next device closest to the finish becomes the new leader. In this moment, the speed value of the next leader may impact fluctuating gap values.\
  **Reference:** Query with [`participantId`](#participantid) or [`startNumber`](#startnumber) for calculation against the reference participant instead of the leader.

<figure><img src="/files/zG1SeKXPvOid1adwXwJ1" alt=""><figcaption><p>Recorded geolocations for two GPS devices. The geolocations are mapped on the shadowtrack (offset) over the time.</p></figcaption></figure>

<table data-full-width="false"><thead><tr><th width="208.2000732421875">Field</th><th width="500.199951171875">Description [unit]</th><th>Sample</th><th data-hidden>line</th><th data-hidden></th></tr></thead><tbody><tr><td></td><td><strong><code>lat</code>/<code>lng</code>:</strong> <br><strong>Coordinate of the latest recorded geolocation.</strong></td><td></td><td></td><td></td></tr><tr><td><code>time</code></td><td>UTC timestamp when the latest geolocation was recorded.</td><td><code>"2022-01-24T16:33:47.012Z"</code></td><td>14</td><td></td></tr><tr><td><code>lng</code></td><td>Longitude of the latest recorded geolocation.</td><td><code>13.727678288</code></td><td>15</td><td></td></tr><tr><td><code>lat</code></td><td>Latitude of the latest recorded geolocation.</td><td><code>50.976534023</code></td><td>16</td><td></td></tr><tr><td><code>speedRaw</code></td><td><p>Average speed [m/s]. <br>distance: straight line between two coordinates <br>time: <code>avgSpeedWindow</code></p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Curves are cut between the two geolocations. </p></div></td><td><code>4.9574</code></td><td></td><td></td></tr><tr><td><code>distanceToShadowTrack</code></td><td>Shortest distance [m] between <code>lat</code>/<code>lng</code> and the shadowtrack. </td><td><code>175.9</code></td><td>22</td><td></td></tr><tr><td></td><td><strong><code>lngSt</code>/<code>latSt</code>:</strong> <br><a href="/pages/c4cBCt9aXT8vj2RRgUgs#what-is-mapping"><strong>Mapping</strong></a> <strong>of the latest recorded geolocation (<code>lat</code>/<code>lng</code>) on the shadowtrack.</strong></td><td></td><td></td><td></td></tr><tr><td><code>lngSt</code> *</td><td>Longitude of the latest recorded geolocation mapped on the shadowtrack.</td><td><code>13.805551232</code> or <code>null</code> </td><td></td><td></td></tr><tr><td><code>latSt</code> *</td><td>Latitude of the latest recorded geolocation mapped on the shadowtrack.</td><td><code>50.93151590</code> or <code>null</code></td><td></td><td></td></tr><tr><td><code>speed</code> *</td><td>Average speed [m/s] <br>distance: segment of the shadowtrack <br>time: <code>avgSpeedWindow</code></td><td><code>5.2727</code> or <code>null</code></td><td>21</td><td></td></tr><tr><td><code>elvSt</code> *</td><td>Altitude [m] above zero of <code>lngSt</code>/<code>latSt</code>.</td><td><code>85.2</code> or <code>null</code> <br>if device is not on shadowtrack</td><td>17</td><td></td></tr><tr><td><code>fromStart</code> *</td><td>Distance [m] from the start point of the shadowtrack along the track to <code>latSt</code>/<code>lngSt</code>. </td><td><code>9962.6826</code> or <code>null</code></td><td>18</td><td></td></tr><tr><td><code>toFinish</code> *</td><td>Distance [m] from <code>latSt</code>/<code>lngSt</code> along the shadowtrack to the end point of the track.</td><td><code>89097.3173</code> or <code>null</code></td><td>19</td><td></td></tr><tr><td><code>eta</code> *</td><td>Estimated time of arrival [s], duration to move from <code>latSt</code>/<code>lngSt</code> to the end point of the shadowtrack, extrapolation with <code>speed</code>.</td><td><code>16897.77</code> or <code>null</code></td><td>20</td><td></td></tr><tr><td><code>gapCalcTime</code> *</td><td><p>UTC timestamp for which <code>gapDistance</code>, <code>gap</code>, <code>gapChase</code> and <code>gapAverage</code> is obtained. Value is older (or equal) than <code>resultTime</code>. </p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Q: What is the latest UTC timestamp (at the specified <code>resultTime</code>) for which the API knows recorded geolocations?</p></div></td><td><code>"2022-01-24T16:32:30.012Z"</code> or  <code>null</code></td><td></td><td></td></tr><tr><td><code>gapDistance</code> *</td><td><p>Distance [m] between <code>latSt</code>/<code>lngSt</code> and the <code>toFinish</code> value of the leader.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Q: What is the current distance between chaser and leader?</p></div></td><td><code>null</code> or <code>3364.91</code> or <code>-554.03</code> if reference is behind device</td><td></td><td></td></tr><tr><td><code>gap</code> *</td><td><p>Duration [s] to move from <code>latSt</code>/<code>lngSt</code> along the shadowtrack to the <code>toFinish</code> value of the leader, calculated with the <code>speed</code> value of the leader. </p><p>If <code>speed of leader &#x3C; 1 km/h</code> than calculation with the default speed value of the event. </p></td><td><code>null</code> or <code>1205.68</code> or <code>-581.20</code>  if reference is behind device</td><td>23</td><td></td></tr><tr><td><code>gapChase</code> *</td><td><p>Duration [s] to move from <code>latSt</code>/<code>lngSt</code> along the shadowtrack to the <code>toFinish</code> value of the leader, calculated with the <code>speed</code> value of the chaser. </p><p>If <code>speed of chaser &#x3C; 1 km/h</code> than calculation with the default speed value of the event.</p></td><td><code>null</code> or <code>968.81</code> or <code>-73.02</code> if reference is behind device</td><td></td><td></td></tr><tr><td><code>gapAverage</code> *</td><td><p>Duration [s] to move from <code>latSt</code>/<code>lngSt</code> to the <code>toFinish</code> value of the leader, calculated with the timestamp of when the leader was at <code>latSt</code>/<code>lngSt</code>. </p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Q: How long did it take the leader to cover the distance <code>gapDistance</code>?</p></div></td><td><code>null</code> or <code>2360.36</code> or <code>-112.6</code> if reference is behind device</td><td></td><td></td></tr><tr><td></td><td> <strong><code>lngStEx</code>/<code>latStEx</code>:</strong> <br><a href="/pages/c4cBCt9aXT8vj2RRgUgs#what-is-mapping"><strong>Mapping</strong></a> <strong>of the latest recorded geolocation (<code>lat</code>/<code>lng</code>) on the shadowtrack (<code>lngSt</code>/<code>latSt</code>), further extrapolation on the track to the point in time of <code>resultTime</code> with the <code>speed</code> value.</strong></td><td></td><td></td><td></td></tr><tr><td><code>lngStEx</code> *</td><td>Longitude of the latest recorded geolocation mapped on the shadowtrack and extrapolated to <code>resultTime</code>.</td><td><code>5.2727</code> or <code>13.805551232</code> or <code>null</code> </td><td></td><td></td></tr><tr><td><code>latStEx</code> *</td><td>Latitude of the latest recorded geolocation mapped on the shadowtrack and extrapolated to <code>resultTime</code>.</td><td><code>50.93151590</code> or <code>null</code></td><td></td><td></td></tr><tr><td><code>fromStartEx</code> *</td><td>Distance [m] from the start point of shadowtrack along the track to <code>lngStEx</code>/<code>latStEx</code>.</td><td><code>9963.6826</code> or <code>null</code></td><td></td><td></td></tr><tr><td><code>toFinishEx</code> *</td><td>Distance [m] from <code>lngStEx</code>/<code>latStEx</code> along the shadowtrack to the end point of the track. </td><td><code>890967.3173</code> or <code>null</code></td><td></td><td></td></tr><tr><td><code>gapDistanceEx</code> *</td><td>Distance [m] from <code>lngStEx</code>/<code>latStEx</code> along the shadowtrack to reach the <code>toFinishEx</code> value of the leader.</td><td><code>null</code> or <code>3374.91</code> or <code>-564.03</code> if reference is behind device</td><td></td><td></td></tr><tr><td><code>gapEx</code> *</td><td><p>Duration [s] to move from <code>lngStEx</code>/<code>latStEx</code> along the shadowtrack to the <code>toFinishEx</code> value of the leader, calculated with the <code>speed</code> value of the leader. </p><p>If <code>speed of leader &#x3C; 1 km/h</code> than the default speed value of the event is used. </p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Q: How long does it take the leader to move backward with his current speed until he reaches the chaser's location?</p></div></td><td><code>null</code> or <code>1305.68</code> or <code>-591.20</code>  if reference is behind device</td><td></td><td></td></tr><tr><td><code>gapChaseEx</code> *</td><td><p>Duration [s] to move from <code>lngStEx</code>/<code>latStEx</code> along the shadowtrack to the <code>toFinishEx</code> value of the leader, calculated with the <code>speed</code> value of the chaser. </p><p>If <code>speed of device &#x3C; 1 km/h</code> than the default speed value of the event is used.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Q: How long does it take for the chaser with his current speed to reach the leader's location?</p></div></td><td><code>null</code> or <code>978.81</code> or <code>-93.02</code> if reference is behind device</td><td></td><td></td></tr><tr><td><code>gapAverageEx</code> *</td><td><p>Duration [s] to move from <code>lngStEx</code>/<code>latStEx</code> along the shadowtrack to the <code>toFinishEx</code> value of the leader, calculated with the timestamp of when the leader was at the same offset on the track. </p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Q: How long did it take the leader to cover the distance <code>gapDistanceEx</code>? </p></div></td><td><code>null</code> or <code>2560.36</code> or <code>-132.6</code> if reference is behind device</td><td></td><td></td></tr></tbody></table>

#### Device object

The device object provides additional information for those GPS trackers, that are used in the [tracker management](/tracker-management.md).

<table><thead><tr><th width="229">Field</th><th width="260">Description [unit]</th><th>Sample</th></tr></thead><tbody><tr><td><code>externalId</code></td><td>Unique id of tracking device, can be IMEI or transponder id or App id depending on the type of device.</td><td><code>"4106050246"</code> or <code>"860599002489748"</code> or <code>"RRPing_ZDKAR32"</code> or <code>"d40ad78e-b929-4224-967e-62ca93effc68"</code></td></tr><tr><td><code>battery</code></td><td>Charge level [%] of device.</td><td><code>3</code>, <code>52</code>, <code>99</code></td></tr><tr><td><code>online</code></td><td>Connection status with RACEMAP server, determined by checking if there is a socket connection to the device and evaluating the time since the last message was received. </td><td><code>true</code> or <code>false</code></td></tr><tr><td><code>isMoving</code></td><td>Shows wether a device is moving or not. Only valid if a device is online.</td><td><code>true</code> or <code>false</code></td></tr><tr><td><code>lastLocationGpsFix</code></td><td>Showing whether the device had a GPS fix when recording the latest coordinate.</td><td><code>true</code> or <code>false</code></td></tr><tr><td><code>lastLocationAt</code></td><td>Timestamp in UTC when the latest coordinate was recorded. Note: If <code>interpolation=true</code> <code>lastLocationAt</code> can differ from <code>time</code>.</td><td><code>"2022-01-24T16:33:47.012Z"</code></td></tr><tr><td><code>deviceId</code></td><td>Unique id of the tracking device in RACEMAP.</td><td><code>"5b6ac1561c6a700020a00010"</code></td></tr></tbody></table>

The GPS tracker does not send the information when it loses the GPS fix. If the device loses the fix, no coordinates are recorded. Therefore, evaluating `online` status along with `lastLocationAt` provides a more reliable observation than relying solely on the `lastLocationGpsFix` parameter.

If `online` is `true` but there is no current `lastLocationAt`:&#x20;

* Device may have lost its GPS fix and is unable to record coordinates.&#x20;
* Could suggest potential tampering or manipulation, also.

If `online` is `false`:&#x20;

* Device may have lost its network connection.&#x20;
* Device may have been turned off, also.

#### Sample response// Some code

{% code expandable="true" %}

```javascript
{
  "name": "Sample live API | 100km-Duathlon",
  "location": "🇩🇪 Dresden",
  "startTime": "2026-04-27T14:50:43Z",
  "endTime": "2026-04-27T18:50:07Z",
  "resultTime": "2026-04-27T15:16:37.863314808Z",
  "shadowTrackUrl": "https://racemap.com/api/events/66bf4318d1c783279d183dd3/geo/shadow.json",
  "starters": [
    {
      "id": "66bf4318d1c783279d183e33",
      "name": "Der Weg ist das Ziel e.V.",
      "startNumber": "049",
      "tags": {
        "Age": "30",
        "Class": "Women"
      },
      "markerColor": "#f714f4",
      "importId": null,
      "current": {
        "time": "2026-04-27T15:16:35.783Z",
        "lat": 51.01205,
        "lng": 13.72667,
        "elv": 172,
        "speedRaw": 2.58,
        "lngSt": 13.726713,
        "latSt": 51.012091,
        "distanceToShadowTrack": 5.45,
        "speed": 3.37,
        "eta": 28081,
        "fromStart": 4520,
        "toFinish": 94540,
        "gapCalcTime": "2026-04-27T15:16:35.783Z",
        "gapDistance": 1310,
        "gap": 367,
        "gapChase": 389,
        "gapAverage": 487,
        "fromStartEx": 4527,
        "toFinishEx": 94533,
        "gapDistanceEx": 1310.42,
        "gapEx": 367,
        "gapChaseEx": 389,
        "gapAverageEx": 489
      },
      "device": {
        "externalId": "37727c2a-40a0-4752-9e50-7ba5bffecd9a",
        "battery": 20,
        "online": false,
        "lastLocationGpsFix": true,
        "lastLocationAt": "2024-01-05T13:45:19Z",
        "deviceId": "5b6ac1561c6a700020a00142",
        "isMoving": null
      }
    },
    {
      "id": "66bf4318d1c783279d183e2f",
      "name": "SG Turbine Gottleubatal",
      "startNumber": "046",
      "tags": {
        "Age": "35",
        "Class": "Mixed"
      },
      "markerColor": "#f7f7f7",
      "importId": null,
      "current": {
        "time": "2026-04-27T15:16:35.783Z",
        "lat": 51.00963,
        "lng": 13.72327,
        "elv": 192,
        "speedRaw": 3.45,
        "lngSt": 13.723207,
        "latSt": 51.00963,
        "distanceToShadowTrack": 4.42,
        "speed": 4.23,
        "eta": 22419,
        "fromStart": 4150,
        "toFinish": 94910,
        "gapCalcTime": "2026-04-27T15:16:35.783Z",
        "gapDistance": 1680,
        "gap": 471,
        "gapChase": 396,
        "gapAverage": 533,
        "fromStartEx": 4158.81,
        "toFinishEx": 94901.19,
        "gapDistanceEx": 1678.61,
        "gapEx": 470,
        "gapChaseEx": 396,
        "gapAverageEx": 533
      },
      "device": null
    },
    {
      "id": "66bf4318d1c783279d183e51",
      "name": "Dude, where's the finish line?",
      "startNumber": "039",
      "tags": {
        "Age": "25",
        "Class": "Mixed",
        "Status": "DSQ"
      },
      "markerColor": "#f7f7f7",
      "importId": null,
      "current": {
        "time": "2026-04-27T15:16:27.013Z",
        "lat": 51.01788,
        "lng": 13.69662,
        "elv": 212,
        "speedRaw": 2.96,
        "lngSt": 13.696588,
        "latSt": 51.017801,
        "distanceToShadowTrack": 9.01,
        "speed": 3.27,
        "eta": 29905,
        "fromStart": 1370,
        "toFinish": 97690,
        "gapCalcTime": "2026-04-27T15:16:27.013Z",
        "gapDistance": 4428.72,
        "gap": 1241,
        "gapChase": 1355,
        "gapAverage": 1347,
        "fromStartEx": 1405.44,
        "toFinishEx": 97654.56,
        "gapDistanceEx": 4431.98,
        "gapEx": 1242,
        "gapChaseEx": 1356,
        "gapAverageEx": 1340
      },
      "device": {
        "externalId": "999994106050526",
        "battery": 40,
        "online": false,
        "lastLocationGpsFix": true,
        "lastLocationAt": "2023-07-02T12:37:51Z",
        "deviceId": "5b3a7b3ebd61c4491dcfcef4",
        "isMoving": true
      }
    }
  ]
}
```

{% endcode %}

### Speed calculations

Speeds can vary significantly in dense datasets, mainly because of GPS position inaccuracies. To reduce these fluctuations, you can use the `avgSpeedWindow` parameter to smooth the speed curve. The figure below illustrates the effect of `avgSpeedWindow` on both dense and sparse datasets.

Increase the `avgSpeedWindow` query parameter to smooth the `speed` values in the API more.

<figure><img src="/files/RwOiSgPmrpVppEXRcWlw" alt=""><figcaption></figcaption></figure>

### How gaps are calculated

There are 3 types of gaps provided. Each gap is a duration in seconds. You can frame it as answer to the question: How long does it take to get there?

* Gap & GapEx - calculated with last known speed of the leader&#x20;
* GapChase & GapChaseEx - calculated with last known speed of the chaser
* GapAverage & GapAverageEx - calculated with averge speed of the leader

<figure><img src="/files/ckEHJuK3qsailC54j60p" alt=""><figcaption><p>the average speed of the reference device smoothens the <code>gapAverage</code> values in the API</p></figcaption></figure>

### Subsequent calculations&#x20;

You can calculate on your side using the \*/current API.

**Gap distance** between two participants: `fromStart` (participant 1) - `fromStart` (participant 2)

**Gap duration** between two participants:

* option 1: `gapAverage` (participant 2) - `gapAverage` (participant 1) => value with flatten peaks
* option 2: `eta` (participant 2) - `eta` (participant 1)
* option 3: `gap` (participant 2) - `gap` (participant 1)&#x20;

**Identify the leader**: the smallest value of `toFinish`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.racemap.com/api/current.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
