npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tvmaze-node

v1.0.4

Published

A Node.js library for accessing TVmaze API

Downloads

12

Readme

tvmaze-node

A Node.js library for accessing the TVmaze API. Pull requests are welcome.

Installation

To install with NPM

$ npm install --save tvmaze-node

Usage

Access to TVmaze's API does not require an API Key.
The code below will return the results for any show that matches "Lost"

var tvmaze = require("tvmaze-node");

tvmaze.search("Lost", function(error, response) {
    // handle errors and response
});

Endpoints

Search

Show Search

Search through all the shows in the TVmaze API by the show's name. Results are returned in order of relevancy and contain full information about the show.

Example: http://api.tvmaze.com/search/shows?q=lost

tvmaze.search("Lost", function(error, response) {
    // handle errors and response
});

Show Single Search

Search for a single show. You can also embed additional data such as the episodes by passing 'episodes' as a second parameter

Example: http://api.tvmaze.com/singlesearch/shows?q=lost

tvmaze.singleShow("Lost", function(error, response) {
    // handle errors and response
});

Example: http://api.tvmaze.com/singlesearch/shows?q=lost&embed=episodes

tvmaze.singleShow("Lost", "episodes", function(error, response) {
    // handle errors and response
});

Show Lookup

If you already know a show's tvrage, thetvdb or IMDB ID, then you can get the show information. Pass either 'tvrage', 'thetvdb', or 'imdb' as the first parameter.

Example: http://api.tvmaze.com/lookup/shows?tvrage=24493

tvmaze.showLookup('tvrage',24493, function(error, response) {
    // handle errors and response
});

People Search

Return show information based on a person.

Example: http://api.tvmaze.com/search/people?q=lauren

tvmaze.peopleSearch('lauren', function(error, response) {
    // handle errors and response
});

Schedule

Return a complete list of episodes that air in a country on a date. Pass the countries ISO 3166-1 code as the first parameter, and the date as an ISO 8601 format.

If no country is provided, it defaults to the US, if no date is provided, it defaults to today.

Example:
Example: http://api.tvmaze.com/schedule?country=US&date=2014-12-01

tvmaze.schedule('US', '2014-12-01', function(error, response) {
    // handle errors and response
});

Full Schedule

Returns a list of all future episodes know to TVmaze, regardless of their country

Example: http://api.tvmaze.com/schedule/full

tvmaze.fullSchedule(function(error, response) {
    // handle errors and response
});

All Show Information

To retrieve all the information for a specific show, you must use the ID from the TVmaze.

Main Information

You can get the episodes for a show, or you can embed additional information as per the TVmaze API

Example: http://api.tvmaze.com/shows/3

tvmaze.showById(3, false, false, function(error, response) {
    // handle errors and response
});

Example: http://api.tvmaze.com/shows/3?embed=cast

tvmaze.showById(3, "embed", ["cast"], function(error, response) {
    // handle errors and response
});

Episode List

Return a list of episodes for the show. You can include specials as per the example below.

Example: http://api.tvmaze.com/shows/3/episodes

tvmaze.showById(3, "episodes", false, function(error, response) {
    // handle errors and response
});

Example: http://api.tvmaze.com/shows/3/episodes?specials=1

tvmaze.showById(3, "episodes", "specials", function(error, response) {
    // handle errors and response
});

Episode by Number

Return one specific episode from a show given its season number and episode number.

Example: http://api.tvmaze.com/shows/3/episodebynumber?season=1&number=1

tvmaze.showById(3, "episodesbynumber", [1,1], function(error, response) {
    // handle errors and response
});

Episodes by date

Return all episodes that aired on a specific date

Example: http://api.tvmaze.com/shows/3/episodesbydate?date=2013-07-01

tvmaze.showById(3, "episodesbydate", "2013-07-01", function(error, response) {
    // handle errors and response
});

Show Seasons

Return a list of seasons for a show

Example: http://api.tvmaze.com/shows/3/seasons

tvmaze.showById(3, "seasons", false, function(error, response) {
    // handle errors and response
});

Show Cast

Return a list of the cast for a show

Example: http://api.tvmaze.com/shows/3/cast

tvmaze.showById(3, "cast", false, function(error, response) {
    // handle errors and response
});

Show AKAs

Return a list of aliases for a show

Example: http://api.tvmaze.com/shows/3/akas

tvmaze.showById(3, "akas", false, function(error, response) {
    // handle errors and response
});

Show Index

Return a list of all shows in the TVmaze database. There are 250 shows per page and shows never change pages. The first page is page 0

Example: http://api.tvmaze.com/shows?page=0

tvmaze.showIndex(0, function(error, response) {
    // handle errors and response
});

Show People Information

Return a information for a given person. You can also embed additional information if needed.

Show Main Information

Example: http://api.tvmaze.com/people/1

tvmaze.peopleInfo(1, false, false, function(error, response) {
    // handle errors and response
});

Example: http://api.tvmaze.com/people/1?embed=castcredits

tvmaze.peopleInfo(1, "embed", "castcredits", function(error, response) {
    // handle errors and response
});

Show Cast Information

Show cast credits for a given person. You can also embed additional information such as the shows they've featured in.

Example: http://api.tvmaze.com/people/1/castcredits

tvmaze.peopleInfo(1, "castcredits", false, function(error, response) {
    // handle errors and response
});

Example: http://api.tvmaze.com/people/1/castcredits?embed=show

tvmaze.peopleInfo(1, "castcredits",['show'], function(error, response) {
    // handle errors and response
});

Show Crew Information

Show crew credits for a given person. You can also embed additional information such as the shows they've featured in.

Example: http://api.tvmaze.com/people/100/crewcredits

tvmaze.peopleInfo(100, "crewcredits", false, function(error, response) {
    // handle errors and response
});

Example: http://api.tvmaze.com/people/100/crewcredits?embed=show

tvmaze.peopleInfo(100, "crewcredits",['show'], function(error, response) {
    // handle errors and response
});

Show Updates

Return a list of shows and the timestamp when they were updated

Example: http://api.tvmaze.com/updates/shows

tvmaze.showUpdates(function(error, response) {
    // handle errors and response
});