API Overview

JsonOdds API provides restful access to matches, teams, odds, and results. JsonOdds features pre-match moneyline, total, and point spread odds, results, and in-game scores.

Gaining Access

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

Sports

JsonOdds supports NFL, NCAAF, NCAAB, NBA, MLB, NHL, WNBA, MMA (UFC), CFL, XFL, Golf, KHL, AHL, SHL, HockeyAllsvenskan, Czech Republic Extraliga, Finland Liiga, WBC, CBS, LIDOM, LVBP.
Soccer: World Cup, MLS, Premier League, UEFA Champions League, English Championship, English FA Cup, Spanish La Liga, Copa del Rey, Mexican Liga MX, France Ligue 1, German Bundesliga, Scottish Premiership, and more.
Tennis: Australian Open, French Open, Wimbledon, US Open.

Note: Soccer is not enabled by default, please contact us to have soccer enabled for your api-key.

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

PreseasonTrue if preseason

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 (Golf) 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 a live in-game 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

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}

White Label Odds Source

JsonOdds aggregates and consolidates data to create a white label odds source.

Source

ID: The ID of the entity

Description: A description of the odds source

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.

Usage

Check your usage activity for the month.

Endpoint:
  • api/usage (GET)

Sample Code

NodeJs
PHP

Gaining Access

Sample Request

curl -X GET -G https://jsonodds.com/api/odds -H "x-api-key: yourapikey" -L

Expected Response

http code 200

{

matches:

[

{object}

odds: [

{object} ]

]

}

Sports

Sample Request

curl -X GET https://jsonodds.com/api/sports -H "x-api-key: yourapikey" -L

Expected Response

http code 200

{

sports:

[

{object}

]

}

Matches/Odds

Sample Request

curl -X GET https://jsonodds.com/api/odds/nfl -H "x-api-key: yourapikey" -L

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 "x-api-key: yourapikey" -L

Get all odds

curl -X GET https://jsonodds.com/api/odds/ -H "x-api-key: yourapikey" -L

Get all odds for game durations only

curl -X GET https://jsonodds.com/api/odds/{string: sport}?oddType=Game -H "x-api-key: yourapikey" -L

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

curl -X GET https://jsonodds.com/api/odds?oddType=Game&oddFormat=decimal -H "x-api-key: yourapikey" -L

Odd Types

Sample Request

curl -X GET https://jsonodds.com/api/oddtype -H "x-api-key: yourapikey" -L

Final Types

Sample Request

curl -X GET https://jsonodds.com/api/finaltype -H "x-api-key: yourapikey" -L

Results

Sample Request

curl -X GET https://jsonodds.com/api/results/nfl -H "x-api-key: yourapikey" -L

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 "x-api-key: yourapikey" -L

Get all final results for a sport

curl -X GET https://jsonodds.com/api/results/{string: sport}?final=true -H "x-api-key: yourapikey" -L

Get only game results for a sport

curl -X GET https://jsonodds.com/api/results/{string: sport}?oddType=Game -H "x-api-key: yourapikey" -L

Get result for a specific game

curl -X GET https://jsonodds.com/api/results/{Match.ID} -H "x-api-key: yourapikey" -L

Get all types of results for a specific game

curl -X GET https://jsonodds.com/api/results/getbyeventid/{Match.ID} -H "x-api-key: yourapikey" -L

Test-Data

Sample Request

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

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

The End