Market Lines
read
Returns every matching row instead of just the first. See get vs read for details.
A game has more than one odds row over time as the line moves -- pass just game_id (no odds_id) to get all of them, current and historical.
Request
GET
https://api.srating.io/v1/odds/read?game_id=40fd1ac3-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': 'odds',
'function': 'read',
'arguments': {
'game_id': '40fd1ac3-5dd9-11ef-9222-9667e47de71a',
}
}),
}).then(response => {
return response.json();
}).then(json => {
console.log(json);
return json;
}).catch(error => {
console.log(error);
});Response
{
"1a2c3d4e-5f70-11ef-9222-9667e47de71a": {
"odds_id": "1a2c3d4e-5f70-11ef-9222-9667e47de71a",
"game_id": "40fd1ac3-5dd9-11ef-9222-9667e47de71a",
"money_line_away": 750,
"money_line_home": -3200,
"spread_away": 12.5,
"spread_home": -12.5,
"over": 130,
"under": 145,
"date_of_entry": "2023-04-02T08:00:00.000Z",
"live": 0,
"current": 0,
"deleted": 0
},
"209de407-5f70-11ef-9222-9667e47de71a": {
"odds_id": "209de407-5f70-11ef-9222-9667e47de71a",
"game_id": "40fd1ac3-5dd9-11ef-9222-9667e47de71a",
"money_line_away": 828,
"money_line_home": -3453,
"spread_away": 13,
"spread_home": -11,
"over": 129.5,
"under": 145.5,
"date_of_entry": "2023-04-03T08:00:00.000Z",
"live": 1,
"current": 1,
"deleted": 0
}
}