The last few years have witnessed a huge change in the way users consume entertainment content. Nowadays, more and more users are shifting from traditional television services to video on demand and OTT services. High internet speeds and technological advances that make it possible to stream content on different types of devices are largely responsible for this trend reversal. Moreover, OTT platforms provide users with the flexibility to control what to watch and when to watch it. A number of service providers like Netflix, Amazon Prime Video, Apple TV, HBO Max provide OTT services. The huge user demand for OTT content has also resulted in an increasing demand for information about content hosted on various OTT services. A number of REST APIs have emerged that fulfill this requirement. One such API is the Utelly API. In this article, we will be learning about this API and its features.
What is the Utelly API?
The Utelly API is basically a content discovery API. It can be used to search the platforms on which a particular show or movie is hosted. It provides endpoints that accept parameters corresponding to the id or some other information about a show/movie and return information about all the OTT providers that host that show. The API aggregates information from OTT services like Netflix, Amazon Prime Video, iTunes, Apple TV+, etc.
Who is the target audience for the Utelly API?
The Utelly API can be used by different types of users as listed below.
Application developers – Application developers can use the Utelly API to build/enhance entertainment/news applications. Such applications can use the API to provide a search feature that allows their users to find out where their favorite shows are hosted.
Content Creators – Content creators can also use the Utelly API to understand what is available on various OTT platforms and accordingly determine the right platform to host their content.
Educational Institutes/Students – Since the Utelly API is very easy to use and has a free plan, it can also be used by educational institutes and students who wish to learn how REST APIs work.
How does the Utelly API work?
The Utelly API is a REST API. REST is a client-server architecture style. A REST server hosts a REST service. The REST service exposes data in the form of HTTP URLs which are also known as REST endpoints. A client application (also known as a REST client) can query an endpoint in order to obtain some data. While querying an endpoint, the client needs to specify the type of HTTP method being accessed (GET, POST, etc.) and the endpoint URL. Additionally, a client application may also optionally require to specify authentication headers (to verify that the client is valid) and request parameters (values required by an API endpoint to process a request). The endpoint then processes the request. It returns an HTTP status code and data corresponding to the request if any.
The Utelly API works on the same principles. In order to invoke an API endpoint, a client application needs to supply the endpoint URL, authentication headers (rapidapi key and rapidapi host), and request parameters. The endpoint then retrieves the requested information from the Utelly database and returns it to the client application.
How to use the Utelly API
You can use RapidAPI to connect to the Utelly API. RapidAPI lists the API endpoints, provides sample responses for the endpoints and event allows executing an API endpoint from within the browser itself! This feature is very handy for developers as it enables executing an endpoint and inspecting its response without writing any code. Further, RapidAPI also provides code snippets for executing the API endpoints in several programming languages. Again, this feature is very useful for developers as they do not need to write code from scratch.
To use RapidAPI to connect to the Utelly 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 Utelly RapidAPI URL (https://rapidapi.com/utelly/api/utelly ) 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 Utelly API
In order to be able to execute an API endpoint, you need to subscribe to the API. The Utelly API is a freemium API which means it offers free as well as paid plans. You can select a plan that is appropriate for your 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 the desired plan and click Subscribe. I will choose the Basic (Free) plan which allows 1000 requests per month. Note that this plan only provides data from some selected services as can be seen from the screenshot above. Although the free plan requires credit card details, your credit card will be charged only if you exceed the free requests. You can enter your credit card details as follows:
c. On entering credit card details, the following screen is displayed:
Step 3 – Executing an endpoint
As mentioned earlier, RapidAPI allows executing an endpoint method and viewing its response in the browser itself without having to write any code. 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 the idlookup endpoint. Click the Test Endpoint button:
c. View the Response in the Results tab:
d. In addition, you can directly view a sample response without executing an endpoint by clicking the Example Responses tab:
Step 4 – Obtaining a code snippet
RapidAPI provides code snippets in several programming languages. Not only that, it provides code for multiple HTTP client libraries in each programming language. (Since a REST service exposes its endpoints in the form of HTTP URLs, a programming language-specific HTTP library is required to access the endpoint. Most programming languages support multiple HTTP libraries). You can copy the code snippet in the desired programming language/HTTP library and use it in your application.
For example, to obtain a code snippet in Java using the AsyncHttp library, you need to do the following:
a. Click on Java -> AsyncHttp in the Code Snippets tab:
b. Copy the Java code shown and use it as desired:
Utelly API EndPoints
Let us now take a detailed look at the Utelly API endpoints.
idlookup
The idlookup endpoint returns information about where you can watch a particular show, movie, or series based on its IMDb, tmbdb, or some other id. It accepts the following parameters:
- source_id – Mandatory parameter of type String. It specifies the ID that needs to be searched.
- source – Mandatory parameter of type String. It specifies the source whose ID is specified. Possible values are IMDb, TMDb, etc.
- country – Optional parameter of type String. When this value is specified, the endpoint only returns services available in the specified country. Possible values are uk, us, ar, at, be, br, ca, de, es, fr, ie, id, it, is, kr, my, mx, no, nl, pt, se & sg
The endpoint returns a JSON array. Within the array is another array that includes information about the services (known as locations) where the show is available. For each location, the endpoint returns information like location name, URL, icon, etc. For example, for the input values source_id= tt0111161, source= imdb and country=us, the endpoint returns the following response:
lookup
The lookup endpoint returns information about where you can watch a particular show, movie, or series based on its complete or partial name.
It accepts the following parameters:
- term – This is an optional parameter of type String. It specifies the text that needs to be searched.
- country – This is an optional parameter of type String. When this value is specified, the endpoint only returns services available in the specified country.
The endpoint returns a JSON array. Within the array is another array that includes information about the services (known as locations) where the show is available. For each location, the endpoint returns information like location name, url, icon, etc. For example, for the input values term=Friends, country=uk, the endpoint returns the following response:
How to use the Utelly 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. For each programming language, it provides code snippets using multiple HTTP client libraries. Let us take a look at a few code samples.
Using the Utelly API with Java
In order to use the Utelly 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 idlookup endpoint using the Unirest library:
HttpResponse<String> response = Unirest.get("https://<your host here>/idlookup?source_id=tt0111161&source=imdb&country=us") .header("x-rapidapi-key", "<your key here>") .header("x-rapidapi-host", "<your host here>") .asString();
Using the Utelly API with Python
In order to use the Utelly API with Python, click the desired API endpoint on the left. In the code snippets tab, select Python and the desired HTTP client library. Copy the code snippet and use it as required.
For example, RapidAPI provides the following Python code for the idlookup endpoint using the Requests library:
import requests url = "https://<your host here>/idlookup" querystring = {"source_id":"tt0111161","source":"imdb","country":"us"} headers = { 'x-rapidapi-key': "<your key here>", 'x-rapidapi-host': "<your host here>" } response = requests.request("GET", url, headers=headers, params=querystring) print(response.text)
Using the Utelly API with PHP
In order to use the Utelly API with PHP, click the desired API endpoint on the left. In the code snippets tab, select PHP and the desired HTTP client library. Copy the code snippet and use it as required.
For example, RapidAPI provides the following PHP code for the idlookup endpoint using the cURL library:
<?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://<your host here>/idlookup?source_id=tt0111161&source=imdb&country=us", CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "x-rapidapi-host: <your host here>", "x-rapidapi-key: <your key here>" ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
Using the Utelly API with Ruby
In order to use the Utelly API with Ruby, click the desired API endpoint on the left. In the code snippets tab, select Ruby and the desired HTTP client library. Copy the code snippet and use it as required.
For example, RapidAPI provides the following Ruby code for the idlookup endpoint using the net::http library:
require 'uri' require 'net/http' require 'openssl' url = URI("https://<your host here>/idlookup?source_id=tt0111161&source=imdb&country=us") 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"] = '<your key here>' request["x-rapidapi-host"] = '<your host here>' response = http.request(request) puts response.read_body
Using the Utelly API with Javascript
In order to use the Utelly API with Javascript, click the desired API endpoint on the left. In the code snippets tab, select Javascript and the desired HTTP client library. Copy the code snippet and use it as required.
For example, RapidAPI provides the following Javascript code for the idlookup endpoint using the fetch library:
fetch("https://<your host here>/idlookup?source_id=tt0111161&source=imdb&country=us", { "method": "GET", "headers": { "x-rapidapi-key": "<your key here>", "x-rapidapi-host": "<your host here>" } }) .then(response => { console.log(response); }) .catch(err => { console.error(err); });
In addition, you can also use RapidAPI to obtain code snippets in several other programming languages like Node.js, C, Kotlin, Swift, etc.
Why should you use the Utelly API?
The Utelly API has several benefits that makes the API a good choice for developers looking for a content discovery API. Some of the benefits of the Utelly API are as follows:
Extensive Coverage – The most important benefit of the Utelly API is that it is not restricted to content hosted on a single OTT platform but supports a large number of platforms like Netflix, Amazon Prime, iTunes, YouTube, Peacock, HBO Max to name a few. Thus, users are guaranteed to get the most comprehensive data at any point in time.
Simple and Easy to Use – Another benefit of the Utelly API is that it is very simple and easy to use. It has only two endpoints that accept very few parameters. Thus, developers can easily use this API and integrate it into their applications without a steep learning curve.
Other Similar APIs
Just like Utelly, there are many other APIs available on RapidAPI that provide information related to movies, tv shows, and series. Some of these are listed below.
- OTT details API – The OTT Details API provides details of movies and TV shows across 150+ Streaming platforms in the US and India such as HBO, YouTube, Netflix, Prime Video, Hotstar, Hulu, etc.
- unogsNG API – The unoGSNG API is a Netflix search API. It allows searching for Netflix shows based on a wide variety of parameters.
- Movie Database – This is an alternative to the IMDb API. It provides detailed information about movies and TV shows like Genre, Year, IMDB rating. Release Date and much more.
- Entertainment Data Hub API – The Entertainment Data Hub API is another API that provides information about movies and TV series. In addition, it also provides information about video games. It provides information like availability on streaming services, year of release, ratings and more.
- Streaming Availability API – The Streaming availability API allows searching for content by platform. It supports platforms like Netflix, Prime, Disney, HBO, Hulu, and many other services across 60 countries.
Summary
So, to summarize, the Utelly API is a content discovery API. It exposes several endpoints that allow searching for the platforms where content is hosted based on the content id or content name. In this article, we learned how to use RapidAPI to connect to the Utelly 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 entertainment arena. Finally, we saw how we can use RapidAPI to obtain code snippets to execute the Utelly API endpoints in different programming languages.
Leave a Reply