MLB - Market Insights v1

Frequently Asked Questions
API API Version
MLB Advanced Insights - Market Insights v1
Note: Authentication is required for all API calls.
## Insights by Game ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/marketinsights/mlb/trial/v1/en/game/dd6edd68-1d29-4494-a6f5-d11c6eb94b27?api_key={your_api_key}") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```python import http.client conn = http.client.HTTPSConnection("api.sportradar.us") conn.request("GET", "/marketinsights/mlb/trial/v1/en/game/dd6edd68-1d29-4494-a6f5-d11c6eb94b27?api_key={your_api_key}") res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```shell curl -L "https://api.sportradar.com/marketinsights/mlb/trial/v1/en/game/dd6edd68-1d29-4494-a6f5-d11c6eb94b27?api_key={your_api_key}" ``` > The above command returns json structured like this. This endpoint retrieves Insights by Game. https://api.sportradar.com/marketinsights/mlb/`{access_level}`/`{version}`/en/game/`{game_id}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Defines the access level of your API key as Trial (trial) or Development (development). | | `version` | Version number of the API you are accessing (Current Version: v1). | | `game_id` | Id of a given game. | | `your_api_key` | Your API key. | ## Insights by Team ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/marketinsights/mlb/trial/v1/en/team/4f735188-37c8-473d-ae32-1f7e34ccf892?api_key={your_api_key}") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```python import http.client conn = http.client.HTTPSConnection("api.sportradar.us") conn.request("GET", "/marketinsights/mlb/trial/v1/en/team/4f735188-37c8-473d-ae32-1f7e34ccf892?api_key={your_api_key}") res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```shell curl -L "https://api.sportradar.com/marketinsights/mlb/trial/v1/en/team/4f735188-37c8-473d-ae32-1f7e34ccf892?api_key={your_api_key}" ``` > The above command returns json structured like this. This endpoint retrieves Insights by Team. https://api.sportradar.com/marketinsights/mlb/`{access_level}`/`{version}`/en/team/`{team_id}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Defines the access level of your API key as Trial (trial) or Development (development). | | `version` | Version number of the API you are accessing (Current Version: v1). | | `team_id` | Id of a given team. | | `your_api_key` | Your API key. | ## Frequently Asked Questions

Q: What is the Date format?

A: When we present date only values we present these in the ISO 8601 standard format.
ex: 2013-04-03
We use these for attributes that have date and no time (such as birthdate). For more information: https://en.wikipedia.org/wiki/ISO_8601

Q: What time zone are the date time fields presented in?

A: All of our Date/Time attributes are in UTC, presented in the ISO 8601 standard format.
ex: 2013-04-03T18:15:00+00:00
For more information: https://en.wikipedia.org/wiki/ISO_8601

Q: Where does the data come from?

A: The odds used are created by Sportradar’s industry-leading trading team. Sportradar sells these odds to bookmakers; the odds tend to represent a middle-of-the-road line, as we do not want to expose our partners to liability. The odds of a game right at game start are stored and used to create insights (for example, the spread when the Lakers vs. Hawks tipped off was -7.5).

Q: How do you determine relevancy/interest score?

A: The relevancy calculation considers how long the streak is (for example, a team covering their last 10 games is more relevant than one covering their last 3 games), as well as how high a percentage the insight is (for example, a team being 10-1 as moneyline favorites (.909) is more relevant than a team being 8-2 (.800) as moneyline favorites). To begin with, insights are filtered so only the top ones are surfaced, and from there, the relevancy is appended.

Q: How do Market Insights work in the playoffs?

A: Playoff Market Insights will feature some insights that are just regular season, some that are just playoffs, and some that are a mix of both. The data_timeframe field indicates what kind of data comprises the insight. For regular season, only regular season data will be featured.

Return to top

Docs Navigation