How to export presets via API

Did you know that you can export any preset to publish it in another website or document (Excel, Google Docs, Google Sheets…)?

To export a preset using the API you have to know how the Copérnico’s API call is formed so that you can apply it to any document or web.

There is one constant element that is always the same: https://public-api.copernico.cloud/api/races/

And a variable element: {race_id}/preset/{login email}:::{preset name}/{event name}

Joining these elements together: https://public-api.copernico.cloud/api/races/{race_id}/preset/{login email}:::{preset name}/{event name}

 

Where:

  • race_id: is the race identifier that you can see in the URL displayed in Copernicus. For example: carrera-de-la-mujer-valencia-2020.
  • login email: is your email or the Copérnico’s account email in which the preset is saved.
  • preset name: is the name of the preset. It has to be identical to the name of the preset you want to show.
  • event name: is the name of the event from which you want to extract the information. It must be identical to the event name.

An example: https://public-api.copernico.cloud/api/races/carrera-de-la-mujer-valencia-2020/preset/timer1@timingsense.com:::Mujer/6K

If you have a .json viewer installed, copying and pasting the URL into a browser would load information like the one you see:

 

 

❗Remember that the more complex the preset is, i.e. the more data it has to show, the slower it will be to process the information where you want to show it (another website, excel…). Also, there is a limitation of 6 Mb, if your preset exceeds this size it will not work. If it doesn’t work, consider limiting the preset using filters or removing columns.
 
💡The times are shown in milliseconds so you will have to transform this data to show times in the format you like, for example, HH:MM:SS
 
💡If you work with Excel or Google Sheets, you can use multiple APIs and append queries to display all events in a single document.
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.