# Tools to extract live data

* The grabber is an HTML file and runs in a browser tab.&#x20;
* Adjust the grabber in an editor with the settings in the tables.&#x20;
* The grabber pulls one specific parameter from the \*/current API.&#x20;
* The \*/current API must be activated and switched on.
* Monochrome background.

{% content-ref url="/pages/-MZHPcWTCiAwX6xi9dt6" %}
[\*/current, location data](/api/current.md)
{% endcontent-ref %}

### Basic grabber

{% hint style="info" %}
[<mark style="color:blue;">**Download the basic grabber for your usage.**</mark>](https://drive.google.com/uc?id=14sVBD9RNkzpkP5FxbxPK01ZrGZzijrFD\&export=download)\
The file (grabCurrentAPI.html) is set to call a sample event with infinite real-time data.
{% endhint %}

{% tabs %}
{% tab title="deviceIds" %}
**Options 1 to 3:** With set `deviceIds` or with set `startNumbers` or with set `showLeaders` the grabber shows the parameter for one or for more specific devices instead of the list with all devices.&#x20;
{% endtab %}

{% tab title="refDeviceId" %}
**Options 4 and 5:** Set `refDeviceId` or `refStartNumber` for calculation with reference device instead of the leader device.\
`gapAverage`, `gap`, `gapChase` and `gapDistance` are calculated for the leader (device with smallest `toFinish`) by default.&#x20;
{% endtab %}
{% endtabs %}

<figure><img src="/files/hZrjGlURQ6UnBKeDOQns" alt=""><figcaption><p><code>deviceIds = "6336f41309be310001a58976"</code> to show one participant only</p></figcaption></figure>

<figure><img src="/files/Cin7XzK8CnYN5nx41uM8" alt=""><figcaption><p><code>refDeviceId = "6336f41309be310001a58971"</code> to show <code>gapDistance</code> to team PLAN:LOS</p></figcaption></figure>

<figure><img src="/files/GfnIRWzy0shDvtJvl091" alt=""><figcaption><p>Without <code>deviceIds</code>: list of all participants </p></figcaption></figure>

<table><thead><tr><th width="191">Field</th><th>Description [unit]</th><th>Sample</th></tr></thead><tbody><tr><td><code>eventId</code></td><td>Id of the tracking map <br>Add optional query parameters, also</td><td><code>"6336f41309be310001a5894b"</code> or<br><code>"6336f41309be310001a5894b?interpolation=false&#x26;currentSpeedDuration=60"</code></td></tr><tr><td><code>outputData</code></td><td>Parameter to be shown in browser tab</td><td><code>"gapAverage"</code> or <code>"speed"</code></td></tr><tr><td><code>textBehind</code></td><td>Add text behind the unit</td><td><code>"Distance to go"</code> or <code>"🏁"</code></td></tr><tr><td><code>withStarterName</code></td><td>Show or hide the name of the participant</td><td><code>true</code> or <code>false</code></td></tr><tr><td><code>withStartNumber</code></td><td>Show or hide the race number of the participant</td><td><code>true</code> or <code>false</code></td></tr><tr><td><code>pollingRate</code></td><td>Time beween polling in [s]</td><td><code>2</code> or <code>15</code></td></tr><tr><td><code>deviceIds</code></td><td><strong>Option 1</strong>: ids of one or more devices, values of these devices only are pulled, <code>[]</code> shows all devices</td><td><code>[]</code> or <code>["6336f41309be310001a58976"]</code> or <code>["6336f41309be310001a58975", "6336f41309be310001a58973"]</code></td></tr><tr><td><code>startNumbers</code></td><td><strong>Option 2</strong>: Race numbers of one or more devices, values of these devices only are pulled, <code>[]</code> shows all devices</td><td><code>[]</code> or <code>["051"]</code> or <code>["051", "050"]</code></td></tr><tr><td><code>showLeaders</code></td><td><strong>Option 3</strong>: Number of shown leading devices determined of <code>fromStart</code>; <code>0</code> shows all devices</td><td><code>0</code> or <code>1</code> or <code>5</code> or <code>10</code></td></tr><tr><td><code>refDeviceId</code></td><td><strong>Option 4</strong>: id of a reference for calculation of <code>gapAverage</code>, <code>gap</code>, <code>gapChase</code> and <code>gapDistance</code></td><td><code>"6336f41309be310001a58977"</code></td></tr><tr><td><code>refStartNumber</code></td><td><strong>Option 5</strong>: Bib of a reference for calculation of <code>gapAverage</code>, <code>gap</code>, <code>gapChase</code> and <code>gapDistance</code></td><td><code>"053"</code></td></tr></tbody></table>

#### Set imperial units

<figure><img src="/files/boO4lnffIRV4bEvsfXBm" alt=""><figcaption><p>Open grabber tool in an editor</p></figcaption></figure>

In order to show `speed` values as miles per hour replace line 50 with:

```html
speed: { value: 2.2369356, unit: "mph", sorting: "DESC" },
```

&#x20;In order to show `speedRaw` values as miles per hour replace line 51 with:

```html
speedRaw: { value: 2.2369356, unit: "mph", sorting: "DESC" },
```

In order to show `fromStart` values as miles replace line 52 with:

```
fromStart: { value: 0.000621371, unit: "mile", sorting: "DESC" }
```

In order to show `toFinish` values as miles replace line 53 with:

```
toFinish: { value: 0.000621371, unit: "mile", sorting: "DESC" }
```

### Drafting tool

{% hint style="info" %}
[<mark style="color:blue;">**Download the drafting tool for your usage.**</mark>](https://drive.google.com/uc?id=1HHA8DAGreR5sLF4W3P9DXcnitFt5_LQV\&export=download)\
The file (grabCurrentAPIDrafting.html) is set to call a sample event with infinite real-time data.
{% endhint %}

* The table sorts all devices in ascending order according to the `toFinish` parameter.&#x20;
* "To previous"-column shows the distance to the device that moves ahead.&#x20;
* "Draft time"-column starts counting the time when the device is moving within the draft zone (`alertValue` in \[m] set distance to the device ahead).&#x20;
* "Drafts"-column detects a draft when drafting takes longer than the set `alertTime` in \[s]. &#x20;
* Hover over the number of drafts for additional information.

<figure><img src="/files/6dJ28RMh2EINefPWovq8" alt=""><figcaption><p>Christoph overtakes Konrad monitored by the drafting tool. At 14:27:31 Christoph was moving for 44s in the draft zone behind Konrad.</p></figcaption></figure>

### Spotter tool

{% hint style="info" %}
[<mark style="color:blue;">**Download the spotter tool for your usage.**</mark>](https://drive.google.com/uc?id=1gKwfzmfXn-VVGpws1mDMW5wPjTuUinHL\&export=download)\
The file (spotter.html) is set to call a sample event with infinite real-time data.
{% endhint %}

* Define up to three different spots (distance from start in m).&#x20;
* The table sorts participants in the sensitive range (`rangeBeforeSpot` and `rangeAfterSpot`) coming closer to the spot.&#x20;

<figure><img src="/files/1NRCnGB3LZOBxQn6BinG" alt=""><figcaption><p>Real-time information from anywhere on the race-course e.g. for the speaker.</p></figcaption></figure>


---

# 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/grabber.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.
