API - National Records
Retrieve a country's national records.
URL
Type | URL |
---|---|
XML | https://speedskatingresults.com/api/xml/country_records.php |
JSON | https://speedskatingresults.com/api/json/country_records.php |
Parameters
Name | Description |
---|---|
country |
The country's three-character IOC code |
gender |
Gender (optional) - f (female) or m (male) If specified, limits the returned records to those for women or men. |
age |
Age category (optional) - jr (junior) or sr (senior) If specified, limits the returned records to those for juniors or seniors. |
distance |
Distance (optional) When the distance parameter is omitted, the world records for all distances are returned. Specify a value (500, 1000, 1500, 3000, 5000 or 10000) for the distance parameter to retrieve the world record for that distance only. |
XML
Element | Description |
---|---|
nrs |
The list of national records Attributes
|
record |
A national record Attributes
|
distance | Race distance |
time | Finishing time |
date | Race date (YYYY-MM-DD) |
location | Race location |
skater | The record holder |
id | The skater's ID |
familyname | The skater's family name |
givenname | The skater's given name |
familynative | The skater's family name in native language (if available) |
givennative | The skater's given name in native language (if available) |
country | The skater's IOC country code |
Example
API Query: https://speedskatingresults.com/api/xml/country_records.php?country=NOR&distance=500
<nrs country="NOR">
<record gender="f" age="sr">
<distance>500</distance>
<time>38,40</time>
<date>2000-01-29</date>
<location>Calgary (CAN)</location>
<skater>
<id>308</id>
<familyname>Høiseth</familyname>
<givenname>Edel Therese</givenname>
<country>NOR</country>
</skater>
</record>
<record gender="m" age="sr">
<distance>500</distance>
<time>34,73</time>
<date>2013-01-27</date>
<location>Salt Lake City (USA)</location>
<skater>
<id>3565</id>
<familyname>Hvammen</familyname>
<givenname>Espen Aarnes</givenname>
<country>NOR</country>
</skater>
</record>
<record gender="f" age="jr">
<distance>500</distance>
<time>39,05</time>
<date>2011-02-12</date>
<location>Calgary (CAN)</location>
<skater>
<id>4625</id>
<familyname>Bøkko</familyname>
<givenname>Hege</givenname>
<country>NOR</country>
</skater>
</record>
<record gender="m" age="jr">
<distance>500</distance>
<time>35,66</time>
<date>2012-01-28</date>
<location>Calgary (CAN)</location>
<skater>
<id>8242</id>
<familyname>Lorentzen</familyname>
<givenname>Håvard Holmefjord</givenname>
<country>NOR</country>
</skater>
</record>
</nrs>
JSON
Key | Description |
---|---|
country | The IOC country code |
records | The collection of national records |
gender | f (women's record) or m (men's record) |
age | sr (senior) or jr (junior) record |
distance | Race distance |
time | Finishing time |
date | Race date (YYYY-MM-DD) |
location | Race location |
skater | The record holder |
id | The skater's ID |
familyname | The skater's family name |
givenname | The skater's given name |
familynative | The skater's family name in native language (if available) |
givennative | The skater's given name in native language (if available) |
country | The skater's IOC country code |
Example
API Query: https://speedskatingresults.com/api/json/country_records.php?country=NOR&distance=500
"country":"NOR",
"records":[
{"gender":"f", "age":"sr", "distance":500, "time":"38,40", "date":"2000-01-29", "location":"Calgary (CAN)", "skater":{"id":308, "familyname":"Høiseth", "givenname":"Edel Therese", "country":"NOR"}},
{"gender":"m", "age":"sr", "distance":500, "time":"34,73", "date":"2013-01-27", "location":"Salt Lake City (USA)", "skater":{"id":3565, "familyname":"Hvammen", "givenname":"Espen Aarnes", "country":"NOR"}},
{"gender":"f", "age":"jr", "distance":500, "time":"39,05", "date":"2011-02-12", "location":"Calgary (CAN)", "skater":{"id":4625, "familyname":"Bøkko", "givenname":"Hege", "country":"NOR"}},
{"gender":"m", "age":"jr", "distance":500, "time":"35,66", "date":"2012-01-28", "location":"Calgary (CAN)", "skater":{"id":8242, "familyname":"Lorentzen", "givenname":"HÃ¥vard Holmefjord", "country":"NOR"}}
]
}
Example Web Page
The sample web page provides a very basic example of how XML data may be retrieved from SpeedskatingResults.com. It makes use of the jQuery library to handle the the interaction with the API.
National Records Example Page (XML)
National Records Example Page (JSON)
HTML Code (XML)
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
body {font-family: 'Lucida Grande', Verdana, Arial, sans-serif; padding: 5px;
font-size: 10pt;}
table.records {margin: 1em; border-collapse: collapse; }
table.records td {padding: .2em .5em; }
table.records td.distance {width: 8em; font-weight: bold;}
table.records td.time {width: 5em; text-align: right;}
table.records td.date {}
table.records td.location {width: 10em;}
table.records td.skater {width: 15em;}
a {color: navy; text-decoration: none; font-weight: bold;}
a:visited {font-weight: normal;}
a:hover {color: crimson;}
</style>
<title>API Example - National Records</title>
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$.ajax({
type: "GET",
url: "https://speedskatingresults.com/api/xml/country_records.php",
data: "country=NOR&age=sr",
dataType: "xml",
success: function(xml) {
$(xml).find('record').each(function() {
var recordClass = ($(this).attr('gender') == "m") ? "Men" : "Women";
var distance = $(this).find('distance').text()+"m";
var time = $(this).find('time').text();
var date = $(this).find('date').text();
var location = $(this).find('location').text();
var skater = $(this).find('givenname').text() + " " +
$(this).find('familyname').text();
$('<tr></tr>').html('<td class="distance">'+recordClass+' '+distance+
'</td><td class="time">'+time+'</td><td class="date">'+date+
'</td><td class="location">'+location+
'</td><td class="skater">'+skater+'</td>').appendTo('#nrs');
});
}
});
});
</script>
</head>
<body>
<h1>Norway (NOR) - National Records</h1>
<table id="nrs" class="records">
</table>
<p><a href="https://speedskatingresults.com/index.php?p=11&n=31">Records</a> from
<a href="https://speedskatingresults.com">SpeedskatingResults.com</a></p>
</body>
</html>
HTML Code (JSON)
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
body {font-family: 'Lucida Grande', Verdana, Arial, sans-serif; padding: 5px;
font-size: 10pt;}
table.records {margin: 1em; border-collapse: collapse; }
table.records td {padding: .2em .5em; }
table.records td.distance {width: 8em; font-weight: bold;}
table.records td.time {width: 5em; text-align: right;}
table.records td.date {}
table.records td.location {width: 10em;}
table.records td.skater {width: 15em;}
a {color: navy; text-decoration: none; font-weight: bold;}
a:visited {font-weight: normal;}
a:hover {color: crimson;}
</style>
<title>API Example - National Records</title>
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$.ajax({
type: "GET",
url: "https://speedskatingresults.com/api/json/country_records.php",
data: "country=NOR&age=sr",
dataType: "json",
success: function(data) {
data.records.forEach(function(r) {
var recordClass = (r.gender == "m") ? "Men" : "Women";
var distance = r.distance + "m";
var skater = r.skater.givenname + " " + r.skater.familyname;
$('<tr></tr>').html('<td class="distance">'+recordClass+' '+distance+
'</td><td class="time">'+r.time+
'</td><td class="date">'+r.date+
'</td><td class="location">'+r.location+
'</td><td class="skater">'+skater+'</td>').appendTo('#nrs');
});
}
});
});
</script>
</head>
<body>
<h1>Norway (NOR) - National Records</h1>
<table id="nrs" class="records">
</table>
<p><a href="https://speedskatingresults.com/index.php?p=11&n=31">Records</a> from
<a href="https://speedskatingresults.com">SpeedskatingResults.com</a></p>
</body>
</html>
Native Language Names