# TV Show Scraper - Shows, Episodes & Cast (TVMaze) (`dami_studio/tvmaze-scraper`) Actor

A complete TV database in one actor. Search shows or people, or list every episode of a series. Get ratings, genres, network, country, status, premiere and end dates, IMDb ID, official site, plain-text summaries, images and URLs - plus season, episode number, airdate and runtime per episode.

- **URL**: https://apify.com/dami\_studio/tvmaze-scraper.md
- **Developed by:** [Dami's Studio](https://apify.com/dami_studio) (community)
- **Categories:** Integrations, AI, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 item returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## TVMaze Scraper

Search TV shows and people, or list a show's episodes, using the free [TVMaze](https://www.tvmaze.com/api) API. No API key, no login. You get clean, flat rows — HTML `summary` fields are already converted to plain text.

### Modes

| Mode | Needs | Returns |
|---|---|---|
| `shows` | `query` (show name) | Matching TV shows |
| `people` | `query` (person name) | Matching actors / crew |
| `episodes` | `showId` (integer) | Every episode of that show |

Find a `showId` by running `shows` mode first — each show row includes its `id`.

### Output

One dataset row per result, flagged `ok: true`.

**Shows** (`mode: "shows"`):
`id`, `name`, `type`, `language`, `genres` (array), `status`, `runtime`, `premiered`, `ended`, `rating` (average, 0–10 or null), `network` (network or web-channel name), `country` (name), `imdb` (IMDb id), `officialSite`, `summary` (plain text), `image` (URL), `url` (TVMaze page).

**People** (`mode: "people"`):
`id`, `name`, `country` (name), `birthday`, `gender`, `image` (URL), `url`.

**Episodes** (`mode: "episodes"`):
`showId`, `episodeId`, `name`, `season`, `number`, `airdate`, `runtime`, `rating`, `summary` (plain text), `url`.

#### Fields that can be null

TVMaze omits fields it doesn't have, so any field above can be `null` — e.g. `rating` when a show/episode has no votes, `ended` for a running show, `network`/`country` for web-only shows, `imdb` when no external id is mapped, `birthday`/`gender` for some people, or `image` when no artwork exists.

### Pricing

Pay-per-result: you are charged once per genuine result row (`ok: true`). You are **never** charged for:

- invalid input (a single `ok: false` row with `errorCode: "BAD_INPUT"`),
- no matching results (`NO_RESULTS`),
- an unknown `showId` (`NOT_FOUND`),
- network / rate-limit / server errors (`NETWORK` / `RATE_LIMITED` / `SERVER_ERROR`).

Results are deduplicated by id before charging.

### Proxy

The TVMaze API is a public, no-auth JSON API with no anti-bot, so **no proxy is required** and the default runs without one (saving proxy credits). Only enable Apify Proxy if you hit IP rate limits at very high volume.

### Examples

Search shows:

```json
{ "mode": "shows", "query": "breaking bad", "maxItems": 10 }
```

List a show's episodes:

```json
{ "mode": "episodes", "showId": 169 }
```

Search people:

```json
{ "mode": "people", "query": "bryan cranston", "maxItems": 5 }
```

### Notes

TVMaze search returns the best matches ranked by relevance (their `score`). Episode lists are returned in full for the show; use `maxItems` to cap how many rows you keep. Data is courtesy of [TVMaze.com](https://www.tvmaze.com) under their licensing terms.

# Actor input Schema

## `mode` (type: `string`):

What to fetch: "shows" searches TV shows by name (needs a query), "people" searches actors/crew by name (needs a query), "episodes" lists all episodes of one show (needs a showId).

## `query` (type: `string`):

Search text. For mode "shows" this is a show name (e.g. "breaking bad"); for mode "people" it is a person name (e.g. "bryan cranston"). Ignored in "episodes" mode.

## `showId` (type: `integer`):

TVMaze numeric show id to list episodes for (e.g. 169 = Breaking Bad). Required for mode "episodes"; ignored otherwise. Find ids by running mode "shows" first.

## `maxItems` (type: `integer`):

Maximum number of result rows to return (shows, people, or episodes). Deduplicated by id before this limit is applied.

## `notionConnector` (type: `string`):

Optional. Write each item as a page into your Notion when the run finishes. Authorize a Notion connector once in Settings → API & Integrations → MCP connectors, then pick it here. Leave empty to skip (default) — results are always saved to the dataset regardless.

## `notionParentId` (type: `string`):

Optional. The Notion data source ID of the database to write into (only used if a Notion connector is set). Leave empty to create the pages privately in your workspace instead.

## `proxyConfiguration` (type: `object`):

OPTIONAL. The TVMaze API is a public, no-auth JSON API with no anti-bot, so no proxy is needed and the default routes traffic directly (saving proxy credits). Only enable Apify Proxy if you hit IP rate limits when running very high volumes.

## Actor input object example

```json
{
  "mode": "shows",
  "query": "breaking bad",
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Scraped rows are stored in the default dataset (one row per result). Blocked/empty/error runs return a single uncharged diagnostic row instead.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "query": "breaking bad"
};

// Run the Actor and wait for it to finish
const run = await client.actor("dami_studio/tvmaze-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "query": "breaking bad" }

# Run the Actor and wait for it to finish
run = client.actor("dami_studio/tvmaze-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": "breaking bad"
}' |
apify call dami_studio/tvmaze-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=dami_studio/tvmaze-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/t7lBcE0v8K3B4c9WD/builds/xSDHl7p2N0gszq4vp/openapi.json
