Sports are a huge source of entertainment for millions of people around the world. Nowadays, people can obtain information about sporting events, live scores, match schedules, and much more at the touch of a button thanks to a number of sporting applications on the internet. Most such applications also provide REST APIs that expose their functionality. So, developers can utilize these APIs to integrate the desired functionality into their application. One such API in the sports arena is the Rundown API. In this article, we will be learning about the Rundown API and exploring its features.
What is the Rundown API
Rundown is a leading platform in the sports betting arena. At its core, it provides real-time betting odds for sporting events from the most popular sportsbooks. Not only does it provide this information for events occurring in all the major sports leagues like NBA, NHL, MLB, and many more, but it is not limited to a single sportsbook. So, it provides odds from several leading sportsbooks like Pinnacle, Sports betting, 5 Dimes, Betonline with more sportsbooks being constantly added. Some of the market types that it supports are lines, spreads, and totals for full games, first half, second half, etc. Besides betting odds, it also provides information about the major sporting events, schedules, team information, tv broadcast, venue information, and much more! The Rundown API is an API that exposes the Rundown application features. So, it exposes endpoints that provide information pertaining to sportsbooks, events, odds, teams, and schedules.
Who is the target audience for the Rundown API?
Individual Betters/Small bookmakers/organizations – Since the Rundown API provides betting odds from multiple sportsbooks, an individual better or a small organization can use it to compare the odds given by various sportsbooks. This provides a user with the insights required to take an informed decision about the best prices and thus benefit from sports gambling. Moreover, the API provides odds for different types of bets like lines, spreads, and totals, so this gives the users a wide variety of options to choose from for betting.
Sports Applications – A large number of web/mobile sports applications are already prevalent. Such applications can use the Rundown API to offer additional features to their users based on the Rundown data like event/schedule information. Such applications can also embed betting odds into their applications if desired.
Betting/Gambling applications – Betting/Gambling applications are another arena where the Rundown API can be used. Such applications can make use of the Rundown API endpoints to enter the sports betting turf.
How does the Rundown API work?
The Rundown API is a REST API. Like any other REST API, it exposes its endpoints as HTTP URLs. A client application (written in any programming language) can consume an endpoint by specifying the HTTP URL of the endpoint. Along with the endpoint URL, a client application needs to supply request parameters (parameters required by the endpoint), and authentication information (an API key). The API endpoint then processes the request and if successful returns the data corresponding to the request in JSON format.
How to use the Rundown API
You can use RapidAPI to connect to the Rundown API. Using RapidAPI to connect to the Rundown API has several benefits. For one, it lists all the API endpoints, so developers instantly know what is available to them. Secondly, it provides example responses for most of the API endpoints. So, developers can view these responses to understand what type of output to expect from a particular endpoint. Thirdly, it provides code snippets in popular programming languages. So, developers can use these code snippets without having to write code from scratch. Finally, once subscribed, RapidAPI also allows executing an API method from the browser itself. So, developers can execute API methods and view the responses without having to write any code.
Let us now learn how to use RapidAPI to perform all the above operations.
Signing Up
The first step is to create a RapidAPI account as described below.
- Enter the Rundown RapidAPI URL (https://rapidapi.com/therundown/api/therundown ) in a browser. Click on the Log In/Sign Up button in the top right corner. This redirects to the following authentication page:
- Authenticate yourself using any of the methods shown on the page like Google, GitHub, Facebook, etc. Upon successful authentication, the following page is displayed:
Viewing Endpoints/Sample Responses
As explained earlier, the Rundown API lists all the API endpoints and allows viewing an endpoint response for most of the endpoints. For this, you need to do the following:
- Click on the EndPoints tab. All the available endpoints are displayed on the left:
- Click on the API endpoint whose response you want to see. I have selected the Sports endpoint. Click on the Example Responses tab on the right side and view its response:
Obtaining a Code Snippet
RapidAPI also provides code snippets in several programming languages. You can copy the code snippet in the desired programming language and use it in your application.
For example, to obtain a code snippet in Node.js, you need to do the following:
- Click on the desired endpoint from the endpoints list on the left. I have selected the Sports endpoint. Click on the Code snippets tab on the right. Select Node.js -> HTTP in the language selection drop-down:
- Copy the Node.js code shown and use it as desired:
Subscribing to the API
Finally, you can execute the Rundown API endpoints by subscribing to the API. The Rundown API is a paid API that offers several plans to which users can subscribe to as per their requirements.
To subscribe to the API, you need to do the following:
- Click on the Pricing This displays all the available plans:
- Select a plan that is appropriate for you and click Subscribe. I will choose the Basic Plan. You can enter your credit card details as follows:
Once subscribed, you can execute an endpoint either through your code or from the browser itself.
Rundown API Endpoints
Let us now take a detailed look at the Rundown API endpoints.
Category | Endpoint name | Endpoint description | Endpoint parameters |
Affiliates (Sportsbooks) | Affiliates (Sportsbooks) | Returns all the available affiliates (sportsbooks). The affiliate id in the response is used as the key in many other endpoint responses. | None |
Sports | Sports | Returns all the available sports leagues. Also returns events corresponding to each sports league if available. The sports id in the response is used as the query parameter in many other API endpoints | None |
Events | closing | Provides the closing lines for the various sportsbooks (affiliates) for the specified sports league on the specified date. Returns the closing lines data for all the events in the specified sports league. May optionally include score, team names, and other information if requested.
| sportID – Mandatory parameter of type number. Specifies the Id of the sports league whose closing lines are required. date – Mandatory parameter of type String. Specifies the date (in yyyy-mm-dd format) for which the closing lines are required. offset – Optional parameter of type string. Specifies the offset in minutes from UTC by which to group events. For example, if you want to obtain all the events in CDT, then you need to specify offset as 300. include – Optional parameter of type String. Specifies the additional information to be included in the response. Multiple include parameters can be specified to include information like scores, periods (all/halves/quarters/periods), team names, etc. |
Events | Events (Games) | Returns all the sports events corresponding to the specified sports league on the specified date. Also returns the current odds for the event if available. | sportID – Mandatory parameter of type number. Specifies the Id of the sports league whose events are required. date – Mandatory parameter of type String. Specifies the date (in yyyy-mm-dd format) for which the events are required. include – Optional parameter of type String. Specifies the additional information to be included in the response. Multiple include parameters can be specified to include information like scores, periods (all/halves/quarters/periods), team names, etc. offset – Optional parameter of type string. Specifies the offset in minutes from UTC by which to group events. For example, if you want to obtain all the events in CDT, then you need to specify offset as 300. |
Events | Event | Returns information about a particular event and the currently available odds from each sportsbook for the event. | eventID – Mandatory parameter of type number. Specifies the Id of the event whose information is required. include – Optional parameter of type String. Specifies the additional information to be included in the response. Multiple include parameters can be specified to include information like scores, periods (all/halves/quarters/periods), team names, etc. |
Events | Dates with Odds | Returns the dates of the sports events that contain odds that are on or after the current date. | format – Optional parameter of type String. Specifies the format in which the dates will be returned. offset – Optional parameter of type number. Specifies the offset in minutes from UTC by which the dates in the response should be offset from UTC. So, for example, if you want the dates in the response to be offset from UTC by 300 minutes, then offset=300 should be specified. |
Events | Openers | Provides the opening lines for the various sportsbooks (affiliates) for the specified sports league on the specified date. Returns the opening lines data for all the events in the specified sports league. May optionally include score, team names, and other information if requested. | sportID – Mandatory parameter of type number. Specifies the Id of the sport whose opening lines are required. date – Mandatory parameter of type String. Specifies the date (in yyyy-mm-dd format) for which the opening lines are required. include – Optional parameter of type String. Specifies the additional information to be included in the response. Multiple include parameters can be specified to include information like scores, periods (all/halves/quarters/periods), team names, etc. offset – Optional parameter of type string. Specifies the offset in minutes from UTC by which to group events. For example, if you want to obtain all the events in CDT, then you need to specify offset as 300. |
Events | Delta (Changed events) | Returns only events that have changed since the last request. Returns a status code of 400 if too many events have changed in which case, it is advisable to fetch all the event information using the events (games) endpoint | last_id – Required parameter of type String. Specifies the last_delta_id returned by any of the other API endpoints. include – Optional parameter of type String. Specifies the additional information to be included in the response. Multiple include parameters can be specified to include information like scores, periods (all/halves/quarters/periods), team names, etc. sport_id – Optional parameter of type number. Specifies the id of the sports league by which to filter the delta request |
Lines (Historical Odds) | Spread | Returns the current and the historical spread for the specified line id. Each market from each sportsbook for each game has a unique line_id. It can be obtained from the response of some of the other endpoints like events (games), closing, etc. | lineID – Required parameter of type number. Specifies the id of the line whose spread information is required include – Optional parameter of type String. Specifies the additional information to be included in the response. Multiple include parameters can be specified to include information like scores, periods (all/halves/quarters/periods), team names, etc. |
Lines (Historical Odds) | Moneyline | Returns the current and the historical moneyline for the specified line_id. Each market from each sportsbook for each game has a unique line_id. It can be obtained from the response of some of the other endpoints like events (games), closing, etc. | lineID – Required parameter of type number. Specifies the id of the line whose moneyline information is required include – Optional parameter of type String. Specifies the additional information to be included in the response. Multiple include parameters can be specified to include information like scores, periods (all/halves/quarters/periods), team names, etc. |
Lines (Historical Odds) | Totals | Returns the current and the historical totals for the specified line_id. Each market from each sportsbook for each game has a unique line_id. It can be obtained from the response of some of the other endpoints like events (games), closing, etc. | lineID – Required parameter of type number. Specifies the id of the line whose totals information is required include – Optional parameter of type String. Specifies the additional information to be included in the response. Multiple include parameters can be specified to include information like scores, periods (all/halves/quarters/periods), team names, etc. |
Teams | Teams | Returns team information for the specified sports league | sportID – Required parameter of type number. Specifies the id of the sports league whose team information is required |
Schedules | Schedules | Returns the schedule of all the events for a particular sports league. | sportID – Required parameter of type number. Specifies the id of the sports league whose event schedule is required from – Optional parameter of type String. Specifies the date in yyyy-mm-dd format from which the schedules are required. Its default value is the current date. limit – Optional parameter of type number. Specifies the number of events to return. Its default value is 50 and the maximum value is 500. |
How to use the Rundown API with various programming languages
As explained earlier, the Rundown API endpoints can be consumed by a client application written in any programming language. Note that, in order to invoke a REST API endpoint, a client application needs to use an HTTP client library. Most of the programming languages support several HTTP client libraries.
RapidAPI provides code snippets in several programming languages which can be used for invoking the API endpoints. Not only that, it provides code snippets for multiple client libraries in each programming language. Let us take a look at a few code samples. All the examples shown below invoke the sports endpoint.
Using the Rundown API with Java
There are several HTTP client libraries available for Java like OkHttp, Unirest, AsyncHttp, and java.net.http. The following code demonstrates how you can invoke an API endpoint using the AsyncHttp library:
AsyncHttpClient client = new DefaultAsyncHttpClient(); client.prepare("GET", "https://therundown-therundown-v1.p.rapidapi.com/sports/2/schedule?limit=100") .setHeader("x-rapidapi-key", "api key") .setHeader("x-rapidapi-host", "therundown-therundown-v1.p.rapidapi.com") .execute() .toCompletableFuture() .thenAccept(System.out::println) .join(); client.close();
Using the Rundown API with Python
Like Java, there are several HTTP client libraries available for Python like http.client, Requests, and Unirest. The following code demonstrates how you can invoke an API endpoint using the Unirest library:
import http.client conn = http.client.HTTPSConnection("therundown-therundown-v1.p.rapidapi.com") headers = { 'x-rapidapi-key': "api key", 'x-rapidapi-host': "therundown-therundown-v1.p.rapidapi.com" } conn.request("GET", "/sports/2/schedule?limit=100", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
Using the Rundown API with PHP
PHP also has many HTTP client libraries like cURL, HTTP v1, HTTP v2, and Unirest. The code below demonstrates invoking an API endpoint using the HTTP v2 library:
<?php $client = new http\Client; $request = new http\Client\Request; $request->setRequestUrl('https://therundown-therundown-v1.p.rapidapi.com/sports/2/schedule'); $request->setRequestMethod('GET'); $request->setQuery(new http\QueryString([ 'limit' => '100' ])); $request->setHeaders([ 'x-rapidapi-key' => 'api key', 'x-rapidapi-host' => 'therundown-therundown-v1.p.rapidapi.com' ]); $client->enqueue($request)->send(); $response = $client->getResponse(); echo $response->getBody();
Using the Rundown API with Ruby
Ruby has two main HTTP client libraries. These are net::http and Unirest. The following code demonstrates how an API endpoint can be invoked using the net::http client:
require 'uri' require 'net/http' require 'openssl' url = URI("https://therundown-therundown-v1.p.rapidapi.com/sports/2/schedule?limit=100") 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) request["x-rapidapi-key"] = 'api key' request["x-rapidapi-host"] = 'therundown-therundown-v1.p.rapidapi.com' response = http.request(request) puts response.read_body
Using the Rundown API with Javascript
Like other programming languages, Javascript too has many HTTP client libraries like jQuery, fetch, XMLHttpRequest, and Axios. The code below demonstrates invoking an API endpoint using the Axios library:
import axios from "axios"; const options = { method: 'GET', url: 'https://therundown-therundown-v1.p.rapidapi.com/sports/2/schedule', params: {limit: '100'}, headers: { 'x-rapidapi-key': 'api key', 'x-rapidapi-host': 'therundown-therundown-v1.p.rapidapi.com' } }; axios.request(options).then(function (response) { console.log(response.data); }).catch(function (error) { console.error(error); });
In addition to the code snippets listed above, you can use RapidAPI to obtain a code snippet in several other programming languages like Node.js, C, Kotlin, Swift, etc.
What are the benefits of the Rundown API?
Well-Documented – The main benefit of the Rundown API is that is it well-documented. All the API endpoints include descriptions that explain what the endpoint does. Not only the endpoints, but the parameters to each endpoint also include descriptions, sample values, and default values as appropriate. Moreover, most of the API endpoints provide sample responses which help to understand what to expect from the endpoint. All this helps developers get up to speed quickly and reduces the overall software development time.
Constantly Improving – Another benefit of the Rundown API is that is it updated constantly. Additional Sports leagues, SportsBooks, markets are added to it on a regular basis. Thus, users are guaranteed to get the best out of the API at any point in time.
Extensive Functionality – Finally, the Rundown API provides a lot of features that probably make it the most appropriate API for its target users. Not only does it expose endpoints that provide current as well as historical data related to sports betting, but most of the API endpoints can also be customized with request parameters to retrieve additional information like score, team names, etc. as desired.
Other APIs in the Sports arena
Let us now take a look at some other Sports APIs available on RapidAPI.
- Live Sports Odds API – Like the Rundown API, the Live Sports Odds API is another sports odds API. It offers a free plan that allows 500 free requests per month. However, it is not as comprehensive as the Rundown API and exposes fewer endpoints.
- API NBA API – The API NBA API is an API that exposes NBA data like statistics, live scores, League data, player information, standings, etc.
- LiveScore API – The LiveScore API is a comprehensive API that returns information about various sports like football, cricket, basketball, tennis, hockey to name a few. It provides information about live matches, matches on a particular date, leagues by category, etc.
- Football Pro API – The Football Pro API returns football data. It returns data like live scores, odds, statistics, line-ups, standings, and much more.
- Cricket Live Score API – The Cricket Live score API returns cricket data like a list of available matches, cricket scores, scorecards, test scores, ODI scores, T20 scores, IPL scores, and much more.
Summary
So, to summarize, the Rundown platform is a sports betting platform. The Rundown API is a REST API for Rundown. It exposes endpoints that allow obtaining information about betting odds, events, teams, schedules. In this article, we learned about all the endpoints that this API provides. We also learned how we can use RapidAPI to connect to the Rundown API, test the API endpoints and also obtain code snippets in different programming languages.
Leave a Reply