API Overview

JsonOdds API provides restful access to odds and results for those events. JsonOdds features moneyline, total, and point spread odds, results, and live scores.

Gaining Access

Access to the API is restricted to only users who have an API Key.

Sports

JsonOdds supports Soccer, NFL, NCAAF, NCAAB, NBA, MLB, NHL, Tennis, WNBA, MMA, CFL, Golf, Rugby, KHL, AHL, SHL, HockeyAllsvenskan, WBC.

Entities

An entity is a distinct item from the API. JsonOdds was developed for ease of use and therefore there are only a few entities. There are just six entity types currently.

Match

A match is an event which has odds.

ID: The ID of the entity

HomeTeam: The home team of the match-up

AwayTeam: The away team of the match-up

Sport: An enumeration of a sport. See the sports entity for more information

MatchTime: The date and time of the match-up in UTC

Odds: An array of odds for this match-up

League:League of match, only used for soccer

DisplayRegion:Region of match, only used for soccer

HomeROTROT # for home team

AwayROTROT # for away team

HomePitcherMLB only: home pitcher

AwayPitcherMLB only: away pitcher

Odds

The odds for a match. A match can contain several odds objects. Odds cannot be accessed directly through the API only as part of a match. Soccer matches can be retrieved by league or region using the following endpoints /api/odds/byleague or /api/odds/byregion. See the examples requests to the right for more information.

ID: The ID of the entity

EventID: The match-up id foreign key

SiteID: The odds source. See sources for more information

MoneyLineHome: Moneyline for home team

MoneyLineAway: Moneyline for away team

DrawLine: Moneyline for a draw

PointSpreadHome: Point spread for home team

PointSpreadAway: Point spread for away team

PointSpreadHomeLine: Line for home point spread

PointSpreadAwayLine: Line for away point spread

TotalNumber: The total

OverLine: Odds for the over

UnderLine: Odds for the under

LastUpdated: The last time these odds were updated

OddType: The type of odd, ie Game/FirstHalf/FirstQuarter

Participant: For non-two team sports (Horse-Racing) contains properties for name and position

Endpoints:
  • api/odds (GET) Optional URL Parameters: Source, Sport, OddType, OddFormat(American or Decimal)
  • api/odds/byleague (POST) Data: LeagueRequest {LeagueName: string, Source: int, Sport: string, OddType: string}
  • api/odds/byleagues (POST) Data: LeagueArrayRequest {LeagueNames: string[], Source: int, Sport: string, OddType: string}
  • api/odds/byregion (POST) Data: RegionRequest {RegionName: string, Source: int, Sport: string, OddType: string}
  • api/odds/bygames (POST) Data: GamesRequest {GameIDs: string[], Sport: string, OddType: string}

OddType

An enumeration of odd types, including Game, First Half, Second Half, Quarter, and Period durations

Endpoints:
  • api/oddtype (GET)

FinalType

An enumeration of final types such as Finished, Postponed, Canceled, etc

Endpoints:
  • api/finaltype (GET)

OddFormat

An enumeration of odd formats, can be passed to the /api/odds endpoint ?oddFormat=decimal

Endpoints:
  • api/oddFormat (GET)

Result

The result entity will show the score of a match entity. This endpoint can be polled to view the live score of a match.

ID: The ID of the entity. For game odd types, this will link to a match-up id

HomeScore: The home score

AwayScore: The away score

OddType: OddType for this result

Final: A boolean which returns true if the game is final

TennisFinalScore: Final score in sets of a tennis game. Ex: "2-1" (Home Sets-Away Sets). Only populated for tennis.

AETScore: After Extra Time score for Soccer matches only

PKScore: Golden Goal/Penalty kicks score for Soccer matches only

FinalType: The type of final including Finished, Postponed, Canceled, etc

Name: Only for participant sports, example: Golfer name

Position: Only for participant sports

FinalPosition: Only for participant sports, final position

BinaryScore: Binary 1/0 for result Ex: "1-0" (HomeWin-AwayWin)

Endpoints:
  • api/results (GET) URL Parameters: Sport, ID, Final and OddType
  • api/results/getbyeventid/ (GET) URL Parameters: ID, Final, and OddType
  • api/results/byleague (POST) Data: LeagueRequest {LeagueName: string, Source: int, Sport, OddType?: string}
  • api/results/byregion (POST) Data: RegionRequest {RegionName: string, Source: int, Sport, OddType?: string}

Regions

Soccer matches contain a Region property to denote the region. Some examples include "SWE", "GER", "BRA". Regions can be retreived using the api/regions (GET). These regions can be used to retrieve odds or leagues.

Endpoints:
  • api/regions (GET)

Leagues

Soccer and Horse Racing matches contain a League property to denote the soccer league or the horse track. Some examples include "Primera Division", "J-League", "Allsvenskan". Leagues can be retreived using the api/leagues (GET) or api/leagues/byregion (POST).

League

Name: The name of the league

Endpoints:
  • api/leagues (GET) Optional ?league parameter ex: api/leagues/soccer
  • api/leagues/byregion (POST) Data: RegionRequest {RegionName: string, Source: int, Sport}

White Label Odds Source

JsonOdds aggregates data from various sportsbooks to create a white label odds source.

Source

ID: The ID of the entity

Description: A description of the odds source

Endpoints:
  • api/sources (GET)

Test Data

JsonOdds does provide free accessible test data to evaluate the api. Please use the urls to the right to pull down some test data. To learn how to make a request in C# go here.

Gaining Access

Sample Request

curl -X GET -G https://jsonodds.com/api/odds -d source=3 -H "JsonOdds-API-Key: yourapikey"

Expected Response

http code 200

{

matches:

[

{object}

odds: [

{object} ]

]

}

Sports

Sample Request

curl -X GET https://jsonodds.com/api/sports -H "JsonOdds-API-Key: yourapikey"

Expected Response

http code 200

{

sports:

[

{object}

]

}

Matches/Odds

Sample Request

curl -X GET https://jsonodds.com/api/odds/nfl -H "JsonOdds-API-Key: yourapikey"

Expected Response

http code 200

{

matches:

[

{object}

odds: [

{object} ]

]

}

Example Requests

Get all odds for a sport

curl -X GET https://jsonodds.com/api/odds/{string: sport} -H "JsonOdds-API-Key: yourapikey"

Get all odds

curl -X GET https://jsonodds.com/api/odds/ -H "JsonOdds-API-Key: yourapikey"

Get all odds for game durations only

curl -X GET https://jsonodds.com/api/odds?oddType=Game&oddFormat=decimal -H "JsonOdds-API-Key: yourapikey"

Get all odds for a particular sport for game durations only with the format in decimal

curl -X GET https://jsonodds.com/api/odds/{string: sport}?oddType=Game -H "JsonOdds-API-Key: yourapikey"

Soccer/Horse-Racing:

Get all odds by league name (POST)

curl --data "LeagueName=Allsvenskan&Source=3& Sport=Soccer" https://jsonodds.com/api/odds/byleague -H "JsonOdds-API-Key: yourapikey"

Get all odds by region name (POST)

curl -d "RegionName=SWE&Source=3&Sport=Soccer" https://jsonodds.com/api/odds/byregion -H "JsonOdds-API-Key: yourapikey"

Odd Types

Sample Request

curl -X GET https://jsonodds.com/api/oddtype -H "JsonOdds-API-Key: yourapikey"

Final Types

Sample Request

curl -X GET https://jsonodds.com/api/finaltype -H "JsonOdds-API-Key: yourapikey"

Results

Sample Request

curl -X GET https://jsonodds.com/api/results/nfl -H "JsonOdds-API-Key: yourapikey"

Expected Response

http code 200

{

results:

[

{object}

]

}

Example Requests

Get all results for a sport

curl -X GET https://jsonodds.com/api/results/{string: sport} -H "JsonOdds-API-Key: yourapikey"

Get all final results for a sport

curl -X GET https://jsonodds.com/api/results/{string: sport}?final=true -H "JsonOdds-API-Key: yourapikey"

Get only game results for a sport

curl -X GET https://jsonodds.com/api/results/{string: sport}?oddType=Game -H "JsonOdds-API-Key: yourapikey"

Get result for a specific game

curl -X GET https://jsonodds.com/api/results/{Match.ID} -H "JsonOdds-API-Key: yourapikey"

Get all types of results for a specific game

curl -X GET https://jsonodds.com/api/results/getbyeventid/{Match.ID} -H "JsonOdds-API-Key: yourapikey"

Regions

Get all Regions

curl -X GET https://jsonodds.com/api/regions -H "JsonOdds-API-Key: yourapikey"

Expected Response

http code 200

{

regions:

[

string: 'RegionName'

]

}

Leagues

Get all Leagues

curl -X GET https://jsonodds.com/api/leagues -H "JsonOdds-API-Key: yourapikey"

Expected Response

http code 200

{

leagues:

[

{Name: 'LeagueName'}

]

}

Get all Leagues By Region (POST)

Takes a RegionRequest which has a RegionName property. You can get all RegionNames from the /api/regions (GET) endpoint

curl --d "RegionName=SWE" https://jsonodds.com/api/leagues/byregion -H "JsonOdds-API-Key: yourapikey"

Expected Response

http code 200

{

leagues:

[

{Name: 'LeagueName'}

]

}

Sources

Sample Request

curl -X GET https://jsonodds.com/api/sources -H "JsonOdds-API-Key: yourapikey"

Expected Response

http code 200

{

sources:

[

{object}

]

}

Test-Data

Sample Request

curl -X GET https://jsonodds.com/api/test/odds

curl -X GET https://jsonodds.com/api/test/results

The End