Getting your Contest History
If you want to access information from past contests you have entered use http://api.hxro.io/hxroapi/api/ContestEntry/by-user. It will return an array of the contests you previously entered.
const apiToken ="api token"; // API Token obtained from Hxro Account
const https = require('https');
const options = {
hostname: 'api.hxro.io',
port: 443,
path: '/hxroapi/api/ContestEntry/by-user',
method: 'GET',
qs: { take: '10' }, //The number of past contests you want returned
headers: {
'Ocp-Apim-Subscription-Key': apiToken
}
}
const req = https.request(options, (res) => {
var arr = "";
res.on('data', (part) => {
arr += part;
});
res.on('end', () => {
var seriesArr = JSON.parse(arr)
for (i = 0; i <= seriesArr.length; i++) {
console.log(seriesArr[i]);
}
});
});
req.on('error', (e) => {
console.error(e);
});
req.end();
Example of a contest from a successful response
{
"contestType": 'OverUnder',
"minFee": "10",
"moonPool":"double",
"rektPool": "double",
"id": 'contestID',
"shortId": 'string',
"name": 'BTC/USD',
"isSimulating": 'bool',
"seriesId": 'seriesId',
"status": 'Closed',
"prizePool": "double",
"rake": 'int',
"duration": '00:15:00',
"contestLiveTime": '2020-01-28T20:15:00+00:00',
"contestOpenTime": '2020-01-28T17:45:00+00:00',
"contestCloseTime": '2020-01-28T20:30:00+00:00',
"minPlayers":"3",
"assetType": 'string',
"instrumentPrices": "[ { instrument: [Object], livePrice: [Object], closePrice: [Object] } ]"
}
Updated almost 3 years ago