# Public API

There is a public api for liveresults if you wish to use the data in your own applications

**Json API call**  
https://liveresults.co.nz/api/public/10/results/{competition\_id}?date=YYYY-MM-DD&amp;timestamp={timestamp}

**Parameters**  
competition\_id eg, 7e4439a4-6c67-40d0-b99f-d0940bb1c866 (we will supply the correct id, once the draw is finalised)   
date = the date of all the races you want to retrieve must be YYYY-MM-DD   
timestamp = current timestamp to stop the api from caching results, can be any format

These Dates will work with the above competition

- 2018-01-15
- 2018-01-16
- 2018-01-17
- 2018-01-18
- 2018-01-19
- 2018-01-20

**NZ Waka Ama Sprint Nationals 2018**  
https://liveresults.co.nz/136

**Example url**  
https://liveresults.co.nz/api/public/10/results/7e4439a4-6c67-40d0-b99f-d0940bb1c866?date=2018-01-15&amp;timestamp=123456

**Disqualification**

If there is a disqualification, you will see data like this

```JSON
"placing_numeric": null,
"placing_text": "DQ",
```

If there is no disqualification then it will look like this

```JSON
"placing_numeric": 2,
"placing_text": null,
```

**Medals**   
Medals are indicated using a numeric index

```JSON
"medal": 2,
```

1 = Gold, 2 = Silver, 3 = Bronze

**Race State**   
Each race can have a number of different states

```JSON
"race_state": "RESULT",
```

<table border="1" id="bkmrk-result-race-is-finis" style="border-collapse: collapse; width: 100%;"><tbody><tr><td style="width: 50%;">RESULT</td><td style="width: 50%;">Race is finished with placings and times</td></tr><tr><td style="width: 50%;">SCRATCHED</td><td style="width: 50%;">Race was scratched, no results</td></tr><tr><td style="width: 50%;">PROGRESSION</td><td style="width: 50%;">Lanedraw for repechage, semi, final</td></tr><tr><td style="width: 50%;">LANEDRAW</td><td style="width: 50%;">Lanedraw for preliminary heats</td></tr><tr><td style="width: 50%;">PROTEST</td><td style="width: 50%;">Lanedraw is under protest, do not display the results</td></tr></tbody></table>

**Errors**   
If you don't pass the correct parameters, you will get an error json

```JSON
{"success":false,"data":null, "errors":["error message text"]}
```