Games / Scores
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/game/read?game_id=40fd1ac3-5dd9-11ef-9222-9667e47de71a&game_id=41128f5e-5dd9-11ef-9222-9667e47de71aPOST
fetch('https://api.srating.io/v1', {
'method': 'POST',
'headers': {
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY',
},
'body': JSON.stringify({
'class': 'game',
'function': 'read',
'arguments': {
'game_id': [
'40fd1ac3-5dd9-11ef-9222-9667e47de71a',
'41128f5e-5dd9-11ef-9222-9667e47de71a',
],
}
}),
}).then(response => {
return response.json();
}).then(json => {
console.log(json);
return json;
}).catch(error => {
console.log(error);
});Response
{
"40fd1ac3-5dd9-11ef-9222-9667e47de71a": {
"game_id": "40fd1ac3-5dd9-11ef-9222-9667e47de71a",
"organization_id": "f1c37c98-3b4c-11ef-94bc-2a93761010b8",
"division_id": "bf602dc4-3b4a-11ef-94bc-2a93761010b8",
"season": 2023,
"away_team_id": "885557ec-8549-11ed-bf01-5296e1552828",
"home_team_id": "75a9cb12-8549-11ed-bf01-5296e1552828",
"network": "CBS",
"away_score": 67,
"home_score": 69,
"status": "final",
"current_period": "Final",
"clock": "0:00",
"clock_last_updated_at": "2024-10-18T15:43:45.000Z",
"start_date": "2023-04-03T00:00:00.000Z",
"start_datetime": "2023-04-03T21:20:00.000Z",
"start_timestamp": 1680571200,
"updated_at": "2023-04-03T23:38:01.000Z",
"attendance": 72423,
"neutral_site": 1,
"is_conf_game": 0,
"boxscore": 1,
"guid": "0343dc2d-1021-43cd-956a-6aef5b9ed2d4",
"deleted": 0
},
"41128f5e-5dd9-11ef-9222-9667e47de71a": {
"game_id": "41128f5e-5dd9-11ef-9222-9667e47de71a",
"organization_id": "f1c37c98-3b4c-11ef-94bc-2a93761010b8",
"division_id": "bf602dc4-3b4a-11ef-94bc-2a93761010b8",
"season": 2023,
"away_team_id": "87c83148-8549-11ed-bf01-5296e1552828",
"home_team_id": "75a9cb12-8549-11ed-bf01-5296e1552828",
"network": "BTN",
"away_score": 58,
"home_score": 71,
"status": "final",
"current_period": "Final",
"clock": "0:00",
"clock_last_updated_at": "2023-02-05T21:12:10.000Z",
"start_date": "2023-02-05T00:00:00.000Z",
"start_datetime": "2023-02-05T19:00:00.000Z",
"start_timestamp": 1675623600,
"updated_at": "2023-02-05T21:12:10.000Z",
"attendance": 14804,
"neutral_site": 0,
"is_conf_game": 1,
"boxscore": 1,
"guid": "3b6f2a1c-4d9e-4f7a-8e0b-1a2c3d4e5f6a",
"deleted": 0
}
}