streaming-availability
Version:
Streaming Availability API allows getting streaming availability information of movies and series; and querying the list of available shows on streaming services such as Netflix, Disney+, Apple TV, Max and Hulu across 60 countries!
159 lines (149 loc) • 37.7 kB
HTML
<html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>streaming-availability</title><meta name="description" content="Documentation for streaming-availability"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">streaming-availability</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><h1>streaming-availability</h1></div><div class="tsd-panel tsd-typography"><a id="md:streaming-availability-api-typescript-client" class="tsd-anchor"></a><h1 class="tsd-anchor-link">Streaming Availability API TypeScript Client<a href="#md:streaming-availability-api-typescript-client" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1><p><a href="https://www.npmjs.com/package/streaming-availability" target="_blank" class="external"><img src="https://img.shields.io/npm/v/streaming-availability?style=flat-square&logo=npm&color=blue" alt="npm"></a>
<a href="https://movieofthenight.github.io/ts-streaming-availability/" target="_blank" class="external"><img src="https://img.shields.io/badge/tsdoc-reference-blue?style=flat-square" alt="tsdoc"></a></p>
<p>This client can be used in both JavaScript and TypeScript projects;
and both in browser and Node environment.</p>
<p>Since using this client in browser would expose your API key to the public,
it is more secure to use it in server-side applications.
Using it in browser is only recommended for personal projects and
development purposes.</p>
<a id="md:streaming-availability-api" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Streaming Availability API<a href="#md:streaming-availability-api" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>Streaming Availability API allows getting streaming availability information of movies and series; and querying the list of available shows on streaming services such as Netflix, Disney+, Apple TV, Max and Hulu across 60 countries!</p>
<a id="md:api-key" class="tsd-anchor"></a><h3 class="tsd-anchor-link">API Key<a href="#md:api-key" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>To get an instant free subscription to start using the API, you can visit
<a href="https://docs.movieofthenight.com/guide/authorization" target="_blank" class="external">our Authorization guide</a>.</p>
<p>You can get started with a free plan without giving any payment information,
and upgrade to paid plans whenever you like.</p>
<a id="md:useful-links" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Useful Links<a href="#md:useful-links" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><ul>
<li>
<p><a href="https://www.movieofthenight.com/about/api" target="_blank" class="external">Official Webpage of the API</a></p>
</li>
<li>
<p><a href="https://docs.movieofthenight.com/" target="_blank" class="external">API Documentation</a></p>
</li>
<li>
<p><a href="https://www.movieofthenight.com/contact" target="_blank" class="external">Contact Form</a></p>
</li>
<li>
<p><a href="https://github.com/movieofthenight/streaming-availability-api" target="_blank" class="external">Main GitHub Repository of the API</a></p>
</li>
</ul>
<a id="md:features" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Features<a href="#md:features" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><ul>
<li>Query streaming availability info of the movies and series via their TMDb or IMDd ids.</li>
<li>Search for movies and series via their titles, genres, keywords, release years on
specific streaming services (e.g.: Get all the zombie action movies available
on Netflix and Disney+)</li>
<li>Order the search results by titles, release year
or popularity over different time periods
(e.g.: get the all-time most popular movies on Netflix US,
get the most popular series in the last 7 days
on Amazon Prime and Disney+ in the United Kingdom)</li>
<li>Get the list of upcoming & expiring titles</li>
<li>Get the daily Top 10 lists</li>
<li>Returned streaming availability info includes:
<ul>
<li>Deep links into the streaming services for
movies, series, seasons and episodes,</li>
<li>Available video qualities (eg. SD, HD, UHD),</li>
<li>Available subtitles and audios,</li>
<li>First detection time of the shows on the streaming services,</li>
<li>Expiry date of the shows/seasons/episodes on the streaming services,</li>
<li>All the available options to stream a show
(e.g. via subscription, to buy/rent, for free, available via an addons),</li>
<li>Price and currency information for buyable/rentable shows</li>
</ul>
</li>
<li>Channel and addon support (e.g. Apple TV Channels, Hulu Addons, Prime Video Channels)</li>
<li>Posters, backdrops, cast & director information, genres, rating and many other details of the shows</li>
<li>Output also includes TMDB and IMDb ids for every show</li>
</ul>
<a id="md:install" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Install<a href="#md:install" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="md:via-npm" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Via NPM<a href="#md:via-npm" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-0">i</span><span class="hl-1"> </span><span class="hl-0">streaming</span><span class="hl-1">-</span><span class="hl-0">availability</span>
</code><button>Copy</button></pre>
<blockquote>
<p>Requires Node version <code>18.0.0</code> or higher.</p>
</blockquote>
<a id="md:via-script-tag-from-cdn" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Via Script Tag from CDN<a href="#md:via-script-tag-from-cdn" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="html"><span class="hl-2"><</span><span class="hl-3">script</span><span class="hl-4"> </span><span class="hl-5">src</span><span class="hl-4">=</span><span class="hl-6">"https://cdn.jsdelivr.net/gh/movieofthenight/ts-streaming-availability@v4.5.0/bundle.min.js"</span><span class="hl-2">></</span><span class="hl-3">script</span><span class="hl-2">></span>
</code><button type="button">Copy</button></pre>
<p>This script creates a global variable at <code>window.streamingAvailability</code>
where you can access to the module.</p>
<a id="md:usage" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Usage<a href="#md:usage" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="md:node" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Node<a href="#md:node" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-7">import</span><span class="hl-1"> </span><span class="hl-8">*</span><span class="hl-1"> </span><span class="hl-7">as</span><span class="hl-1"> </span><span class="hl-0">streamingAvailability</span><span class="hl-1"> </span><span class="hl-7">from</span><span class="hl-1"> </span><span class="hl-9">"streaming-availability"</span><span class="hl-1">;</span><br/><br/><span class="hl-8">const</span><span class="hl-1"> </span><span class="hl-10">API_KEY</span><span class="hl-1"> = </span><span class="hl-9">"<YOUR_API_KEY>"</span><span class="hl-1">;</span><br/><br/><span class="hl-8">const</span><span class="hl-1"> </span><span class="hl-10">client</span><span class="hl-1"> = </span><span class="hl-8">new</span><span class="hl-1"> </span><span class="hl-0">streamingAvailability</span><span class="hl-1">.</span><span class="hl-11">Client</span><span class="hl-1">(</span><span class="hl-8">new</span><span class="hl-1"> </span><span class="hl-0">streamingAvailability</span><span class="hl-1">.</span><span class="hl-11">Configuration</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-0">apiKey:</span><span class="hl-1"> </span><span class="hl-10">API_KEY</span><br/><span class="hl-1">}));</span><br/><br/><span class="hl-12">// Start using the client</span>
</code><button type="button">Copy</button></pre>
<a id="md:script-tag" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Script Tag<a href="#md:script-tag" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="html"><span class="hl-2"><!</span><span class="hl-3">DOCTYPE</span><span class="hl-1"> </span><span class="hl-5">html</span><span class="hl-2">></span><br/><span class="hl-2"><</span><span class="hl-3">html</span><span class="hl-1"> </span><span class="hl-5">lang</span><span class="hl-1">=</span><span class="hl-6">"en"</span><span class="hl-2">></span><br/><span class="hl-2"><</span><span class="hl-3">head</span><span class="hl-2">></span><br/><span class="hl-1"> </span><span class="hl-2"><</span><span class="hl-3">meta</span><span class="hl-1"> </span><span class="hl-5">charset</span><span class="hl-1">=</span><span class="hl-6">"UTF-8"</span><span class="hl-2">></span><br/><span class="hl-1"> </span><span class="hl-2"><</span><span class="hl-3">title</span><span class="hl-2">></span><span class="hl-1">Example</span><span class="hl-2"></</span><span class="hl-3">title</span><span class="hl-2">></span><br/><span class="hl-2"></</span><span class="hl-3">head</span><span class="hl-2">></span><br/><span class="hl-2"><</span><span class="hl-3">body</span><span class="hl-1"> </span><span class="hl-5">style</span><span class="hl-1">=</span><span class="hl-6">"white-space: pre-line"</span><span class="hl-2">></span><br/><span class="hl-1"> </span><span class="hl-2"><</span><span class="hl-3">script</span><span class="hl-4"> </span><span class="hl-5">src</span><span class="hl-4">=</span><span class="hl-6">"https://cdn.jsdelivr.net/gh/movieofthenight/ts-streaming-availability@v4.5.0/bundle.min.js"</span><span class="hl-2">></</span><span class="hl-3">script</span><span class="hl-2">></span><br/><span class="hl-1"> </span><span class="hl-2"><</span><span class="hl-3">script</span><span class="hl-4"> </span><span class="hl-5">type</span><span class="hl-4">=</span><span class="hl-6">"module"</span><span class="hl-2">></span><br/><span class="hl-4"> </span><span class="hl-8">const</span><span class="hl-4"> </span><span class="hl-10">API_KEY</span><span class="hl-4"> </span><span class="hl-1">=</span><span class="hl-4"> </span><span class="hl-9">"<YOUR_API_KEY>"</span><span class="hl-4">;</span><br/><br/><span class="hl-4"> </span><span class="hl-8">const</span><span class="hl-4"> </span><span class="hl-10">client</span><span class="hl-4"> </span><span class="hl-1">=</span><span class="hl-4"> </span><span class="hl-8">new</span><span class="hl-4"> </span><span class="hl-0">streamingAvailability</span><span class="hl-4">.</span><span class="hl-11">Client</span><span class="hl-4">(</span><span class="hl-8">new</span><span class="hl-4"> </span><span class="hl-0">streamingAvailability</span><span class="hl-4">.</span><span class="hl-11">Configuration</span><span class="hl-4">({</span><br/><span class="hl-4"> </span><span class="hl-0">apiKey:</span><span class="hl-4"> </span><span class="hl-10">API_KEY</span><br/><span class="hl-4"> }));</span><br/><br/><span class="hl-4"> </span><span class="hl-12">// Start using the client</span><br/><span class="hl-4"> </span><span class="hl-2"></</span><span class="hl-3">script</span><span class="hl-2">></span><br/><span class="hl-2"></</span><span class="hl-3">body</span><span class="hl-2">></span><br/><span class="hl-2"></</span><span class="hl-3">html</span><span class="hl-2">></span>
</code><button type="button">Copy</button></pre>
<a id="md:examples" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Examples<a href="#md:examples" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>These examples assume that you are running inside
a module, since it uses
<a href="https://github.com/tc39/proposal-top-level-await" target="_blank" class="external">top level await</a>.</p>
<p>In
<a href="https://github.com/movieofthenight/ts-streaming-availability/blob/main/examples" target="_blank" class="external">examples</a>
folder, you can find sample package setups that
you can take as a reference.</p>
<a id="md:get-the-godfathers-streaming-availability-info" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Get The Godfather's Streaming Availability Info<a href="#md:get-the-godfathers-streaming-availability-info" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-7">import</span><span class="hl-1"> </span><span class="hl-8">*</span><span class="hl-1"> </span><span class="hl-7">as</span><span class="hl-1"> </span><span class="hl-0">streamingAvailability</span><span class="hl-1"> </span><span class="hl-7">from</span><span class="hl-1"> </span><span class="hl-9">"streaming-availability"</span><span class="hl-1">;</span><br/><br/><span class="hl-8">const</span><span class="hl-1"> </span><span class="hl-10">API_KEY</span><span class="hl-1"> = </span><span class="hl-9">"<YOUR_API_KEY>"</span><span class="hl-1">;</span><br/><br/><span class="hl-8">const</span><span class="hl-1"> </span><span class="hl-10">client</span><span class="hl-1"> = </span><span class="hl-8">new</span><span class="hl-1"> </span><span class="hl-0">streamingAvailability</span><span class="hl-1">.</span><span class="hl-11">Client</span><span class="hl-1">(</span><span class="hl-8">new</span><span class="hl-1"> </span><span class="hl-0">streamingAvailability</span><span class="hl-1">.</span><span class="hl-11">Configuration</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-0">apiKey:</span><span class="hl-1"> </span><span class="hl-10">API_KEY</span><br/><span class="hl-1">}));</span><br/><br/><span class="hl-8">let</span><span class="hl-1"> </span><span class="hl-0">show</span><span class="hl-1"> = </span><span class="hl-7">await</span><span class="hl-1"> </span><span class="hl-0">client</span><span class="hl-1">.</span><span class="hl-0">showsApi</span><span class="hl-1">.</span><span class="hl-11">getShow</span><span class="hl-1">(</span><br/><span class="hl-1"> {</span><span class="hl-0">id:</span><span class="hl-1"> </span><span class="hl-9">"tt0068646"</span><span class="hl-1">, </span><span class="hl-0">country:</span><span class="hl-1"> </span><span class="hl-9">"us"</span><span class="hl-1">}</span><br/><span class="hl-1">);</span><br/><br/><span class="hl-0">console</span><span class="hl-1">.</span><span class="hl-11">log</span><span class="hl-1">(</span><span class="hl-0">show</span><span class="hl-1">.</span><span class="hl-0">title</span><span class="hl-1">);</span><br/><span class="hl-0">console</span><span class="hl-1">.</span><span class="hl-11">log</span><span class="hl-1">(</span><span class="hl-0">show</span><span class="hl-1">.</span><span class="hl-0">overview</span><span class="hl-1">);</span><br/><span class="hl-0">show</span><span class="hl-1">.</span><span class="hl-0">streamingOptions</span><span class="hl-1">[</span><span class="hl-9">"us"</span><span class="hl-1">].</span><span class="hl-11">forEach</span><span class="hl-1">((</span><span class="hl-0">streamingOption</span><span class="hl-1">) </span><span class="hl-8">=></span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">console</span><span class="hl-1">.</span><span class="hl-11">log</span><span class="hl-1">(</span><span class="hl-0">streamingOption</span><span class="hl-1">.</span><span class="hl-0">link</span><span class="hl-1">);</span><br/><span class="hl-1">});</span>
</code><button type="button">Copy</button></pre>
<a id="md:via-script-tag" class="tsd-anchor"></a><h4 class="tsd-anchor-link">Via Script Tag<a href="#md:via-script-tag" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="html"><span class="hl-2"><!</span><span class="hl-3">DOCTYPE</span><span class="hl-1"> </span><span class="hl-5">html</span><span class="hl-2">></span><br/><span class="hl-2"><</span><span class="hl-3">html</span><span class="hl-1"> </span><span class="hl-5">lang</span><span class="hl-1">=</span><span class="hl-6">"en"</span><span class="hl-2">></span><br/><span class="hl-2"><</span><span class="hl-3">head</span><span class="hl-2">></span><br/><span class="hl-1"> </span><span class="hl-2"><</span><span class="hl-3">meta</span><span class="hl-1"> </span><span class="hl-5">charset</span><span class="hl-1">=</span><span class="hl-6">"UTF-8"</span><span class="hl-2">></span><br/><span class="hl-1"> </span><span class="hl-2"><</span><span class="hl-3">title</span><span class="hl-2">></span><span class="hl-1">The Godfather</span><span class="hl-2"></</span><span class="hl-3">title</span><span class="hl-2">></span><br/><span class="hl-2"></</span><span class="hl-3">head</span><span class="hl-2">></span><br/><span class="hl-2"><</span><span class="hl-3">body</span><span class="hl-1"> </span><span class="hl-5">style</span><span class="hl-1">=</span><span class="hl-6">"white-space: pre-line"</span><span class="hl-2">></span><br/><span class="hl-1"> </span><span class="hl-2"><</span><span class="hl-3">script</span><span class="hl-4"> </span><span class="hl-5">src</span><span class="hl-4">=</span><span class="hl-6">"https://cdn.jsdelivr.net/gh/movieofthenight/ts-streaming-availability@v4.5.0/bundle.min.js"</span><span class="hl-2">></</span><span class="hl-3">script</span><span class="hl-2">></span><br/><span class="hl-1"> </span><span class="hl-2"><</span><span class="hl-3">script</span><span class="hl-4"> </span><span class="hl-5">type</span><span class="hl-4">=</span><span class="hl-6">"module"</span><span class="hl-2">></span><br/><span class="hl-4"> </span><span class="hl-8">const</span><span class="hl-4"> </span><span class="hl-10">API_KEY</span><span class="hl-4"> </span><span class="hl-1">=</span><span class="hl-4"> </span><span class="hl-9">"<YOUR_API_KEY>"</span><span class="hl-4">;</span><br/><br/><span class="hl-4"> </span><span class="hl-8">const</span><span class="hl-4"> </span><span class="hl-10">client</span><span class="hl-4"> </span><span class="hl-1">=</span><span class="hl-4"> </span><span class="hl-8">new</span><span class="hl-4"> </span><span class="hl-0">streamingAvailability</span><span class="hl-4">.</span><span class="hl-11">Client</span><span class="hl-4">(</span><span class="hl-8">new</span><span class="hl-4"> </span><span class="hl-0">streamingAvailability</span><span class="hl-4">.</span><span class="hl-11">Configuration</span><span class="hl-4">({</span><br/><span class="hl-4"> </span><span class="hl-0">apiKey:</span><span class="hl-4"> </span><span class="hl-10">API_KEY</span><br/><span class="hl-4"> }));</span><br/><br/><span class="hl-4"> </span><span class="hl-8">let</span><span class="hl-4"> </span><span class="hl-0">show</span><span class="hl-4"> </span><span class="hl-1">=</span><span class="hl-4"> </span><span class="hl-7">await</span><span class="hl-4"> </span><span class="hl-0">client</span><span class="hl-4">.</span><span class="hl-0">showsApi</span><span class="hl-4">.</span><span class="hl-11">getShow</span><span class="hl-4">(</span><br/><span class="hl-4"> {</span><span class="hl-0">id:</span><span class="hl-4"> </span><span class="hl-9">"tt0068646"</span><span class="hl-4">, </span><span class="hl-0">country:</span><span class="hl-4"> </span><span class="hl-9">"us"</span><span class="hl-4">}</span><br/><span class="hl-4"> );</span><br/><span class="hl-4"> </span><span class="hl-0">document</span><span class="hl-4">.</span><span class="hl-0">body</span><span class="hl-4">.</span><span class="hl-0">textContent</span><span class="hl-4"> </span><span class="hl-1">=</span><span class="hl-4"> </span><span class="hl-0">show</span><span class="hl-4">.</span><span class="hl-0">title</span><span class="hl-4"> </span><span class="hl-1">+</span><span class="hl-4"> </span><span class="hl-9">"</span><span class="hl-13">\r\n</span><span class="hl-9">"</span><span class="hl-4">;</span><br/><span class="hl-4"> </span><span class="hl-0">document</span><span class="hl-4">.</span><span class="hl-0">body</span><span class="hl-4">.</span><span class="hl-0">textContent</span><span class="hl-4"> </span><span class="hl-1">+=</span><span class="hl-4"> </span><span class="hl-0">show</span><span class="hl-4">.</span><span class="hl-0">overview</span><span class="hl-4"> </span><span class="hl-1">+</span><span class="hl-4"> </span><span class="hl-9">"</span><span class="hl-13">\r\n</span><span class="hl-9">"</span><span class="hl-4">;</span><br/><span class="hl-4"> </span><span class="hl-0">show</span><span class="hl-4">.</span><span class="hl-0">streamingOptions</span><span class="hl-4">[</span><span class="hl-9">"us"</span><span class="hl-4">].</span><span class="hl-11">forEach</span><span class="hl-4">((</span><span class="hl-0">streamingOption</span><span class="hl-4">) </span><span class="hl-8">=></span><span class="hl-4"> {</span><br/><span class="hl-4"> </span><span class="hl-0">document</span><span class="hl-4">.</span><span class="hl-0">body</span><span class="hl-4">.</span><span class="hl-0">textContent</span><span class="hl-4"> </span><span class="hl-1">+=</span><span class="hl-4"> </span><span class="hl-0">streamingOption</span><span class="hl-4">.</span><span class="hl-0">link</span><span class="hl-4"> </span><span class="hl-1">+</span><span class="hl-4"> </span><span class="hl-9">"</span><span class="hl-13">\r\n</span><span class="hl-9">"</span><span class="hl-4">;</span><br/><span class="hl-4"> });</span><br/><span class="hl-4"> </span><span class="hl-2"></</span><span class="hl-3">script</span><span class="hl-2">></span><br/><span class="hl-2"></</span><span class="hl-3">body</span><span class="hl-2">></span><br/><span class="hl-2"></</span><span class="hl-3">html</span><span class="hl-2">></span>
</code><button type="button">Copy</button></pre>
<blockquote>
<p>Checkout
<a href="https://github.com/movieofthenight/ts-streaming-availability/blob/main/examples" target="_blank" class="external">examples</a>
folder for the rest of the examples.</p>
</blockquote>
<a id="md:auto-pagination" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Auto Pagination<a href="#md:auto-pagination" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>This client supports auto-pagination for the paginated endpoints.</p>
<p>If you'd like to use auto-pagination,
you can call the corresponding auto pagination
versions of the functions.</p>
<p>An example call without auto pagination:</p>
<pre><code class="ts"><span class="hl-8">const</span><span class="hl-1"> </span><span class="hl-10">searchResult</span><span class="hl-1"> = </span><span class="hl-7">await</span><span class="hl-1"> </span><span class="hl-0">client</span><span class="hl-1">.</span><span class="hl-0">showsApi</span><span class="hl-1">.</span><span class="hl-11">searchShowsByFilters</span><span class="hl-1">(({</span><br/><span class="hl-1"> </span><span class="hl-0">country:</span><span class="hl-1"> </span><span class="hl-9">"us"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-0">catalogs:</span><span class="hl-1"> [</span><span class="hl-9">"netflix"</span><span class="hl-1">],</span><br/><span class="hl-1"> </span><span class="hl-0">genres:</span><span class="hl-1"> [</span><span class="hl-9">"action"</span><span class="hl-1">],</span><br/><span class="hl-1"> </span><span class="hl-0">showType:</span><span class="hl-1"> </span><span class="hl-0">streamingAvailability</span><span class="hl-1">.</span><span class="hl-0">ShowType</span><span class="hl-1">.</span><span class="hl-0">Movie</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-0">orderBy:</span><span class="hl-1"> </span><span class="hl-9">"popularity_1year"</span><span class="hl-1">,</span><br/><span class="hl-1">}));</span>
</code><button type="button">Copy</button></pre>
<p>An example call with auto pagination
that fetches at most 3 pages:</p>
<pre><code class="ts"><span class="hl-8">const</span><span class="hl-1"> </span><span class="hl-10">shows</span><span class="hl-1"> = </span><span class="hl-0">client</span><span class="hl-1">.</span><span class="hl-0">showsApi</span><span class="hl-1">.</span><span class="hl-11">searchShowsByFiltersWithAutoPagination</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-0">country:</span><span class="hl-1"> </span><span class="hl-9">"us"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-0">catalogs:</span><span class="hl-1"> [</span><span class="hl-9">"netflix"</span><span class="hl-1">],</span><br/><span class="hl-1"> </span><span class="hl-0">genres:</span><span class="hl-1"> [</span><span class="hl-9">"action"</span><span class="hl-1">],</span><br/><span class="hl-1"> </span><span class="hl-0">showType:</span><span class="hl-1"> </span><span class="hl-0">streamingAvailability</span><span class="hl-1">.</span><span class="hl-0">ShowType</span><span class="hl-1">.</span><span class="hl-0">Movie</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-0">orderBy:</span><span class="hl-1"> </span><span class="hl-9">"popularity_1year"</span><span class="hl-1">,</span><br/><span class="hl-1">}, </span><span class="hl-14">3</span><span class="hl-1">)</span>
</code><button type="button">Copy</button></pre>
<p>Then you can iterate over the results in the following way:</p>
<pre><code class="ts"><span class="hl-7">for</span><span class="hl-1"> </span><span class="hl-7">await</span><span class="hl-1"> (</span><span class="hl-8">const</span><span class="hl-1"> </span><span class="hl-10">show</span><span class="hl-1"> </span><span class="hl-8">of</span><span class="hl-1"> </span><span class="hl-0">shows</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-12">// Do something with the show</span><br/><span class="hl-1">}</span>
</code><button type="button">Copy</button></pre>
<a id="md:terms--conditions-and-attribution" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Terms & Conditions and Attribution<a href="#md:terms--conditions-and-attribution" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>While the client libraries have MIT licenses,
the Streaming Availability API itself has further
<a href="https://developers.movieofthenight.com/terms-and-conditions" target="_blank" class="external">Terms & Conditions</a>.
Make sure to read it before using the API.</p>
<p>Notably, the API requires an attribution to itself, if the data acquired through
is made public. You can read further about the attribution requirement on the
<a href="https://developers.movieofthenight.com/terms-and-conditions" target="_blank" class="external">Terms & Conditions</a>
page.</p>
<a id="md:contact-us" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Contact Us<a href="#md:contact-us" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>If you have any questions or need further assistance, please don't hesitate to reach us via
<a href="https://www.movieofthenight.com/contact" target="_blank" class="external">our contact form</a>.</p>
<a id="md:faq" class="tsd-anchor"></a><h2 class="tsd-anchor-link">FAQ<a href="#md:faq" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><ul>
<li>
<p><strong>How often the data is updated?</strong></p>
<ul>
<li>The data is updated daily.</li>
</ul>
</li>
<li>
<p><strong>I run into an issue. How can I get help?</strong></p>
<ul>
<li>Send us a message via <a href="https://www.movieofthenight.com/contact" target="_blank" class="external">our contact form</a>,
and we will get back to you as soon as possible.</li>
</ul>
</li>
<li>
<p><strong>API returned me some wrong data. What can I do?</strong></p>
<ul>
<li>Send us a message with details of your findings.
You can reach ous via <a href="https://www.movieofthenight.com/contact" target="_blank" class="external">our contact form</a>.
Once we receive the message we will take a look into the problems and fix the data.</li>
</ul>
</li>
<li>
<p><strong>I have a request to get a new streaming service supported by the API.</strong></p>
<ul>
<li>Send us a message via <a href="https://www.movieofthenight.com/contact" target="_blank" class="external">our contact form</a>,
and we will get back to you.</li>
</ul>
</li>
<li>
<p><strong>I need a client library in another language.</strong></p>
<ul>
<li>Send us a message via <a href="https://www.movieofthenight.com/contact" target="_blank" class="external">our contact form</a>,
and we will get back to you.</li>
</ul>
</li>
</ul>
<a id="md:client-libraries" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Client Libraries<a href="#md:client-libraries" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p><a href="https://docs.movieofthenight.com/guide/client-libraries" target="_blank" class="external">Click here to see the full list of official client libraries</a></p>
<a id="md:services--countries-supported" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Services & Countries Supported<a href="#md:services--countries-supported" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>We support all the major streaming services across the globe, <a href="https://docs.movieofthenight.com/guide/countries-and-services" target="_blank" class="external">click here to see the full list!</a></p>
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#md:streaming-availability-api-typescript-client"><span>Streaming <wbr/>Availability API <wbr/>Type<wbr/>Script <wbr/>Client</span></a><ul><li><a href="#md:streaming-availability-api"><span>Streaming <wbr/>Availability API</span></a></li><li><ul><li><a href="#md:api-key"><span>API <wbr/>Key</span></a></li><li><a href="#md:useful-links"><span>Useful <wbr/>Links</span></a></li><li><a href="#md:features"><span>Features</span></a></li></ul></li><li><a href="#md:install"><span>Install</span></a></li><li><ul><li><a href="#md:via-npm"><span>Via NPM</span></a></li><li><a href="#md:via-script-tag-from-cdn"><span>Via <wbr/>Script <wbr/>Tag from CDN</span></a></li></ul></li><li><a href="#md:usage"><span>Usage</span></a></li><li><ul><li><a href="#md:node"><span>Node</span></a></li><li><a href="#md:script-tag"><span>Script <wbr/>Tag</span></a></li></ul></li><li><a href="#md:examples"><span>Examples</span></a></li><li><ul><li><a href="#md:get-the-godfathers-streaming-availability-info"><span>Get <wbr/>The <wbr/>Godfather's <wbr/>Streaming <wbr/>Availability <wbr/>Info</span></a></li><li><ul><li><a href="#md:via-script-tag"><span>Via <wbr/>Script <wbr/>Tag</span></a></li></ul></li></ul></li><li><a href="#md:auto-pagination"><span>Auto <wbr/>Pagination</span></a></li><li><a href="#md:terms--conditions-and-attribution"><span>Terms & <wbr/>Conditions and <wbr/>Attribution</span></a></li><li><a href="#md:contact-us"><span>Contact <wbr/>Us</span></a></li><li><a href="#md:faq"><span>FAQ</span></a></li><li><a href="#md:client-libraries"><span>Client <wbr/>Libraries</span></a></li><li><a href="#md:services--countries-supported"><span>Services & <wbr/>Countries <wbr/>Supported</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-1"></use></svg><span>streaming-availability</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base="."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>