Games / Scores

getOdds

This will return the current market line data for a specified game_id.

See market lines sections to grab pre game or more historical data.

Required arguments

game_id

Request

GET

https://api.srating.io/v1/game/getOdds?game_id=40fd1ac3-5dd9-11ef-9222-9667e47de71a

POST

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': 'getOdds',
    '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

{
  "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
}

On this page