LogoLogo
UpdatesGPS trackersLoginFree trial
  • Welcome
  • Quick start guide
  • Provide live tracking
    • Features of visualization
    • Leaderboard
    • Monitor
    • Group and stages
    • Embed interactive content
    • Keys and passcode
    • Activity upload
    • Deep links on tracking app
    • Shadowtrack and mapping
  • Data APIs for live geodata
    • */current, location data
    • */distance and locations
    • */times, reads and raw data
    • */ranks, ranking and results
    • */starters, athlete data
    • */geo, geo elements
    • Tools to extract live data
  • Import participant data
    • Import with API, automatically
      • Generic import
      • RACE RESULT import
    • Import with CSV file
  • Tracker management
    • Add GPS trackers
    • Add RACE RESULT readers
    • Add devices to event
    • Send messages
    • Compose messages
    • User access to devices
    • Manage SIM cards
  • Hardware for live tracking
    • Configure GPS tracker
      • Remote configuration
      • Physical configuration
    • Update firmware of GPS tracker
    • Configuring trackers for increased autonomy
    • Track Box forwarding
    • Insiders GPS trackers
    • Prepare smartphone
    • Using GPS trackers On-Site
    • Debug tracking devices
  • Predictive tracking with reads from race timing
    • RACE RESULT
    • Other timing system
      • ChronoTrack forwarder
      • MyLaps forwarder
  • Integrations
    • Wiclax
  • Map settings
    • External map layer
  • Export data from RACEMAP
    • Hosted elevation service
    • Hosted loads information
    • Download leaderboard CSV
    • Download recorded GPX
Powered by GitBook
LogoLogo

Legacy

  • Contact
  • Terms of use
  • Privacy Policy
  • Imprint

About Racemap

  • Pricing
  • About Us
  • Apps
  • Events

Follow us

  • facebook
  • youtube
  • linkedin
  • github

Maps: ©Mapbox ©OpenStreetMap ©RACEMAP

On this page
  • Request
  • Response
  • Smoothen values in the API
  • Subsequent calculations
  1. Data APIs for live geodata

*/current, location data

API with real-time geolocation data, for TV graphics, speed monitor, gap time calculation, ...

PreviousData APIs for live geodataNext*/distance and locations

Last updated 1 month ago

Request

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

Live sample Corresponding map

Optional query parameters

Set various query parameters according to your need when calling the API endpoint, e.g. to smoothen gap values.

  • The Id of a chosen reference participant for calculation gapAverage, gap, gapChase and gapDistance.

  • String for API ?deviceId=66bf4318d1c783279d183e3d

  • Sample

  • The startNumber of a chosen reference device for calculation gapAverage, gap, gapChase and gapDistance.

  • String for API ?startNumber=053

  • Sample:

  • true or false

  • Default: true

  • The raw geodata from the GPS devices is converted into a grid. The interpolation interval specifies the time difference between consecutive coordinates in this grid.

  • Default interpolation interval: 10 sec. Adjust the interpolation interval in the advanced settings of the tracking map.

  • Sample

  • Duration in seconds to average the speed values in the API. If currentSpeedDuration is set to 120, then the average speed of the last 2 minutes is calculated.

  • Default: 300 seconds

  • Maximum value: 1800

  • String for API ?currentSpeedDuration=120

  • Sample

  • Duration in seconds from the timestamp recording a location until this location is provided in the API.

  • Default: 20, according to "Live delay time" in advanced settings of the tracking map. The set liveDelay query parameter processes the values in the API without impact on the visualization.

  • Maximum value: 1800

  • String for API ?liveDelay=200

  • Sample

You can call the same API endpoint with different query parameters at the same time. You can also combine queries with & in one call eg.

Response

Event object

Field
Description [unit]
Sample

name

Name of event

"100km Duathlon"

location

Location

"Dresden"

startTime

Start time in UTC

"2022-01-24T15:00:10.000Z"

endTime

End time in UTC

"2022-01-24T22:59:45.000Z"

starters

Array for participant objects

Participant object

Field
Description [unit]
Sample

id

Unique Racemap ID of participant

"61a2122f181c0a0ff7b53765"

name

Name

"CLV Megware"

startNumber

Bib number

"001"

importId

"UniqueImportId_1" or null if no importId exists

current

Object for real-time location data

null if no locations within startTime and endTime

device

Object for device information

null if device is not used in tracker management

Current object

  • current-object provides the latest data

  • (*) calculated only for events with a shadowtrack, projection of device locations on the shadowtrack within 100 m distance from shadowtrack

  • gapAverage, gap, gapChase and gapDistance are calculated for the leader by default. Leader: device with the smallest toFinish value. Attention: Each time a leader reaches the finish the device closest to the finish becomes the new leader. The speed value of the next leader may impact fluctuating gap values. Reference: If query with deviceId or startNumber, then calculation with reference values instead of leader.

Field
Description [unit]
Sample

time

Timestamp in UTC when geolocation was recorded, if interpolation=true then linear interpolation between the latest two points

"2022-01-24T16:33:47.012Z"

lng

Current longitude of participant

13.727678288

lat

Latitude

50.976534023

elv

Altitude above zero on shadowtrack [m]

85.2 or null if device is not on shadowtrack

speed

Average speed [m/s] depending on currentSpeedDuration.

If event has a shadowtrack, than projection on shadowtrack.

If event without shadowtrack, than same value as speedRaw.

5.2727

speedRaw

Average speed [m/s] depending on currentSpeedDuration. Calculated from two interpolated raw coordinates. Note: Curves are cut off between the two coordinates

4.9574

fromStart *

Distance from first geolocation of shadowtrack along shadowtrack [m]

9962.6826

toFinish *

Distance to last geolocation of shadowtrack along shadowtrack [m]

89097.3173

distanceToShadowTrack *

Distance from shadowtrack [m] if more than 100 m

175.9

eta *

Estimated time of arrival [s], time to reach last geolocation of shadowtrack, prediction with speed

16897.77

gapAverage *

Duration [s] to reach current toFinish value of the leader, prediction with leader's average speed for current segment between device and leader.

2360.36 or null if reference is behind device, toFinish of reference is greater than toFinish of device

gap *

Duration [s] to reach current toFinish value of the leader, prediction with speed value of leader, if speed < 1 km/h then prediction with default speed value of the event,

1205.68 or -581.20 if reference is behind device

gapChase *

Duration [s] to reach current toFinish value of the leader, prediction with speed value of device, if speed < 1 km/h then prediction with default speed value of the event

968.81 or -73.02 if reference is behind device

gapDistance *

Distance [m] to reach current toFinish value of the leader.

3364.91 or -554.03 if reference is behind device

lngSt *

Current longitude of participant pinned on the shadowtrack

13.805551232

latSt *

Latitude

50.931515901

Device object

The device object provides additional information for GPS trackers, that are used in tracker management.

Field
Description [unit]
Sample

externalId

Unique id of tracking device, can be IMEI or transponder id or App id depending on the type of device.

"4106050246" or "860599002489748" or "RRPing_ZDKAR32" or "d40ad78e-b929-4224-967e-62ca93effc68"

battery

Charge level [%] of device.

3, 52, 99

online

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.

true or false

lastLocationGpsFix

Showing whether the device had a GPS fix when recording the latest coordinate.

true or false

lastLocationAt

Timestamp in UTC when the latest coordinate was recorded. Note: If interpolation=true lastLocationAt can differ from time.

"2022-01-24T16:33:47.012Z"

deviceId

Unique id of the tracking device in RACEMAP.

"5b6ac1561c6a700020a00010"

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.

Sample response

{
  "name": "Sample live API | 100km-Duathlon",
  "location": "🇩🇪 Dresden",
  "startTime": "2024-08-16T12:05:07Z",
  "endTime": "2024-08-16T16:04:31Z",
  "starters": [
    {
      "id": "66bf4318d1c783279d183e3b",
      "name": "Wolfsrudel Mädels",
      "startNumber": "053",
      "importId": null,
      "current": {
        "time": "2024-08-16T12:34:00Z",
        "lng": 13.73032,
        "lat": 51.00622,
        "elv": 218,
        "speed": 2.94017094017094,
        "speedRaw": 1.6961880220903458,
        "fromStart": 5340,
        "toFinish": 93720,
        "distanceToShadowTrack": 4.759105903942731,
        "eta": 31875.697,
        "gapAverage": 900,
        "gap": 359.005,
        "gapChase": 387.732,
        "gapDistance": 1140,
        "lngSt": 13.805551232735626,
        "latSt": 50.93151590177507
      },
      "device": {
        "externalId": "ecbbaaa4-c968-46db-9b07-afc842387e27",
        "battery": 40,
        "online": false,
        "lastLocationGpsFix": true,
        "lastLocationAt": "2024-01-05T13:45:24Z"
        "deviceId": "5b6ac1561c6a700020a00135"
      }
    },
    {
      "id": "66bf4318d1c783279d183e1d",
      "name": "Lokomotive Prießnitzgrund",
      "startNumber": "034",
      "importId": null,
      "current": {
        "time": "2024-08-16T12:34:00Z",
        "lng": 13.70232,
        "lat": 51.02038,
        "elv": 204,
        "speed": 1.435897435897436,
        "speedRaw": 1.1986131178696222,
        "fromStart": 890,
        "toFinish": 98170,
        "distanceToShadowTrack": 6.054100654596742,
        "eta": 68368.392,
        "gapAverage": 2280,
        "gap": 1760.386,
        "gapChase": 3893.035,
        "gapDistance": 5590,
        "lngSt": 13.822277523839235,
        "latSt": 50.932650793111506
      },
      "device": null
    },
    {
      "id": "66bf4318d1c783279d183e51",
      "name": "Dude, where's the finish line?",
      "startNumber": "039",
      "importId": null,
      "current": {
        "time": "2024-08-16T12:27:11.254Z",
        "lng": 13.70364238,
        "lat": 51.02187489866667,
        "elv": 200,
        "speed": 2.1403508771929824,
        "speedRaw": 1.8131895855527116,
        "fromStart": 665.016,
        "toFinish": 98394.984,
        "distanceToShadowTrack": 11.873080816329555,
        "eta": 45971.426,
        "gapAverage": 1338,
        "gap": 1650.853,
        "gapChase": 1999.667,
        "gapDistance": 4279.989333333331,
        "lngSt": 13.818931968149625,
        "latSt": 50.93166731504501
      },
      "device": {
        "externalId": "999994106050526",
        "battery": 40,
        "online": false,
        "lastLocationGpsFix": true,
        "lastLocationAt": "2023-07-02T12:37:51Z",
        "deviceId": "5b3a7b3ebd61c4491dcfcef4"
      }
    }
  ]
}

Smoothen values in the API

The below parameters and settings smoothen the values in the API.

  • Call the gapAverage value instead of gap value

  • Interpolation=true

  • Query parameter currentSpeedDuration

Use gapAverage instead of gap if you need smoothly changing gap values e.g. for TV production.

Comparison
interpolation=true
interpolation=false

Use case

Values changing smoothly with each call

Latest values with a minimum delay

Calculation

Linear interpolation between latest coordinate in the time grid and the coordinate before

Latest coordinate without interpolation from the time grid

Refresh rate

Up to 1 sec

Report interval of GPS device

Recommended interpolation interval

report interval of GPS device

report interval of GPS device

Recommended liveDelay

5 sec + interpolation interval

5 sec minimum

Increase the currentSpeedDuration query parameter to smooth the speed values in the API.

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

User-defined ID with imported participant data, (importId) or (Id)

https://racemap.com/api/data/v1/66bf4318d1c783279d183dd3/current
https://racemap.com/player/100KmDuathlon2018_API-live-sample
https://racemap.com/api/data/v1/66bf4318d1c783279d183dd3/current?deviceId=66bf4318d1c783279d183e3d
https://racemap.com/api/data/v1/66bf4318d1c783279d183dd3/current?startNumber=053
https://racemap.com/api/data/v1/66bf4318d1c783279d183dd3/current?interpolation=false
https://racemap.com/api/data/v1/66bf4318d1c783279d183dd3/current?currentSpeedDuration=120
https://racemap.com/api/data/v1/66bf4318d1c783279d183dd3/current?liveDelay=200
https://racemap.com/api/data/v1/66bf4318d1c783279d183dd3/current?liveDelay=600&interpolation=false&currentSpeedDuration=600&deviceId=66bf4318d1c783279d183e3d
Tracker management
Generic API
RACE|RESULT API
the average speed of the reference device smoothens the gapAverage values in the API