Giter Club home page Giter Club logo

movieofthenight / go-streaming-availability Goto Github PK

View Code? Open in Web Editor NEW
5.0 0.0 0.0 954 KB

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 multiple countries!

Home Page: https://www.movieofthenight.com/about/api/

License: MIT License

Go 100.00%
api apple-tv appletv disney disneyplus hbo hbomax hulu max netflix

go-streaming-availability's Introduction

Streaming Availability API Go Client

go-github release (latest SemVer) GoDoc

Streaming Availability API

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 59 countries!

API Key

To get an instant free subscription to start using the API, you can visit the RapidAPI page of the API.

With a free subscription, you can send 100 requests per day. To send more requests, you can upgrade to paid plans whenever you like.

Useful Links

Features

  • Query streaming availability info of the movies and series via their TMDb or IMDd ids.
  • 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+)
  • 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)
  • Returned streaming availability info includes:
    • Deep links into the streaming services for movies, series, seasons and episodes,
    • Available video qualities (eg. SD, HD, UHD),
    • Available subtitles and audios,
    • First detection time of the shows on the streaming services,
    • Expiry date of the shows/seasons/episodes on the streaming services,
    • All the available options to stream a show (e.g. via subscription, to buy/rent, for free, available via an addons),
    • Price and currency information for buyable/rentable shows
  • Channel and addon support (e.g. Apple TV Channels, Hulu Addons, Prime Video Channels)
  • Posters, backdrops, cast & director information, genres, rating and many other details of the shows
  • Output also includes TMDB and IMDb ids for every show

Installation

Run

go get github.com/movieofthenight/go-streaming-availability/v4

Usage

package main

import "github.com/movieofthenight/go-streaming-availability/v4"

const RapidApiKey = "PUT_YOUR_RAPIDAPI_KEY_HERE"

func main() {
	client := streaming.NewAPIClientFromRapidAPIKey(RapidApiKey, nil)
	// Start using the client
}

Examples

Get The Godfather's Streaming Availability Info

package main

import (
	"context"
	"fmt"
	"log"
	"strings"

	"github.com/movieofthenight/go-streaming-availability/v4"
)

func main() {
	const RapidApiKey = "PUT_YOUR_RAPIDAPI_KEY_HERE"

	client := streaming.NewAPIClientFromRapidAPIKey(RapidApiKey, nil)
	show, _, err := client.ShowsAPI.GetShow(context.Background(), "tt0068646").Country("us").Execute()
	if err != nil {
		log.Fatal(err)
	}
	if show == nil {
		log.Fatal("Show not found")
	}
	fmt.Printf("Title: %s\n", show.Title)
	fmt.Printf("Overview: %s\n", show.Overview)
	for _, streamingOption := range show.StreamingOptions["us"] {
		fmt.Printf("Available on %s", streamingOption.Service.Name)
		switch streamingOption.Type {
		case streaming.ADDON:
			fmt.Printf(" via addon %s", streamingOption.Addon.Name)
		case streaming.BUY:
			fmt.Print(" to buy")
		case streaming.RENT:
			fmt.Print(" to rent")
		case streaming.FREE:
			fmt.Print(" for free")
		}
		if streamingOption.HasPrice() {
			fmt.Printf(" for %s", streamingOption.Price.Formatted)
		}
		if streamingOption.HasQuality() {
			fmt.Printf(" in %s quality", strings.ToUpper(*streamingOption.Quality))
		}
		fmt.Printf(" at %s\n", streamingOption.Link)
	}
}

Checkout example_test.go file for the rest of the examples.

Auto Pagination

This client supports auto-pagination for the paginated endpoints.

If you'd like to use auto-pagination, you can call the ExecuteWithAutoPagination function instead of the Execute function.

An example call without auto pagination:

searchResult, _, err := client.ShowsAPI.SearchShowsByFilters(context.Background()).
	Genres([]string{"comedy"}).
	OrderBy("popularity_1year").
	Country("us").
	Catalogs([]string{"netflix"}).Execute()

An example call with auto pagination that fetches at most 3 pages:

shows, err := client.ShowsAPI.SearchShowsByFilters(context.Background()).
	Genres([]string{"comedy"}).
	OrderBy("popularity_1year").
	Country("us").
	Catalogs([]string{"netflix"}).ExecuteWithAutoPagination(3)

Then you can iterate over the results in the following way:

for shows.Next() {
	show := shows.Get()
	// Do something with the show
}
// Check if there was an error during pagination
if shows.Err() != nil {
	log.Fatal(shows.Err())
}

Terms & Conditions and Attribution

While the client libraries have MIT licenses, the Streaming Availability API itself has further Terms & Conditions. Make sure to read it before using the API.

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 Terms & Conditions page.

Contact Us

If you have any questions or need further assistance, please don't hesitate to reach us via our contact form.

FAQ

  • I run into an issue. How can I get help?

    • If the issue is related to the API itself, please create a post here, and we will help with the issue.
    • If the issue is specific to a client library, then you can create a new issue on the respective repository of the library.
  • API returned me some wrong data. What can I do?

    • Send us a message with details of your findings. You can reach ous via our contact form. Once we receive the message we will take a look into the problems and fix the data.
  • I have a request to get a new streaming service supported by the API.

  • I need a client library in another language.

  • What is RapidAPI?

    • RapidAPI is the world's largest API marketplace. We use RapidAPI to handle the API subscriptions for us. You can instantly subscribe to Streaming Availability on RapidAPI and start using the Streaming Availability API through RapidAPI right away.

Client Libraries

  1. Go
  2. TypeScript/JavaScript

Services Supported

Service Id Service Name Supported Countries
netflix Netflix 58 Countries
prime Prime Video 56 Countries
disney Disney+ 36 Countries
hbo HBO Max 24 Countries
hulu Hulu United States
peacock Peacock United States
paramount Paramount+ 18 Countries
starz Starz United States
apple Apple TV 52 Countries
mubi Mubi 53 Countries
stan Stan Australia
now Now United Kingdom, Ireland, Italy
crave Crave Canada
all4 Channel 4 United Kingdom, Ireland
iplayer BBC iPlayer United Kingdom
britbox BritBox United States, Canada, Australia, South Africa
hotstar Hotstar India, Canada, United Kingdom, Singapore
zee5 Zee5 58 Countries
curiosity Curiosity Stream 57 Countries
wow Wow Germany

Countries Supported

Country Code Country Name
ae United Emirates
ar Argentina
at Austria
au Australia
az Azerbaijan
be Belgium
bg Bulgaria
br Brazil
ca Canada
ch Switzerland
cl Chile
co Colombia
cy Cyprus
cz Czech Republic
de Germany
dk Denmark
ec Ecuador
ee Estonia
es Spain
fi Finland
fr France
gb United Kingdom
gr Greece
hk Hong Kong
hr Croatia
hu Hungary
id Indonesia
ie Ireland
il Israel
in India
is Iceland
it Italy
jp Japan
kr South Korea
lt Lithuania
md Moldova
mk North Macedonia
mx Mexico
my Malaysia
nl Netherlands
no Norway
nz New Zealand
pa Panama
pe Peru
ph Philippines
pl Poland
pt Portugal
ro Romania
rs Serbia
ru Russia
se Sweden
sg Singapore
si Slovenia
th Thailand
tr Turkey
ua Ukraine
us United States
vn Vietnam
za South Africa

go-streaming-availability's People

Contributors

the-maestro-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.