TV Maze

TV Maze

Media

Add television information to your own website or app with a fast and clean TV API. Add schedules, show, episode, cast information with free API. It provide a free, fast and clean REST API that's easy to use, returns JSON and conforms to the HATEOAS and HAL principles. The root url is http://api.tvmaze.com and the available endpoints are documented.

Visit API

📚 Documentation & Examples

Everything you need to integrate with TV Maze

🚀 Quick Start Examples

TV Maze Javascript Examplejavascript
// TV Maze API Example
const response = await fetch('http://www.tvmaze.com/api', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/json'
    }
});

const data = await response.json();
console.log(data);

Introduction to TVMaze API

Are you looking for a comprehensive TV guide API that provides you with the latest information about the shows you love to watch? Look no further than TVMaze API!

TVMaze API is a RESTful API that lets you access TV show data such as information about episodes, cast, and crew. With its extensive database of shows, it's easy to find detailed information about any TV program you want to know more about.

In this blog post, we'll explore how you can use TVMaze API by showcasing some example code in JavaScript.

Example Code in JavaScript

To start working with TVMaze API, you need to obtain an API key, which you can use to access TV show data. Once you have your API key, you can use it to make requests to the TVMaze API.

Here's an example of how you can retrieve information about a TV show using JavaScript:

const showId = 1; // Replace 1 with the ID of the show you want to retrieve information about
const apiKey = 'Your API Key'; // Replace 'Your API Key' with your actual API key

fetch(`http://api.tvmaze.com/shows/${showId}?apikey=${apiKey}`)
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.log(error));

In this example, we use the fetch API to make a GET request to the TVMaze API. We pass a path parameter (shows/${showId}) to indicate the show we want to retrieve information about. We also pass the apikey query parameter to authenticate our request.

When the request succeeds, we get back a JSON response, which we can parse using the json() method. We log the response data to the console.

Here are some other examples of how you can use TVMaze API to retrieve data about TV shows:

  • Retrieve detailed information about an episode:
const episodeId = 1; // Replace 1 with the ID of the episode you want to retrieve information about

fetch(`http://api.tvmaze.com/episodes/${episodeId}?apikey=${apiKey}`)
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.log(error));
  • Search for TV shows by name:
const searchQuery = 'The Office'; // Replace 'The Office' with the name of the show you want to search for

fetch(`http://api.tvmaze.com/search/shows?q=${searchQuery}&apikey=${apiKey}`)
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.log(error));

Conclusion

In this blog post, we've seen how you can use TVMaze API to retrieve TV show data using JavaScript. We've explored some example code snippets that demonstrate how you can make requests to TVMaze API and retrieve data about shows, episodes, and more.

If you're looking for a comprehensive TV guide API that provides you with the latest information about your favorite shows, TVMaze API is a great resource to check out.

📊 30-Day Uptime History

Daily uptime tracking showing online vs offline minutes

Jun 2Jun 4Jun 6Jun 8Jun 10Jun 12Jun 14Jun 16Jun 18Jun 20Jun 22Jun 24Jun 26Jun 28Jul 104008001440Minutes
Online
Offline

Related APIs in Media