# TV Shows Scraper - Episodes, Cast & Ratings (`benthepythondev/tvmaze-tv-shows-scraper`) Actor

Search TV shows by name or ID and get structured data: genres, status, network, premiere/end dates, rating, runtime, IMDb id, image and summary, optionally with full episode lists and cast. Fast and reliable via the public TVMaze API.

- **URL**: https://apify.com/benthepythondev/tvmaze-tv-shows-scraper.md
- **Developed by:** [Ben](https://apify.com/benthepythondev) (community)
- **Categories:** Videos, Business, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 shows

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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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

## 📺 TV Shows Scraper

Search TV shows by name (or look up by show ID) and get clean, structured data — genres, status, network, premiere/end dates, rating, runtime, IMDb id, image, official site and summary — optionally with the full episode list and cast for each show. Powered by the public TVMaze API, so it's fast and reliable: no browser, no login, no API key, no blocks.

Built for media & entertainment research, building TV/streaming datasets, and powering recommendation or content apps. Export to JSON/CSV/Excel, run on a schedule, call via API, or connect to Make, Zapier or n8n.

### 🔎 What is the TV Shows Scraper?

Give it show names (e.g. "breaking bad", "the office") and it returns matching TV shows as structured rows — or pass show IDs to pull exact titles. Optionally include every episode and the full cast.

#### What data does it extract?

- **Name, type, language and genres**
- **Status** (Running/Ended), **runtime** and average runtime
- **Premiere** and **end** dates
- **Rating** and popularity weight
- **Network / web channel** and country
- **IMDb, TheTVDB and TVRage IDs**
- **Image**, official site, summary and TVMaze URL
- **Episodes** (optional): season, number, name, airdate, rating
- **Cast** (optional): actor name + character

### ⬇️ Input

| Field | Type | Description |
|-------|------|-------------|
| `searchTerms` | array | Show names to search, e.g. `breaking bad`. |
| `showIds` | array | Optional: exact shows by TVMaze show ID. |
| `includeEpisodes` | boolean | Also return the full episode list. Default `false`. |
| `includeCast` | boolean | Also return the cast. Default `false`. |
| `maxPerTerm` | integer | Max shows per search term. Default `10`. |

#### Example input

```json
{
  "searchTerms": ["breaking bad", "the office"],
  "includeEpisodes": true,
  "maxPerTerm": 5
}
````

### ⬆️ Output

One record per show:

```json
{
  "id": 169,
  "name": "Breaking Bad",
  "type": "Scripted",
  "language": "English",
  "genres": ["Drama", "Crime", "Thriller"],
  "status": "Ended",
  "runtime": 60,
  "premiered": "2008-01-20",
  "ended": "2013-09-29",
  "rating": 9.2,
  "network": "AMC",
  "network_country": "US",
  "official_site": "http://www.amc.com/shows/breaking-bad",
  "imdb_id": "tt0903747",
  "image": "https://.../original.jpg",
  "summary": "Breaking Bad follows protagonist Walter White...",
  "url": "https://www.tvmaze.com/shows/169/breaking-bad",
  "query": "breaking bad"
}
```

### 💡 Use cases

- 🎬 **Media research** — compare genres, ratings, networks and runtimes.
- 📊 **TV datasets** — build catalogs for analytics or dashboards.
- 🍿 **Recommendation apps** — enrich titles with ratings, images and summaries.
- 🤖 **LLM / app pipelines** — feed structured show data into your own tools.

### ❓ FAQ

**Do I need an API key or login?** No — just show names or IDs.

**Can I get every episode?** Yes — enable `includeEpisodes`.

**Can I get the cast?** Yes — enable `includeCast`.

**Does it include IMDb IDs?** Yes — plus TheTVDB and TVRage IDs where available.

**Can I look up a specific show?** Yes — pass TVMaze show IDs in `showIds`.

**How does pricing work?** Pay per show returned. No subscription.

**Is it legal?** It uses the public TVMaze API. Use responsibly and within their terms.

### 🔗 You might also like

- [Steam Games Scraper](https://apify.com/benthepythondev/steam-games-scraper) — game prices & metadata.
- [App Store Scraper](https://apify.com/benthepythondev/app-store-scraper) — Apple App Store apps.
- [Google News Scraper](https://apify.com/benthepythondev/google-news-scraper) — news by keyword.

***

**Keywords:** tv shows scraper, tvmaze scraper, tv series data, episode list scraper, tv ratings, imdb id lookup, tv metadata, streaming data, tv show api, entertainment dataset, cast scraper, series scraper, tv database, movie tv data

### Production workflow

This Actor is designed for media researchers, entertainment catalogs, recommendation products and schedule-monitoring workflows. Use show IDs as durable keys, request episodes or cast only when needed, and store snapshots when monitoring status, schedule, network, rating or catalog availability changes. Small, repeatable runs are easier to audit than occasional unlimited exports: they expose source changes quickly, reduce duplicate processing and keep automation costs predictable. Use the input defaults as a smoke test, then widen the query only after confirming that the returned fields match the downstream workflow.

Treat each dataset row as source evidence captured at a point in time, not as a permanent fact. Preserve the canonical identifier and source URL, add the run timestamp in the receiving system, and deduplicate before writing to a CRM, spreadsheet, warehouse or alert channel. For recurring monitoring, compare the newest dataset with the previous successful run and send only additions or material changes onward. That pattern avoids repeated notifications and makes the automation more useful over time.

### Data quality and interpretation

The primary output includes `id`, `name`, `type`, `language`, `genres`, `status`, `runtime`, `average_runtime`, `premiered`, `ended`, `rating`, `weight`. Availability depends on what the source publishes for a particular result. Empty values are retained as null or empty fields rather than invented. Search rank is source-specific and can change with language, geography, query wording and time. Validate critical decisions against the linked source page, especially when the data is used for outreach, compliance, pricing, routing or reporting.

Use bounded inputs and respect the source's published interface. The Actor does not bypass logins or collect private account data. Avoid placing passwords, session cookies, personal access tokens or confidential records in Actor input. If a public source changes its response shape, attach a reproducible public input and run ID to an Actor issue so the parser can be updated without exposing private data.

### Automation and cost control

The default dataset can be exported as JSON, CSV, Excel, XML or RSS and can be consumed through the Apify API. In Make, Zapier or n8n, start the Actor, wait for the run to finish, then read default-dataset items. In code, store the Actor run ID and dataset ID alongside the imported rows so every record remains traceable. Apply filters after collection only when the source cannot express them directly; source-side filtering usually reduces cost and noise.

This Actor uses pay-per-event billing. A result event is charged only when a structured row is saved to the default dataset. Keep test runs small, estimate expected row volume before scheduling broad searches, and use platform spending limits for unattended workflows. Failed requests and empty searches should not create result events.

### Support and feedback

If the Actor saves time in a real workflow, please leave a short Apify Store review describing the use case and the fields that were most useful. Reviews help other users evaluate the product and help prioritize maintenance. For support, open an Actor issue with the run ID, public input, expected behavior and one affected field. Do not include credentials or confidential information.

# Actor input Schema

## `searchTerms` (type: `array`):

TV show names to search for, e.g. 'breaking bad', 'the office'.

## `showIds` (type: `array`):

Optional: look up specific shows by TVMaze show ID (e.g. '169').

## `includeEpisodes` (type: `boolean`):

Also return the full episode list for each show (season, number, name, airdate, rating).

## `includeCast` (type: `boolean`):

Also return the cast (actor name + character) for each show.

## `maxPerTerm` (type: `integer`):

Maximum shows to return per search term.

## Actor input object example

```json
{
  "searchTerms": [
    "breaking bad"
  ],
  "includeEpisodes": false,
  "includeCast": false,
  "maxPerTerm": 10
}
```

# Actor output Schema

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

No description

# 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 = {
    "searchTerms": [
        "breaking bad"
    ],
    "includeEpisodes": false,
    "includeCast": false,
    "maxPerTerm": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("benthepythondev/tvmaze-tv-shows-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 = {
    "searchTerms": ["breaking bad"],
    "includeEpisodes": False,
    "includeCast": False,
    "maxPerTerm": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("benthepythondev/tvmaze-tv-shows-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 '{
  "searchTerms": [
    "breaking bad"
  ],
  "includeEpisodes": false,
  "includeCast": false,
  "maxPerTerm": 10
}' |
apify call benthepythondev/tvmaze-tv-shows-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "TV Shows Scraper - Episodes, Cast & Ratings",
        "description": "Search TV shows by name or ID and get structured data: genres, status, network, premiere/end dates, rating, runtime, IMDb id, image and summary, optionally with full episode lists and cast. Fast and reliable via the public TVMaze API.",
        "version": "1.0",
        "x-build-id": "uZ52bASBOZbseS3CP"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/benthepythondev~tvmaze-tv-shows-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-benthepythondev-tvmaze-tv-shows-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/benthepythondev~tvmaze-tv-shows-scraper/runs": {
            "post": {
                "operationId": "runs-sync-benthepythondev-tvmaze-tv-shows-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/benthepythondev~tvmaze-tv-shows-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-benthepythondev-tvmaze-tv-shows-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "searchTerms": {
                        "title": "Search terms",
                        "type": "array",
                        "description": "TV show names to search for, e.g. 'breaking bad', 'the office'.",
                        "default": [
                            "breaking bad"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "showIds": {
                        "title": "Show IDs (lookup)",
                        "type": "array",
                        "description": "Optional: look up specific shows by TVMaze show ID (e.g. '169').",
                        "items": {
                            "type": "string"
                        }
                    },
                    "includeEpisodes": {
                        "title": "Include episodes",
                        "type": "boolean",
                        "description": "Also return the full episode list for each show (season, number, name, airdate, rating).",
                        "default": false
                    },
                    "includeCast": {
                        "title": "Include cast",
                        "type": "boolean",
                        "description": "Also return the cast (actor name + character) for each show.",
                        "default": false
                    },
                    "maxPerTerm": {
                        "title": "Max shows per term",
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer",
                        "description": "Maximum shows to return per search term.",
                        "default": 10
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
