> For the complete documentation index, see [llms.txt](https://docs.racemap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.racemap.com/api/current.md). Agents can also search and read this documentation through its [MCP server](https://docs.racemap.com/~gitbook/mcp).

# \*/current, location data

API with real-time geolocation data, for TV graphics, speed monitor, gap time calculation, or any other applications and dashboards.

Real-time locations, speeds and gaps of all participants of an event.

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

{% hint style="info" %}

* You can call the endpoint with different query parameters at the same time.
* Combine query parameters with `&` in one call, e.g. <https://racemap.com/api/data/v1/66bf4318d1c783279d183dd3/current?avgSpeedWindow=600&participantId=66bf4318d1c783279d183e3d>
  {% endhint %}

### Reference

## Current locations, speeds and gaps

> Real-time location data of all participants, for TV graphics, speed monitors, gap time\
> calculation or dashboards.\
> \
> Gap values (\`gap\*\`) are calculated against the leader, the participant with the smallest\
> \`toFinish\` at \`resultTime\`. Pass \`refStarterId\` or \`refStartNumber\` to calculate them against\
> that participant instead. The reference is marked with \`isRef: true\`.

```json
{"openapi":"3.1.0","info":{"title":"Racemap API v1","version":"1"},"tags":[{"name":"Data API","description":"Live and historic tracking data of an event. No authentication."}],"servers":[{"url":"https://racemap.com"}],"security":[],"paths":{"/api/data/v1/{eventId}/current":{"get":{"tags":["Data API"],"operationId":"getCurrent","summary":"Current locations, speeds and gaps","description":"Real-time location data of all participants, for TV graphics, speed monitors, gap time\ncalculation or dashboards.\n\nGap values (`gap*`) are calculated against the leader, the participant with the smallest\n`toFinish` at `resultTime`. Pass `refStarterId` or `refStartNumber` to calculate them against\nthat participant instead. The reference is marked with `isRef: true`.","parameters":[{"$ref":"#/components/parameters/EventId"},{"$ref":"#/components/parameters/ResultTime"},{"$ref":"#/components/parameters/RefStarterId"},{"$ref":"#/components/parameters/RefStartNumber"},{"$ref":"#/components/parameters/AvgSpeedWindow"}],"responses":{"200":{"$ref":"#/components/responses/Current"},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/ServerError"}}}}},"components":{"parameters":{"EventId":{"name":"eventId","in":"path","required":true,"description":"Id of the event.","schema":{"$ref":"#/components/schemas/ObjectId"}},"ResultTime":{"name":"resultTime","in":"query","description":"UTC timestamp that defines the reference time of the response. Defaults to the request time.\nLocations recorded after `resultTime` are ignored, so you can request data for any past or\nfuture moment.","schema":{"type":"string","format":"date-time"}},"RefStarterId":{"name":"refStarterId","in":"query","description":"Id of the reference participant for the gap values (`gap*`), instead of the leader. MUST NOT\nbe combined with `refStartNumber`. An id that is not a participant of the event fails with\n`404`.\n\nAliases: `starterId`, `participantId`, `deviceId`.","schema":{"$ref":"#/components/schemas/ObjectId"}},"RefStartNumber":{"name":"refStartNumber","in":"query","description":"Bib number of the reference participant for the gap values (`gap*`), instead of the leader.\nMUST NOT be combined with `refStarterId`. A bib number no participant has fails with `404`.\n\nAlias: `startNumber`.","schema":{"type":"string"}},"AvgSpeedWindow":{"name":"avgSpeedWindow","in":"query","description":"Duration [s] over which `speed` and `speedSt` are averaged. The window reaches back from the\nlatest known location before `resultTime`; its other end is interpolated between recorded\nlocations. Larger values smooth the speed. Decimals are truncated. Values below 30 fail with\n`400`. There is no maximum.\n\nAlias: `currentSpeedDuration`.","schema":{"type":"number","minimum":30,"default":300}}},"schemas":{"ObjectId":{"type":"string","description":"12-byte ObjectId as 24-character hexadecimal string.","pattern":"^[0-9a-fA-F]{24}$"},"CurrentResponse":{"type":"object","required":["name","location","startTime","endTime","resultTime","shadowTrackUrl","starters"],"properties":{"name":{"type":"string","description":"Name of the event."},"location":{"type":"string","description":"Location of the event. Empty if not set."},"startTime":{"type":"string","format":"date-time","description":"Start time in UTC."},"endTime":{"type":"string","format":"date-time","description":"End time in UTC."},"resultTime":{"type":"string","format":"date-time","description":"UTC timestamp the data belongs to, the `resultTime` query parameter or the request time."},"shadowTrackUrl":{"type":"string","format":"uri","description":"URL to download the shadowtrack as a GeoJSON file."},"starters":{"type":"array","description":"The participants.","items":{"$ref":"#/components/schemas/CurrentParticipant"}}}},"CurrentParticipant":{"allOf":[{"$ref":"#/components/schemas/ParticipantBasicInfo"},{"type":"object","required":["current","device"],"properties":{"current":{"$ref":"#/components/schemas/CurrentContent"},"device":{"$ref":"#/components/schemas/DeviceState"}}}]},"ParticipantBasicInfo":{"type":"object","description":"Basic information of a participant.","required":["id","name","startNumber","tags","markerColor","importId"],"properties":{"id":{"allOf":[{"$ref":"#/components/schemas/ObjectId"}],"description":"Unique Racemap id of the participant."},"name":{"type":["string","null"],"description":"Name. Imported or synchronized from an external source."},"startNumber":{"type":["string","null"],"description":"Bib number. Imported or synchronized from an external source."},"tags":{"type":["object","null"],"description":"Optional attributes to filter participants, such as age group or nation, in the format\n`\"tag\": \"value\"`. Keys are sorted. Imported or synchronized from an external source.","additionalProperties":{"type":"string"}},"markerColor":{"type":["string","null"],"description":"Color of the dot in the tracking map, hex code."},"importId":{"type":["string","null"],"description":"User-defined id from imported participant data: `importId` of the Generic API or `Id` of\nthe RACE|RESULT API. `null` if no import id exists."}}},"CurrentContent":{"type":"object","description":"Latest data of the participant at `resultTime`.\n\n- If no location is known between `startTime` and `resultTime`, `time` equals `resultTime` and\n  all other fields are `null`.\n- Fields marked \"shadowtrack\" are calculated only for events with a shadowtrack, and only when\n  the location could be mapped onto it (max mapping distance, default 100 m, set in the\n  event's advanced settings). Otherwise they are `null`.\n- Gap fields are calculated against the leader (smallest `toFinish` at `resultTime`) or the\n  requested reference participant. Negative gaps mean the reference is behind. When the leader\n  reaches the finish, the next participant becomes the leader, which can make gaps jump.","required":["time","lat","lng","elv","speed","distanceToShadowTrack","speedSt","eta","fromStart","toFinish","lngSt","latSt","gapCalcTime","gapDistance","gap","gapChase","gapAverage","fromStartEx","toFinishEx","lngStEx","latStEx","gapDistanceEx","gapEx","gapChaseEx","gapAverageEx"],"properties":{"time":{"type":"string","format":"date-time","description":"UTC timestamp when the latest location was recorded, with milliseconds."},"lat":{"type":["number","null"],"description":"Latitude of the latest recorded location, 6 decimals."},"lng":{"type":["number","null"],"description":"Longitude of the latest recorded location, 6 decimals."},"elv":{"type":["number","null"],"description":"Altitude [m] of the shadowtrack at `lngSt`/`latSt`. Shadowtrack; `null` when the location\nis 100 m or more away from the shadowtrack."},"speed":{"type":["number","null"],"description":"Average speed [m/s], 2 decimals. Distance: sum of straight lines between the locations\nwithin `avgSpeedWindow`; curves are cut between two locations. `null` with fewer than two\nlocations before `resultTime`."},"isRef":{"type":"boolean","description":"`true` for the participant the gap values are calculated against (the leader or the\nrequested reference). Only present when `true`, and only once gaps could be calculated."},"distanceToShadowTrack":{"type":["number","null"],"description":"Shortest distance [m] between `lat`/`lng` and the shadowtrack. Shadowtrack."},"speedSt":{"type":["number","null"],"description":"Average speed [m/s] along the shadowtrack, 2 decimals. Distance: segments covered on the\nshadowtrack within `avgSpeedWindow`. Shadowtrack."},"eta":{"type":["integer","null"],"description":"Estimated time [s] to move from `lngSt`/`latSt` to the end of the shadowtrack, extrapolated\nwith `speedSt`. Shadowtrack."},"fromStart":{"type":["number","null"],"description":"Distance [m] from the start of the shadowtrack along the track to `lngSt`/`latSt`.\nShadowtrack."},"toFinish":{"type":["number","null"],"description":"Distance [m] from `lngSt`/`latSt` along the shadowtrack to its end. Shadowtrack."},"lngSt":{"type":["number","null"],"description":"Longitude of the latest location mapped onto the shadowtrack, 6 decimals. Present for every\nevent with a shadowtrack, also when the location lies beyond the max mapping distance."},"latSt":{"type":["number","null"],"description":"Latitude of the latest location mapped onto the shadowtrack, 6 decimals. Present for every\nevent with a shadowtrack, also when the location lies beyond the max mapping distance."},"gapCalcTime":{"type":["string","null"],"format":"date-time","description":"UTC timestamp for which `gapDistance`, `gap`, `gapChase` and `gapAverage` are obtained:\nthe earlier of this participant's and the reference's latest location. Not later than\n`resultTime`. Shadowtrack."},"gapDistance":{"type":["number","null"],"description":"Distance [m] along the shadowtrack between this participant and the reference at\n`gapCalcTime`. Shadowtrack."},"gap":{"type":["integer","null"],"description":"Duration [s] to cover `gapDistance`, calculated with the `speedSt` of the reference.\nShadowtrack."},"gapChase":{"type":["integer","null"],"description":"Duration [s] to cover `gapDistance`, calculated with the `speedSt` of this participant.\nShadowtrack."},"gapAverage":{"type":["integer","null"],"description":"Duration [s] the reference took from this participant's current position on the shadowtrack\nto its own position at `gapCalcTime`. Shadowtrack."},"fromStartEx":{"type":["number","null"],"description":"Distance [m] from the start of the shadowtrack to `lngStEx`/`latStEx`: `fromStart`\nextrapolated to `resultTime` with `speedSt`. Shadowtrack."},"toFinishEx":{"type":["number","null"],"description":"Distance [m] from `lngStEx`/`latStEx` along the shadowtrack to its end. Shadowtrack."},"lngStEx":{"type":["number","null"],"description":"Longitude of the mapped location extrapolated along the shadowtrack to `resultTime` with\n`speedSt`, 6 decimals. Shadowtrack."},"latStEx":{"type":["number","null"],"description":"Latitude of the mapped location extrapolated along the shadowtrack to `resultTime` with\n`speedSt`, 6 decimals. Shadowtrack."},"gapDistanceEx":{"type":["number","null"],"description":"Distance [m] between `toFinishEx` of this participant and of the reference. Shadowtrack."},"gapEx":{"type":["integer","null"],"description":"Duration [s] to cover `gapDistanceEx`, calculated with the `speedSt` of the reference.\nShadowtrack."},"gapChaseEx":{"type":["integer","null"],"description":"Duration [s] to cover `gapDistanceEx`, calculated with the `speedSt` of this participant.\nShadowtrack."},"gapAverageEx":{"type":["integer","null"],"description":"Duration [s] the reference took from this participant's extrapolated position on the\nshadowtrack to its own position. Shadowtrack."}}},"DeviceState":{"type":["object","null"],"description":"Information on the GPS tracker of the participant. `null` if the device is not used in the\ntracker management.","required":["externalId","battery","charging","online","lastLocationGpsFix","lastLocationAt","deviceId","isMoving"],"properties":{"externalId":{"type":["string","null"],"description":"Unique id of the tracking device: IMEI, transponder id or app id, depending on the device."},"battery":{"type":["integer","null"],"description":"Charge level [%] of the device.","minimum":0,"maximum":255},"charging":{"type":"boolean","description":"Whether the device is being charged. Most devices report only when charging starts or\nstops, so the value is reliable only while `online` is `true`. Devices that do not report\ncharging always show `false`."},"online":{"type":"boolean","description":"Connection status with the Racemap server, from the socket connection to the device and\nthe time since its last message."},"lastLocationGpsFix":{"type":["boolean","null"],"description":"Whether the device had a GPS fix when recording the latest location."},"lastLocationAt":{"type":["string","null"],"format":"date-time","description":"UTC timestamp when the device recorded its latest location."},"deviceId":{"type":["string","null"],"description":"Unique id of the tracking device in Racemap. Use it as a tracker id for tracker messages."},"isMoving":{"type":["boolean","null"],"description":"Whether the device is moving, derived from accelerometer data. Only valid while the device\nis online. Only Queclink GL3xx trackers report it."}}}},"responses":{"Current":{"description":"The event with the current data of every participant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentResponse"}}}},"BadRequest":{"description":"Invalid request, or the event does not allow the call. Examples:\n\n- `Invalid query: …` for a malformed query parameter (id, timestamp, number) or a missing\n  required one,\n- `avgSpeedWindow must be >= 30 seconds`,\n- `Provide either 'participantId' or 'startNumber', not both`,\n- `Only up to 2 divisions are allowed`,\n- `Data API (Datafeed) not activated or event is archived or not activated` when the event is\n  not activated, archived, its Data API module is off, or it was just auto-paused,\n- `Event is not enabled for prediction.` (unified only).","content":{"text/plain":{"schema":{"type":"string"}}}},"NotFound":{"description":"Unknown event (`Event not found`), participant, split or shadowtrack, or an id in the path\nthat is not a valid ObjectId (`Not found`).","content":{"text/plain":{"schema":{"type":"string"}}}},"ServerError":{"description":"Racemap could not load the event data.","content":{"text/plain":{"schema":{"type":"string"}}}}}}}
```

### Leader and reference participant

Gap values (`gapDistance`, `gap`, `gapChase`, `gapAverage` and their `Ex` variants) are calculated against the leader by default.

* **Leader:** the participant with the smallest `toFinish` value at `resultTime`.
* Each time a leader reaches the finish, the participant with the next smallest `toFinish` becomes the leader. At that moment the gap values can jump.
* **Reference:** pass `participantId` (or `refStarterId`, `starterId`, `deviceId`) or `startNumber` (or `refStartNumber`) to calculate against that participant instead. Pass only one of them. An unknown participant fails with HTTP 404.
* The participant the gaps refer to has `isRef: true`. The field is only present when it is `true`.
* A negative gap means the reference is behind the participant.

### Shadowtrack fields

Most fields of the `current` object need a [shadowtrack](https://docs.racemap.com/live-tracking/shadowtrack.md#shadowtrack) and a [mapping of the geolocation](https://docs.racemap.com/live-tracking/shadowtrack.md#what-is-mapping) on it.

* The default max mapping distance is 100 m. Change it in the Advanced Settings of the event.
* If a geolocation cannot be mapped, `fromStart`, `toFinish`, `eta`, the gap values and the `Ex` values are `null`.
* `lngSt`/`latSt` still show the nearest point on the shadowtrack, also beyond the max mapping distance.
* `elv` is the altitude of the shadowtrack at `lngSt`/`latSt`. It is `null` if the geolocation is 100 m or more away from the shadowtrack.
* The `Ex` values extrapolate the mapped position along the shadowtrack to `resultTime`, using `speedSt`.
* Durations (`eta` and the gap values) are whole seconds.
* If no geolocation of a participant is known, `time` equals `resultTime` and all other fields are `null`.

### Device object

The `device` object provides additional information for GPS trackers used in the [tracker management](https://docs.racemap.com/tracker-management.md). It is `null` for other devices.

{% hint style="info" %}
`isMoving` is available only for Queclink GL3xx GPS trackers. The value is derived from accelerometer data.
{% endhint %}

{% hint style="info" %}
`charging` is reported by Queclink GL3xx, Concox M20 and Mictrack GPS trackers. Other devices always report `false`.

Most devices send a message only when charging starts or stops, so the value keeps the last state the device reported. It is therefore of good quality only while `online` is `true`. If `online` is `false`, read `charging` as the last known state, not the current one.
{% endhint %}

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`:

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

If `online` is `false`:

* Device may have lost its network connection.
* Device may have been turned off, also.

### Speed calculations

Speeds can vary significantly in dense datasets, mainly because of GPS position inaccuracies. To reduce these fluctuations, use the `avgSpeedWindow` parameter to smooth the speed curve.

* `avgSpeedWindow` is a duration in seconds. The default is 300, the minimum is 30. There is no maximum.
* The window reaches back from the latest known geolocation before `resultTime`. Its other end is interpolated between recorded geolocations.
* `speed` sums the straight lines between geolocations. `speedSt` uses the distance covered on the shadowtrack.

The figure below illustrates the effect of `avgSpeedWindow` on both dense and sparse datasets.

<figure><img src="https://1672210197-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LSRNxaH2Ju9Flr7JhJD%2Fuploads%2Fgit-blob-5d539a20ce8a7fcf09823a45cb34eaf43f6dce53%2Fcurrent-api-speed.excalidraw%20(1).svg?alt=media" alt=""><figcaption><p>The green and orange rectangles show the <strong>gapAverageWindows</strong> used for <code>speedSt</code> calculation.</p></figcaption></figure>

### How gaps are calculated

The gap values `gap`, `gapChase` and `gapAverage` are durations in seconds. Read them as the time it takes to close the gap.

* `gap` and `gapEx`: calculated with `speedSt` of the reference (by default the leader).
* `gapChase` and `gapChaseEx`: calculated with `speedSt` of the chaser.
* `gapAverage` and `gapAverageEx`: the time the reference actually took from the chaser's position to its own.

`gap` and `gapChase` are based on local speed conditions at the participants' positions. `gapAverage` includes the effect of elevation and stops along the way. The diagram below shows a short stop of the leader at around 68.8 km.

<div align="center"><figure><img src="https://1672210197-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LSRNxaH2Ju9Flr7JhJD%2Fuploads%2Fgit-blob-22d2b91a202fdd5b30fdea7dda592179decb8384%2Fgap-chart-100km%20Duathlon%202026.svg?alt=media" alt=""><figcaption><p>Recorded geolocations for two GPS devices: Locations mapped on the shadowtrack (offset axis) over the timeline (x axis). The leader (orange) is performing ahead of the chaser (blue). The diagram shows the gaps calculated for the current API output. The colored rectangles highlight the <strong>gapAverageWindows</strong> used for <code>speedSt</code> calculation.</p></figcaption></figure></div>

### Subsequent calculations

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)

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

### Replay over a time range

`*/current-replay` returns the `current` response of one participant at regular intervals, together with its reference participant. Use it to replay or analyse a race. A request covers at most 30 days and 10000 frames, and counts as one load.

## Current data of one participant over a time range

> Computes the \`current\` response for one participant at regular intervals between \`start\` and\
> \`end\`. Each frame is a full \`current\` response whose \`starters\` holds the selected participant\
> and the reference participant (the leader, or \`refStarterId\` / \`refStartNumber\`) when one could\
> be determined.\
> \
> \- The range MUST NOT exceed 30 days.\
> \- A request MUST NOT produce more than 10000 frames.\
> \- The last frame is always at \`end\`.\
> \- The whole request counts as one load.

```json
{"openapi":"3.1.0","info":{"title":"Racemap API v1","version":"1"},"tags":[{"name":"Data API","description":"Live and historic tracking data of an event. No authentication."}],"servers":[{"url":"https://racemap.com"}],"security":[],"paths":{"/api/data/v1/{eventId}/current-replay":{"get":{"tags":["Data API"],"operationId":"getCurrentReplay","summary":"Current data of one participant over a time range","description":"Computes the `current` response for one participant at regular intervals between `start` and\n`end`. Each frame is a full `current` response whose `starters` holds the selected participant\nand the reference participant (the leader, or `refStarterId` / `refStartNumber`) when one could\nbe determined.\n\n- The range MUST NOT exceed 30 days.\n- A request MUST NOT produce more than 10000 frames.\n- The last frame is always at `end`.\n- The whole request counts as one load.","parameters":[{"$ref":"#/components/parameters/EventId"},{"name":"start","in":"query","required":true,"description":"UTC timestamp of the first frame.","schema":{"type":"string","format":"date-time"}},{"name":"end","in":"query","required":true,"description":"UTC timestamp of the last frame. MUST NOT be before `start`.","schema":{"type":"string","format":"date-time"}},{"name":"intervalSeconds","in":"query","description":"Interval [s] between two frames. `0` is treated as `1`.","schema":{"type":"integer","minimum":0,"maximum":4294967295,"default":10}},{"name":"selectedForReplayId","in":"query","required":true,"description":"Id of the participant to replay.","schema":{"$ref":"#/components/schemas/ObjectId"}},{"$ref":"#/components/parameters/RefStarterId"},{"$ref":"#/components/parameters/RefStartNumber"},{"$ref":"#/components/parameters/AvgSpeedWindow"}],"responses":{"200":{"description":"One frame per interval, in chronological order.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CurrentResponse"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/ServerError"}}}}},"components":{"parameters":{"EventId":{"name":"eventId","in":"path","required":true,"description":"Id of the event.","schema":{"$ref":"#/components/schemas/ObjectId"}},"RefStarterId":{"name":"refStarterId","in":"query","description":"Id of the reference participant for the gap values (`gap*`), instead of the leader. MUST NOT\nbe combined with `refStartNumber`. An id that is not a participant of the event fails with\n`404`.\n\nAliases: `starterId`, `participantId`, `deviceId`.","schema":{"$ref":"#/components/schemas/ObjectId"}},"RefStartNumber":{"name":"refStartNumber","in":"query","description":"Bib number of the reference participant for the gap values (`gap*`), instead of the leader.\nMUST NOT be combined with `refStarterId`. A bib number no participant has fails with `404`.\n\nAlias: `startNumber`.","schema":{"type":"string"}},"AvgSpeedWindow":{"name":"avgSpeedWindow","in":"query","description":"Duration [s] over which `speed` and `speedSt` are averaged. The window reaches back from the\nlatest known location before `resultTime`; its other end is interpolated between recorded\nlocations. Larger values smooth the speed. Decimals are truncated. Values below 30 fail with\n`400`. There is no maximum.\n\nAlias: `currentSpeedDuration`.","schema":{"type":"number","minimum":30,"default":300}}},"schemas":{"ObjectId":{"type":"string","description":"12-byte ObjectId as 24-character hexadecimal string.","pattern":"^[0-9a-fA-F]{24}$"},"CurrentResponse":{"type":"object","required":["name","location","startTime","endTime","resultTime","shadowTrackUrl","starters"],"properties":{"name":{"type":"string","description":"Name of the event."},"location":{"type":"string","description":"Location of the event. Empty if not set."},"startTime":{"type":"string","format":"date-time","description":"Start time in UTC."},"endTime":{"type":"string","format":"date-time","description":"End time in UTC."},"resultTime":{"type":"string","format":"date-time","description":"UTC timestamp the data belongs to, the `resultTime` query parameter or the request time."},"shadowTrackUrl":{"type":"string","format":"uri","description":"URL to download the shadowtrack as a GeoJSON file."},"starters":{"type":"array","description":"The participants.","items":{"$ref":"#/components/schemas/CurrentParticipant"}}}},"CurrentParticipant":{"allOf":[{"$ref":"#/components/schemas/ParticipantBasicInfo"},{"type":"object","required":["current","device"],"properties":{"current":{"$ref":"#/components/schemas/CurrentContent"},"device":{"$ref":"#/components/schemas/DeviceState"}}}]},"ParticipantBasicInfo":{"type":"object","description":"Basic information of a participant.","required":["id","name","startNumber","tags","markerColor","importId"],"properties":{"id":{"allOf":[{"$ref":"#/components/schemas/ObjectId"}],"description":"Unique Racemap id of the participant."},"name":{"type":["string","null"],"description":"Name. Imported or synchronized from an external source."},"startNumber":{"type":["string","null"],"description":"Bib number. Imported or synchronized from an external source."},"tags":{"type":["object","null"],"description":"Optional attributes to filter participants, such as age group or nation, in the format\n`\"tag\": \"value\"`. Keys are sorted. Imported or synchronized from an external source.","additionalProperties":{"type":"string"}},"markerColor":{"type":["string","null"],"description":"Color of the dot in the tracking map, hex code."},"importId":{"type":["string","null"],"description":"User-defined id from imported participant data: `importId` of the Generic API or `Id` of\nthe RACE|RESULT API. `null` if no import id exists."}}},"CurrentContent":{"type":"object","description":"Latest data of the participant at `resultTime`.\n\n- If no location is known between `startTime` and `resultTime`, `time` equals `resultTime` and\n  all other fields are `null`.\n- Fields marked \"shadowtrack\" are calculated only for events with a shadowtrack, and only when\n  the location could be mapped onto it (max mapping distance, default 100 m, set in the\n  event's advanced settings). Otherwise they are `null`.\n- Gap fields are calculated against the leader (smallest `toFinish` at `resultTime`) or the\n  requested reference participant. Negative gaps mean the reference is behind. When the leader\n  reaches the finish, the next participant becomes the leader, which can make gaps jump.","required":["time","lat","lng","elv","speed","distanceToShadowTrack","speedSt","eta","fromStart","toFinish","lngSt","latSt","gapCalcTime","gapDistance","gap","gapChase","gapAverage","fromStartEx","toFinishEx","lngStEx","latStEx","gapDistanceEx","gapEx","gapChaseEx","gapAverageEx"],"properties":{"time":{"type":"string","format":"date-time","description":"UTC timestamp when the latest location was recorded, with milliseconds."},"lat":{"type":["number","null"],"description":"Latitude of the latest recorded location, 6 decimals."},"lng":{"type":["number","null"],"description":"Longitude of the latest recorded location, 6 decimals."},"elv":{"type":["number","null"],"description":"Altitude [m] of the shadowtrack at `lngSt`/`latSt`. Shadowtrack; `null` when the location\nis 100 m or more away from the shadowtrack."},"speed":{"type":["number","null"],"description":"Average speed [m/s], 2 decimals. Distance: sum of straight lines between the locations\nwithin `avgSpeedWindow`; curves are cut between two locations. `null` with fewer than two\nlocations before `resultTime`."},"isRef":{"type":"boolean","description":"`true` for the participant the gap values are calculated against (the leader or the\nrequested reference). Only present when `true`, and only once gaps could be calculated."},"distanceToShadowTrack":{"type":["number","null"],"description":"Shortest distance [m] between `lat`/`lng` and the shadowtrack. Shadowtrack."},"speedSt":{"type":["number","null"],"description":"Average speed [m/s] along the shadowtrack, 2 decimals. Distance: segments covered on the\nshadowtrack within `avgSpeedWindow`. Shadowtrack."},"eta":{"type":["integer","null"],"description":"Estimated time [s] to move from `lngSt`/`latSt` to the end of the shadowtrack, extrapolated\nwith `speedSt`. Shadowtrack."},"fromStart":{"type":["number","null"],"description":"Distance [m] from the start of the shadowtrack along the track to `lngSt`/`latSt`.\nShadowtrack."},"toFinish":{"type":["number","null"],"description":"Distance [m] from `lngSt`/`latSt` along the shadowtrack to its end. Shadowtrack."},"lngSt":{"type":["number","null"],"description":"Longitude of the latest location mapped onto the shadowtrack, 6 decimals. Present for every\nevent with a shadowtrack, also when the location lies beyond the max mapping distance."},"latSt":{"type":["number","null"],"description":"Latitude of the latest location mapped onto the shadowtrack, 6 decimals. Present for every\nevent with a shadowtrack, also when the location lies beyond the max mapping distance."},"gapCalcTime":{"type":["string","null"],"format":"date-time","description":"UTC timestamp for which `gapDistance`, `gap`, `gapChase` and `gapAverage` are obtained:\nthe earlier of this participant's and the reference's latest location. Not later than\n`resultTime`. Shadowtrack."},"gapDistance":{"type":["number","null"],"description":"Distance [m] along the shadowtrack between this participant and the reference at\n`gapCalcTime`. Shadowtrack."},"gap":{"type":["integer","null"],"description":"Duration [s] to cover `gapDistance`, calculated with the `speedSt` of the reference.\nShadowtrack."},"gapChase":{"type":["integer","null"],"description":"Duration [s] to cover `gapDistance`, calculated with the `speedSt` of this participant.\nShadowtrack."},"gapAverage":{"type":["integer","null"],"description":"Duration [s] the reference took from this participant's current position on the shadowtrack\nto its own position at `gapCalcTime`. Shadowtrack."},"fromStartEx":{"type":["number","null"],"description":"Distance [m] from the start of the shadowtrack to `lngStEx`/`latStEx`: `fromStart`\nextrapolated to `resultTime` with `speedSt`. Shadowtrack."},"toFinishEx":{"type":["number","null"],"description":"Distance [m] from `lngStEx`/`latStEx` along the shadowtrack to its end. Shadowtrack."},"lngStEx":{"type":["number","null"],"description":"Longitude of the mapped location extrapolated along the shadowtrack to `resultTime` with\n`speedSt`, 6 decimals. Shadowtrack."},"latStEx":{"type":["number","null"],"description":"Latitude of the mapped location extrapolated along the shadowtrack to `resultTime` with\n`speedSt`, 6 decimals. Shadowtrack."},"gapDistanceEx":{"type":["number","null"],"description":"Distance [m] between `toFinishEx` of this participant and of the reference. Shadowtrack."},"gapEx":{"type":["integer","null"],"description":"Duration [s] to cover `gapDistanceEx`, calculated with the `speedSt` of the reference.\nShadowtrack."},"gapChaseEx":{"type":["integer","null"],"description":"Duration [s] to cover `gapDistanceEx`, calculated with the `speedSt` of this participant.\nShadowtrack."},"gapAverageEx":{"type":["integer","null"],"description":"Duration [s] the reference took from this participant's extrapolated position on the\nshadowtrack to its own position. Shadowtrack."}}},"DeviceState":{"type":["object","null"],"description":"Information on the GPS tracker of the participant. `null` if the device is not used in the\ntracker management.","required":["externalId","battery","charging","online","lastLocationGpsFix","lastLocationAt","deviceId","isMoving"],"properties":{"externalId":{"type":["string","null"],"description":"Unique id of the tracking device: IMEI, transponder id or app id, depending on the device."},"battery":{"type":["integer","null"],"description":"Charge level [%] of the device.","minimum":0,"maximum":255},"charging":{"type":"boolean","description":"Whether the device is being charged. Most devices report only when charging starts or\nstops, so the value is reliable only while `online` is `true`. Devices that do not report\ncharging always show `false`."},"online":{"type":"boolean","description":"Connection status with the Racemap server, from the socket connection to the device and\nthe time since its last message."},"lastLocationGpsFix":{"type":["boolean","null"],"description":"Whether the device had a GPS fix when recording the latest location."},"lastLocationAt":{"type":["string","null"],"format":"date-time","description":"UTC timestamp when the device recorded its latest location."},"deviceId":{"type":["string","null"],"description":"Unique id of the tracking device in Racemap. Use it as a tracker id for tracker messages."},"isMoving":{"type":["boolean","null"],"description":"Whether the device is moving, derived from accelerometer data. Only valid while the device\nis online. Only Queclink GL3xx trackers report it."}}}},"responses":{"BadRequest":{"description":"Invalid request, or the event does not allow the call. Examples:\n\n- `Invalid query: …` for a malformed query parameter (id, timestamp, number) or a missing\n  required one,\n- `avgSpeedWindow must be >= 30 seconds`,\n- `Provide either 'participantId' or 'startNumber', not both`,\n- `Only up to 2 divisions are allowed`,\n- `Data API (Datafeed) not activated or event is archived or not activated` when the event is\n  not activated, archived, its Data API module is off, or it was just auto-paused,\n- `Event is not enabled for prediction.` (unified only).","content":{"text/plain":{"schema":{"type":"string"}}}},"NotFound":{"description":"Unknown event (`Event not found`), participant, split or shadowtrack, or an id in the path\nthat is not a valid ObjectId (`Not found`).","content":{"text/plain":{"schema":{"type":"string"}}}},"ServerError":{"description":"Racemap could not load the event data.","content":{"text/plain":{"schema":{"type":"string"}}}}}}}
```

### Deprecated alias

`/api/data/v1/:eventId` without `/current` returns the same response. Use `*/current` instead.

## Current locations (alias)

> Alias of \`/api/data/v1/{eventId}/current\`. Same parameters, same response.

```json
{"openapi":"3.1.0","info":{"title":"Racemap API v1","version":"1"},"tags":[{"name":"Data API","description":"Live and historic tracking data of an event. No authentication."}],"servers":[{"url":"https://racemap.com"}],"security":[],"paths":{"/api/data/v1/{eventId}":{"get":{"tags":["Data API"],"operationId":"getCurrentAlias","summary":"Current locations (alias)","description":"Alias of `/api/data/v1/{eventId}/current`. Same parameters, same response.","deprecated":true,"parameters":[{"$ref":"#/components/parameters/EventId"},{"$ref":"#/components/parameters/ResultTime"},{"$ref":"#/components/parameters/RefStarterId"},{"$ref":"#/components/parameters/RefStartNumber"},{"$ref":"#/components/parameters/AvgSpeedWindow"}],"responses":{"200":{"$ref":"#/components/responses/Current"},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/ServerError"}}}}},"components":{"parameters":{"EventId":{"name":"eventId","in":"path","required":true,"description":"Id of the event.","schema":{"$ref":"#/components/schemas/ObjectId"}},"ResultTime":{"name":"resultTime","in":"query","description":"UTC timestamp that defines the reference time of the response. Defaults to the request time.\nLocations recorded after `resultTime` are ignored, so you can request data for any past or\nfuture moment.","schema":{"type":"string","format":"date-time"}},"RefStarterId":{"name":"refStarterId","in":"query","description":"Id of the reference participant for the gap values (`gap*`), instead of the leader. MUST NOT\nbe combined with `refStartNumber`. An id that is not a participant of the event fails with\n`404`.\n\nAliases: `starterId`, `participantId`, `deviceId`.","schema":{"$ref":"#/components/schemas/ObjectId"}},"RefStartNumber":{"name":"refStartNumber","in":"query","description":"Bib number of the reference participant for the gap values (`gap*`), instead of the leader.\nMUST NOT be combined with `refStarterId`. A bib number no participant has fails with `404`.\n\nAlias: `startNumber`.","schema":{"type":"string"}},"AvgSpeedWindow":{"name":"avgSpeedWindow","in":"query","description":"Duration [s] over which `speed` and `speedSt` are averaged. The window reaches back from the\nlatest known location before `resultTime`; its other end is interpolated between recorded\nlocations. Larger values smooth the speed. Decimals are truncated. Values below 30 fail with\n`400`. There is no maximum.\n\nAlias: `currentSpeedDuration`.","schema":{"type":"number","minimum":30,"default":300}}},"schemas":{"ObjectId":{"type":"string","description":"12-byte ObjectId as 24-character hexadecimal string.","pattern":"^[0-9a-fA-F]{24}$"},"CurrentResponse":{"type":"object","required":["name","location","startTime","endTime","resultTime","shadowTrackUrl","starters"],"properties":{"name":{"type":"string","description":"Name of the event."},"location":{"type":"string","description":"Location of the event. Empty if not set."},"startTime":{"type":"string","format":"date-time","description":"Start time in UTC."},"endTime":{"type":"string","format":"date-time","description":"End time in UTC."},"resultTime":{"type":"string","format":"date-time","description":"UTC timestamp the data belongs to, the `resultTime` query parameter or the request time."},"shadowTrackUrl":{"type":"string","format":"uri","description":"URL to download the shadowtrack as a GeoJSON file."},"starters":{"type":"array","description":"The participants.","items":{"$ref":"#/components/schemas/CurrentParticipant"}}}},"CurrentParticipant":{"allOf":[{"$ref":"#/components/schemas/ParticipantBasicInfo"},{"type":"object","required":["current","device"],"properties":{"current":{"$ref":"#/components/schemas/CurrentContent"},"device":{"$ref":"#/components/schemas/DeviceState"}}}]},"ParticipantBasicInfo":{"type":"object","description":"Basic information of a participant.","required":["id","name","startNumber","tags","markerColor","importId"],"properties":{"id":{"allOf":[{"$ref":"#/components/schemas/ObjectId"}],"description":"Unique Racemap id of the participant."},"name":{"type":["string","null"],"description":"Name. Imported or synchronized from an external source."},"startNumber":{"type":["string","null"],"description":"Bib number. Imported or synchronized from an external source."},"tags":{"type":["object","null"],"description":"Optional attributes to filter participants, such as age group or nation, in the format\n`\"tag\": \"value\"`. Keys are sorted. Imported or synchronized from an external source.","additionalProperties":{"type":"string"}},"markerColor":{"type":["string","null"],"description":"Color of the dot in the tracking map, hex code."},"importId":{"type":["string","null"],"description":"User-defined id from imported participant data: `importId` of the Generic API or `Id` of\nthe RACE|RESULT API. `null` if no import id exists."}}},"CurrentContent":{"type":"object","description":"Latest data of the participant at `resultTime`.\n\n- If no location is known between `startTime` and `resultTime`, `time` equals `resultTime` and\n  all other fields are `null`.\n- Fields marked \"shadowtrack\" are calculated only for events with a shadowtrack, and only when\n  the location could be mapped onto it (max mapping distance, default 100 m, set in the\n  event's advanced settings). Otherwise they are `null`.\n- Gap fields are calculated against the leader (smallest `toFinish` at `resultTime`) or the\n  requested reference participant. Negative gaps mean the reference is behind. When the leader\n  reaches the finish, the next participant becomes the leader, which can make gaps jump.","required":["time","lat","lng","elv","speed","distanceToShadowTrack","speedSt","eta","fromStart","toFinish","lngSt","latSt","gapCalcTime","gapDistance","gap","gapChase","gapAverage","fromStartEx","toFinishEx","lngStEx","latStEx","gapDistanceEx","gapEx","gapChaseEx","gapAverageEx"],"properties":{"time":{"type":"string","format":"date-time","description":"UTC timestamp when the latest location was recorded, with milliseconds."},"lat":{"type":["number","null"],"description":"Latitude of the latest recorded location, 6 decimals."},"lng":{"type":["number","null"],"description":"Longitude of the latest recorded location, 6 decimals."},"elv":{"type":["number","null"],"description":"Altitude [m] of the shadowtrack at `lngSt`/`latSt`. Shadowtrack; `null` when the location\nis 100 m or more away from the shadowtrack."},"speed":{"type":["number","null"],"description":"Average speed [m/s], 2 decimals. Distance: sum of straight lines between the locations\nwithin `avgSpeedWindow`; curves are cut between two locations. `null` with fewer than two\nlocations before `resultTime`."},"isRef":{"type":"boolean","description":"`true` for the participant the gap values are calculated against (the leader or the\nrequested reference). Only present when `true`, and only once gaps could be calculated."},"distanceToShadowTrack":{"type":["number","null"],"description":"Shortest distance [m] between `lat`/`lng` and the shadowtrack. Shadowtrack."},"speedSt":{"type":["number","null"],"description":"Average speed [m/s] along the shadowtrack, 2 decimals. Distance: segments covered on the\nshadowtrack within `avgSpeedWindow`. Shadowtrack."},"eta":{"type":["integer","null"],"description":"Estimated time [s] to move from `lngSt`/`latSt` to the end of the shadowtrack, extrapolated\nwith `speedSt`. Shadowtrack."},"fromStart":{"type":["number","null"],"description":"Distance [m] from the start of the shadowtrack along the track to `lngSt`/`latSt`.\nShadowtrack."},"toFinish":{"type":["number","null"],"description":"Distance [m] from `lngSt`/`latSt` along the shadowtrack to its end. Shadowtrack."},"lngSt":{"type":["number","null"],"description":"Longitude of the latest location mapped onto the shadowtrack, 6 decimals. Present for every\nevent with a shadowtrack, also when the location lies beyond the max mapping distance."},"latSt":{"type":["number","null"],"description":"Latitude of the latest location mapped onto the shadowtrack, 6 decimals. Present for every\nevent with a shadowtrack, also when the location lies beyond the max mapping distance."},"gapCalcTime":{"type":["string","null"],"format":"date-time","description":"UTC timestamp for which `gapDistance`, `gap`, `gapChase` and `gapAverage` are obtained:\nthe earlier of this participant's and the reference's latest location. Not later than\n`resultTime`. Shadowtrack."},"gapDistance":{"type":["number","null"],"description":"Distance [m] along the shadowtrack between this participant and the reference at\n`gapCalcTime`. Shadowtrack."},"gap":{"type":["integer","null"],"description":"Duration [s] to cover `gapDistance`, calculated with the `speedSt` of the reference.\nShadowtrack."},"gapChase":{"type":["integer","null"],"description":"Duration [s] to cover `gapDistance`, calculated with the `speedSt` of this participant.\nShadowtrack."},"gapAverage":{"type":["integer","null"],"description":"Duration [s] the reference took from this participant's current position on the shadowtrack\nto its own position at `gapCalcTime`. Shadowtrack."},"fromStartEx":{"type":["number","null"],"description":"Distance [m] from the start of the shadowtrack to `lngStEx`/`latStEx`: `fromStart`\nextrapolated to `resultTime` with `speedSt`. Shadowtrack."},"toFinishEx":{"type":["number","null"],"description":"Distance [m] from `lngStEx`/`latStEx` along the shadowtrack to its end. Shadowtrack."},"lngStEx":{"type":["number","null"],"description":"Longitude of the mapped location extrapolated along the shadowtrack to `resultTime` with\n`speedSt`, 6 decimals. Shadowtrack."},"latStEx":{"type":["number","null"],"description":"Latitude of the mapped location extrapolated along the shadowtrack to `resultTime` with\n`speedSt`, 6 decimals. Shadowtrack."},"gapDistanceEx":{"type":["number","null"],"description":"Distance [m] between `toFinishEx` of this participant and of the reference. Shadowtrack."},"gapEx":{"type":["integer","null"],"description":"Duration [s] to cover `gapDistanceEx`, calculated with the `speedSt` of the reference.\nShadowtrack."},"gapChaseEx":{"type":["integer","null"],"description":"Duration [s] to cover `gapDistanceEx`, calculated with the `speedSt` of this participant.\nShadowtrack."},"gapAverageEx":{"type":["integer","null"],"description":"Duration [s] the reference took from this participant's extrapolated position on the\nshadowtrack to its own position. Shadowtrack."}}},"DeviceState":{"type":["object","null"],"description":"Information on the GPS tracker of the participant. `null` if the device is not used in the\ntracker management.","required":["externalId","battery","charging","online","lastLocationGpsFix","lastLocationAt","deviceId","isMoving"],"properties":{"externalId":{"type":["string","null"],"description":"Unique id of the tracking device: IMEI, transponder id or app id, depending on the device."},"battery":{"type":["integer","null"],"description":"Charge level [%] of the device.","minimum":0,"maximum":255},"charging":{"type":"boolean","description":"Whether the device is being charged. Most devices report only when charging starts or\nstops, so the value is reliable only while `online` is `true`. Devices that do not report\ncharging always show `false`."},"online":{"type":"boolean","description":"Connection status with the Racemap server, from the socket connection to the device and\nthe time since its last message."},"lastLocationGpsFix":{"type":["boolean","null"],"description":"Whether the device had a GPS fix when recording the latest location."},"lastLocationAt":{"type":["string","null"],"format":"date-time","description":"UTC timestamp when the device recorded its latest location."},"deviceId":{"type":["string","null"],"description":"Unique id of the tracking device in Racemap. Use it as a tracker id for tracker messages."},"isMoving":{"type":["boolean","null"],"description":"Whether the device is moving, derived from accelerometer data. Only valid while the device\nis online. Only Queclink GL3xx trackers report it."}}}},"responses":{"Current":{"description":"The event with the current data of every participant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentResponse"}}}},"BadRequest":{"description":"Invalid request, or the event does not allow the call. Examples:\n\n- `Invalid query: …` for a malformed query parameter (id, timestamp, number) or a missing\n  required one,\n- `avgSpeedWindow must be >= 30 seconds`,\n- `Provide either 'participantId' or 'startNumber', not both`,\n- `Only up to 2 divisions are allowed`,\n- `Data API (Datafeed) not activated or event is archived or not activated` when the event is\n  not activated, archived, its Data API module is off, or it was just auto-paused,\n- `Event is not enabled for prediction.` (unified only).","content":{"text/plain":{"schema":{"type":"string"}}}},"NotFound":{"description":"Unknown event (`Event not found`), participant, split or shadowtrack, or an id in the path\nthat is not a valid ObjectId (`Not found`).","content":{"text/plain":{"schema":{"type":"string"}}}},"ServerError":{"description":"Racemap could not load the event data.","content":{"text/plain":{"schema":{"type":"string"}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
