A large number of users use various OTT platforms as their primary source of entertainment. Thus, there is a huge demand for information related to OTT content. For example, users are constantly looking for information about the availability of content on various streaming services, information about new shows, and so forth. Thus, a number of REST APIs have emerged that provide such information. One such API is the Streaming Availability API. In this article, we will be learning about this API and its features.
What is the Streaming Availability API?
The Streaming Availability API is an API that provides information about the content streamed on various OTT platforms. It supports OTT platforms like Netflix, Prime, Disney, HBO, Hulu, and many others across 60 countries. It provides various endpoints that allow searching for shows by country/service combination, retrieving streaming availability of a show by country, retrieving information about changes in the availability of a show, and much more.
Who is the target audience for the Streaming Availability API?
Application developers – The Streaming Availability API can be used by application developers to build/enhance different types of web/mobile applications. Some of the types of applications that can utilize this API are entertainment applications, music applications, news applications, and social media applications.
OTT Platforms – The Streaming Availability API can also be used by OTT platforms to get a sense of the content available on other competing platforms and in different countries. This information can be utilized to drive the marketing efforts.
Individual Businesses – Finally, Individual Businesses can also make use of the Streaming Availability API to gain insight into the content hosted on various platforms. This can help them partner with the right platform/content developer for advertising/product promotion.
How does the Streaming Availability API work?
The Streaming Availability API is a REST API and works on REST principles. It provides REST endpoints that are simple HTTP URLs. A client application can query an endpoint by supplying its URL. Along with the URL, the client application also needs to supply authentication information (API Key, API Host) and request parameters (values required by an API endpoint to process a request). The endpoint then processes the request and returns data corresponding to the request. By default, the data returned is in JSON format.
How to use the Streaming Availability API?
You can use RapidAPI to connect to the Streaming Availability API. Not only does RapidAPI lists all the API endpoints and provide sample responses for the endpoints, but it also allows executing an API endpoint from within the browser itself. Moreover, RapidAPI also provides code snippets in popular programming languages. Both these features are very useful as they reduce development time.
To use RapidAPI to connect to the Streaming Availability API, you need to follow the steps given below.
Step 1 – Signing Up
The first step is to create a RapidAPI account as described below.
a. Enter the Streaming Availability RapidAPI URL (https://rapidapi.com/movie-of-the-night-movie-of-the-night-default/api/streaming-availability/ ) in a browser. Click on the Log In/Sign Up button in the top right corner. This redirects to the following authentication page:
b. Authenticate yourself using any of the methods shown on the page like Google, GitHub, Facebook, etc. Upon successful authentication, the following page is displayed:
Step 2 – Subscribing to the API
In order to be able to execute an endpoint, you need to subscribe to the API. The Streaming Availability API is a freemium API and offers several plans to which users can subscribe as per their requirements.
To subscribe to the API, you need to do the following:
a. Click on the Pricing Tab. This displays all the available plans:
b. Select a plan that is appropriate for you and click Subscribe. The Basic plan is free and allows 100 requests per day. The other plans are paid and offer more requests per month as well as some additional features. On subscribing, the following screen is displayed:
Step 3 – Executing an endpoint
Once subscribed, you can execute an API endpoint. To execute an endpoint, you need to do the following:
a. Click on the EndPoints tab. All the available endpoints are displayed on the left:
b. Click the endpoint that you would like to execute. I have selected Search Basic (FREE) endpoint. Click the Test Endpoint button:
c. View the Response in the Results tab:
d. In addition, RapidAPI also provides sample responses for most of the API endpoints. In order to view a sample response, simply select the desired endpoint from the endpoints list on the left and click the Example Responses tab:
Step 4 – Obtaining a code snippet
RapidAPI also provides code snippets in several programming languages. Further, for each programming language, it provides code in multiple HTTP clients supported by the language (Since a REST API exposes its endpoints as HTTP URLs, a programming language specific HTTP client library needs to be used to invoke an API endpoint). You can copy the code snippet in the desired programming language and HTTP library and use it in your application.
For example, to obtain a code snippet in C# using the HttpClient library you need to do the following:
a. Click on C# -> HttpClient in the Code Snippets tab:
b. Copy the C# code shown and use it as desired:
Streaming Availability API Endpoints
Let us now take a detailed look at the Streaming Availability API endpoints.
Search endpoints
This category includes various endpoints that allow searching for OTT information. The following table lists all the endpoints in this category.
Endpoint Name | Endpoint description | Parameters |
Search Basic (Free) | Searches through the catalog of an OTT service in a particular country for a particular type of content (movie or series). Allows filtering the result by genre, keywords, and/or language. Returns paginated result with 8 items per page. For each item, returns information like title, IMDb ID, TMDb ID, IMDb rating, link to shows’ pages in streaming services, cast, runtime, poster, and much more. | country – Mandatory parameter of type String. Specifies the country to be searched. service – Mandatory parameter of type String. Specifies the service to be searched. Possible values are Netflix, prime, Disney, hbo, hulu, peacock, paramount, starz, showtime, apple, mubi. type – Mandatory parameter of type String. Specifies the type of content that needs to be searched. Possible values are movie/series. genre – Optional parameter of type number corresponding to genre id. When specified, the endpoint filters the results by this genre. The genre id can be obtained from the genres endpoint. page – Optional parameter of type number corresponding to a page number. Specifies the position from where the results need to be returned. It can be used for pagination. keyword – Optional parameter of type String corresponding to a keyword to be searched. When specified, the endpoint filters the results by this keyword. language – Optional parameter of the type String corresponding to the original language of the show. When specified, the endpoint filters the results by this language. |
Search Pro | Searches through the catalog of a service in a particular country for a particular type of content (movie or series). Allows filtering/ordering the results. Returns paginated results with 10 items per page. For each item, returns information like title, IMDb ID, TMDb ID, IMDb rating, link to shows’ pages in streaming services, cast, runtime, poster, and much more. Note that this endpoint is only available on a Pro subscription | country – Mandatory parameter of type String. Specifies the country that needs to be searched. service – Mandatory parameter of type String. Specifies the service that needs to be searched. Possible values are Netflix, prime, Disney, hbo, hulu, peacock, paramount, starz, showtime, apple, mubi. type – Mandatory parameter of type String. Specifies the type of content that needs to be searched. Possible values are movie/series. order_by – Mandatory parameter of type String. Specifies the field by which the search results should be ordered. Possible values are original_title and year. year_min – Optional parameter of type number. When specified, the endpoint only returns titles that are released in or after this year. year_max – Optional parameter of type number. When specified, the endpoint only returns titles that are released in or before this year. genre – Optional parameter of type number corresponding to genre id. When specified, the endpoint filters the results by this genre. The genre id can be obtained from the genres endpoint. page – Optional parameter of type number corresponding to the page number. Specifies the position from where the results need to be returned. It can be used for pagination. desc – Optional parameter of type Boolean corresponding to the sort order. When set to true, the endpoint returns the results sorted in descending order. language – Optional parameter of the type String corresponding to the original language of the show. When specified, the endpoint filters the results by this language. keyword – Optional parameter of type String corresponding to a keyword to be searched. When specified, the endpoint filters the results by this keyword. |
Search Ultra | Searches through the catalog of a service in a particular country for a particular type of content (movie or series). Allows filtering/ordering the results. Returns paginated results with 25 items per page. For each item, returns information like title, IMDb ID, TMDb ID, IMDb rating, link to shows’ pages in streaming services, cast, runtime, poster, and much more. Note that this endpoint is only available on an Ultra subscription. | country – Mandatory parameter of type String. Specifies the country that needs to be searched. service – Mandatory parameter of type String. Specifies the service that needs to be searched. Possible values are Netflix, prime, Disney, hbo, hulu, peacock, paramount, starz, showtime, apple, mubi. A comma-separated service list can also be specified. type – Mandatory parameter of type String. Specifies the type of content that needs to be searched. Possible values are movie/series. order_by – Mandatory parameter of type String. Specifies the field by which the search results should be ordered. Possible values are original_title, year, imdb_vote_count imdb_rating. year_min – Optional parameter of type number. When specified, the endpoint only returns titles that are released in or after this year. year_max – Optional parameter of type number. When specified, the endpoint only returns titles that are released in or before this year. page – Optional parameter of type number. Specifies the position from where the results need to be returned. It can be used for pagination. desc – Optional parameter of type Boolean corresponding to the sort order. When set to true, the endpoint returns the results sorted in descending order. genres – Optional parameter of the type String corresponding to a comma-separated list of genre ids. When specified, the endpoint filters the results by the specified genres. The genre ids can be obtained from the genres endpoint. genres_relation – Optional parameter of the type String corresponding to the relation between the genres. Possible values are and/or. If and is specified, the endpoint returns titles that include all the genres specified in the genres parameter. If or is specified, the endpoint returns titles that include at least one of the genres specified in the genres parameter. The default value of this parameter is and. The parameter is ignored if there are fewer than two genres specified in the genres parameter. desc – Optional parameter of type Boolean corresponding to the sort order. When set to true, the endpoint returns the results sorted in descending order. language – Optional parameter of the type String corresponding to the original language of the show. When specified, the endpoint filters the results by this language. min_imdb_rating – Optional parameter of type number corresponding to the minimum IMDb rating. When specified, the endpoint only returns shows that have an IMDb rating that is higher than the specified rating. max_imdb_rating – Optional parameter of the type String corresponding to the maximum IMDb rating. When specified, the endpoint only returns shows that have an IMDb rating that is lower than the specified rating. min_imdb_vote_count – Optional parameter of the type String corresponding to the minimum IMDb vote count. When specified, the endpoint only returns shows that have an IMDb vote count that is higher than the specified count. max_imdb_vote_count – Optional parameter of the type String corresponding to the maximum IMDb vote count. When specified, the endpoint only returns shows that have an IMDb vote count that is less than the specified vote count. keyword – Optional parameter of type String corresponding to a keyword to be searched. When specified, the endpoint filters the results by this keyword. |
Get endpoints
This category includes various endpoints that return the streaming availability of shows. The following table lists all the endpoints in this category.
Endpoint Name | Endpoint Description | Parameters |
Get Basic | Returns the streaming availability of a show in a particular country either via a TMDb id or an IMDb id. TMDb IDs should be formatted like tv/71712 or movie/464052. In addition to streaming information, the output also includes other information about the show such as IMDb rating, original title, etc. | country – Mandatory parameter of type String. Specifies the country that needs to be searched. imdb_id – Optional parameter of type String. Specifies the IMDb id of a title whose streaming availability is required. tmdb_id – Optional parameter of type String. Specifies the TMDb id of a title whose Although the imdb_id and tmdb_id are optional parameters, either one of them needs to be specified, otherwise the endpoint returns an error. |
Get Ultra | Returns streaming availability information of a show globally in every possible service-country combination via either a TMDb id or an IMDb id. TMDb IDs should be formatted like tv/71712 or movie/464052. In addition to streaming information, the output also includes other information about the show such as IMDb rating, original title, etc. Note that this endpoint is only available on an Ultra subscription. | imdb_id – Optional parameter of type String. Specifies the IMDb id of a title whose streaming availability is required. tmdb_id – Optional parameter of type String. Specifies the TMDb id of a title whose Although the imdb_id and tmdb_id are optional parameters, either one of them needs to be specified, otherwise the endpoint returns an error. |
Base Utilities
This category includes endpoints that return some basic information. The following table lists all the endpoints in this category.
Endpoint Name | Endpoint Description | Parameters |
Countries | Returns a list of all the streaming services and the countries supported by each streaming service. So, for each streaming service, the endpoint returns a list of country codes in which the streaming service is available | None |
Genres | This endpoint returns a list of all the available genres. For each genre, returns a genre id and the genre name | None |
Changing and Leaving
This category includes various endpoints that return information about the changes in the availability of shows in various services. The following table lists all the endpoints in this category.
Endpoint Name | Endpoint Description | Parameters |
Leaving | Returns a list of all the movies or series leaving from a country/service combination. Returns all the titles that are leaving in the next 31 days or those that do not have an explicit leaving date. | service – Mandatory parameter of type String. Specifies the service to be searched for leaving titles. Possible values are Netflix, prime, Disney, hbo, hulu, peacock, paramount, starz, showtime, apple, mubi. country – Mandatory parameter of type String. Specifies the country to be searched for leaving titles. type – Mandatory parameter of type String. Specifies the type of leaving content that needs to be searched. Possible values are movie/series. |
Changes (Ultra) | Returns information about changes in the availability of services. Returns both new as well as removed titles. Returns information about changes in the last 7 days. Note that this endpoint is available only in an Ultra subscription. | service – Mandatory parameter of type String. Specifies the service to be searched for changes in titles. Possible values are netflix, prime, Disney, hbo, hulu, peacock, paramount, starz, showtime, apple, mubi. country – Mandatory parameter of type String. Specifies the country to be searched for changes in titles. change_type – Mandatory parameter of type String. Specifies the type of change. Possible values are new and removed. type – Mandatory parameter of type String. Specifies the type of changed content that needs to be searched. Possible values are movie, series. |
How to use the Streaming Availability API with various programming languages
As explained earlier, RapidAPI provides code snippets in various programming languages like Java, Python, PHP, Ruby, Javascript, NodeJS, etc. which can be used to execute the API endpoints. Let us take a look at a few code samples.
Using the Streaming Availability API with Java
In order to use the Streaming Availability API with Java, click the desired API endpoint on the left. In the code snippets tab, select Java and the desired HTTP client library. Copy the code snippet and use it as required.
For example, RapidAPI provides the following Java code for the search (basic) endpoint using the AsyncHttp library:
AsyncHttpClient client = new DefaultAsyncHttpClient(); client.prepare("GET", "https://streaming-availability.p.rapidapi.com/search/basic?country=us&service=netflix&type=movie&genre=18&page=1&language=en") .setHeader("x-rapidapi-host", "<your host here>") .setHeader("x-rapidapi-key", "<your key here>") .execute() .toCompletableFuture() .thenAccept(System.out::println) .join(); client.close();
Using the Streaming Availability API with Python
Like Java, you can obtain Python code to execute any of the endpoints via the code snippets tab. For example, RapidAPI provides the following Python code to execute the Get Basic endpoint using the http.client library:
import http.client conn = http.client.HTTPSConnection("streaming-availability.p.rapidapi.com") headers = { 'x-rapidapi-host': "<your host here>", 'x-rapidapi-key': "<your key here>" } conn.request("GET", "/get/basic?country=in&tmdb_id=movie%2F120", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
Using the Streaming Availability API with PHP
Like Java and Python, you can obtain PHP code to execute any of the endpoints via the code snippets tab. For example, RapidAPI provides the following PHP code to execute the Genres endpoint using the Http v1 library:
<?php $request = new HttpRequest(); $request->setUrl('https://streaming-availability.p.rapidapi.com/genres'); $request->setMethod(HTTP_METH_GET); $request->setHeaders([ 'x-rapidapi-host' => '<your host here>', 'x-rapidapi-key' => '<your key here>' ]); try { $response = $request->send(); echo $response->getBody(); } catch (HttpException $ex) { echo $ex; }
Using the Streaming Availability API with Ruby
Like the other programming languages, you can also obtain Ruby code to execute any of the endpoints via the code snippets tab. For example, RapidAPI provides the following Ruby code to execute the countries endpoint using the Unirest library:
require 'uri' require 'net/http' require 'openssl' url = URI("https://streaming-availability.p.rapidapi.com/genres") 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-host"] = '<your host here>' request["x-rapidapi-key"] = '<your key here>' response = http.request(request) puts response.read_body
Using the Streaming Availability API with Javascript
Finally, you can also obtain Javascript code to execute any of the endpoints via the code snippets tab. For example, RapidAPI provides the following Javascript code to execute the Leaving endpoint using the XMLHttpRequest library:
const data = null; const xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener("readystatechange", function () { if (this.readyState === this.DONE) { console.log(this.responseText); } }); xhr.open("GET", "https://streaming-availability.p.rapidapi.com/leaving?service=hulu&country=us&type=movie"); xhr.setRequestHeader("x-rapidapi-host", "<your host here>"); xhr.setRequestHeader("x-rapidapi-key", "<your key here>"); xhr.send(data);
In addition, RapidAPI also provides code snippets in other programming languages like Node.js, C, Kotlin, Swift, etc. which can be obtained as explained above.
What are the benefits of the Streaming Availability API?
Well-documented – One important benefit of the Streaming Availability API is that it is well-document. All the API endpoints have elaborate explanations that explain what the endpoints do. In addition, the endpoint parameters are also self-explanatory.
Comprehensive – Secondly, the Streaming Availability API is comprehensive. Not only does it expose various endpoints that enable developers to make the most out of an OTT content-related API, but it includes information about a large number of OTT platforms across several countries.
Widespread application – Finally, the Streaming Availability API can be used in a wide variety of web/mobile applications like news applications, social media applications, and entertainment/music applications.
Other APIs in the OTT streaming arena
Let us now take a look at some other APIs available on RapidAPI that provide OTT content information.
- UTelly API – This is another API similar to the Streaming Availability API. It allows searching for platforms on which a particular movie or show is hosted.
- unogsNG API – The unoGSNG API is a Netflix search API. It allows searching for Netflix shows based on a wide variety of parameters.
- Watchmode API – The Watchmode API is also a streaming availability API that caters to more than 100 services like Netflix, Hulu, Amazon Prime Video, AppleTV+, Disney+ & many more.
- OTT details API – The OTT Details API is also similar to the Streaming Availability API. It provides streaming information related to movies and TV shows across 150+ Streaming platforms in the US and India such as HBO, YouTube, Netflix, Prime Video, Hotstar, Hulu, etc.
Summary
So, to summarize, the Streaming Availability API provides information about the content streamed on various OTT platforms. It exposes several endpoints that allow searching content, retrieving streaming availability of a show, etc. In this article, we learned how to use RapidAPI to connect to the Streaming Availability API and execute its endpoints. We also learned about all the endpoints that this API provides, the benefits of this API, and other alternate APIs in the OTT streaming arena. Finally, we saw to use RapidAPI to obtain code snippets to execute the API endpoints in different programming languages.
Leave a Reply