Player
read
Returns every matching row instead of just the first. See get vs read for details. Most filter arguments also accept an array of values, matched with an OR.
Request
GET
https://api.srating.io/v1/player/read?player_id=dff6dce2-ad5a-11ed-9185-b6be2f39279c&player_id=e27545f0-ad5a-11ed-9185-b6be2f39279cPOST
fetch('https://api.srating.io/v1', {
'method': 'POST',
'headers': {
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY',
},
'body': JSON.stringify({
'class': 'player',
'function': 'read',
'arguments': {
'player_id': [
'dff6dce2-ad5a-11ed-9185-b6be2f39279c',
'e27545f0-ad5a-11ed-9185-b6be2f39279c',
],
}
}),
}).then(response => {
return response.json();
}).then(json => {
console.log(json);
return json;
}).catch(error => {
console.log(error);
});Response
{
"dff6dce2-ad5a-11ed-9185-b6be2f39279c": {
"player_id": "dff6dce2-ad5a-11ed-9185-b6be2f39279c",
"first_name": "Zach",
"last_name": "Edey",
"position": "C",
"height": "7-4",
"weight": null,
"number": "15",
"hometown": null,
"college": null,
"draft_year": null,
"draft_round": null,
"draft_number": null,
"guid": null,
"deleted": 0
},
"e27545f0-ad5a-11ed-9185-b6be2f39279c": {
"player_id": "e27545f0-ad5a-11ed-9185-b6be2f39279c",
"first_name": "Fletcher",
"last_name": "Loyer",
"position": "G",
"height": "6-2",
"weight": null,
"number": "2",
"hometown": null,
"college": null,
"draft_year": null,
"draft_round": null,
"draft_number": null,
"guid": null,
"deleted": 0
}
}