Editorial Content v3

## Content Provider Coverage Calling the Editorial Content API requires parameters for both the sport and the provider of the images. Each provider we use only supplies content for a limited number of sports. The table below illustrates which providers offer which sports.
The Sports Xchange
AP
NFL, NBA, NHL, MLB, NCAA FB, NCAA MB
x
x†
MLS
x
EPL
x†
NCAA WB
x†
Golf
x
NASCAR
x
† Denotes that Premium content is available, which includes images with the editorial content. ## News ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/content-mlb-t3/tsx/news/2016/06/05/all.xml?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", "/content-mlb-t3/tsx/news/2016/06/05/all.xml?api_key={your_api_key}") res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```shell curl -X GET "https://api.sportradar.us/content-mlb-t3/tsx/news/2016/06/05/all.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves News. https://api.sportradar.us/content-`{sport}`-`{access_level}{version}`/`{provider}`/news/`{year}`/`{month}`/`{day}`/`{type}`.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `sport` | Abbreviation for the specified sport: nfl, ncaafb, nhl, nba, ncaamb, mlb, golf, nascar, or soccer. | | `access_level` | Defines the access level of your API key as Production (p) or Trial (t). | | `version` | Version number of the API you are accessing (Current Version: 3). | | `provider` | News provider: The Sports Xchange (tsx), Associated Press (ap), or Associated Press Premium (ap_premium). | | `league` | Defines the requested soccer league: English Premier League (epl). | | `year` | Year in 4 digit format (YYYY). | | `month` | Month in 2 digit format (MM). | | `day` | Day of month in 2 digit format (DD). | | `type` | Type of news: all, injuries, or transactions. | | `format` | xml or json. | | `your_api_key` | Your API key. | ## Analysis ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/content-mlb-t3/tsx/analysis/2016/06/03/all.xml?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", "/content-mlb-t3/tsx/analysis/2016/06/03/all.xml?api_key={your_api_key}") res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```shell curl -X GET "https://api.sportradar.us/content-mlb-t3/tsx/analysis/2016/06/03/all.xml?api_key={your_api_key}" ``` > The above command returns xml structured for preview, recap, or team report. This endpoint retrieves sport Analysis. https://api.sportradar.us/content-`{sport}`-`{access_level}{version}`/`{provider}`/`league`/analysis/`{year}`/`{month}`/`{day}`/`{type}`.`{format}`?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `sport` | Abbreviation for the specified sport: nfl, ncaafb, nhl, nba, ncaamb, mlb, golf, nascar, or soccer. | | `access_level` | Defines the access level of your API key as Production (p) or Trial (t). | | `version` | Version number of the API you are accessing (Current Version: 3). | | `provider` | News provider: The Sports Xchange (tsx), Associated Press (ap), or Associated Press Premium (ap_premium). | | `league` | Defines the requested soccer league: Major League Soccer (mls), or English Premier League (epl). | | `year` | Year in 4 digit format (YYYY). | | `month` | Month in 2 digit format (MM). | | `day` | Day of month in 2 digit format (DD). | | `type` | Type of news: all, preview, recap, team_report. | | `format` | xml or json. | | `your_api_key` | Your API key. |