Call the hosted TVMaze Scraper Actor from Node.js with the official apify-client. This client talks to the Apify platform — no scraping code runs locally.
npm install apify-clientGet your API token from https://apify.com/account/integrations. Prefer an environment variable over hard-coding it:
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
// Search TV shows by name
const run = await client.actor('logiover/tvmaze-scraper').call({
mode: 'searchShows',
query: 'breaking bad',
maxResults: 50,
});
// Fetch dataset items
const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const show of items) {
console.log(`${show.name} (${show.premiered}) — rating ${show.rating}`);
}Crawl the catalogue (showIndex)
const run = await client.actor('logiover/tvmaze-scraper').call({
mode: 'showIndex',
startPage: 0,
maxResults: 5000,
});Show details by ID batch, with cast (showDetails)
const run = await client.actor('logiover/tvmaze-scraper').call({
mode: 'showDetails',
showIds: ['169', '82', '83'],
embedCast: true,
});Every episode of a series (episodes)
const run = await client.actor('logiover/tvmaze-scraper').call({
mode: 'episodes',
showId: '83',
maxResults: 2000,
});Cast & characters (cast)
const run = await client.actor('logiover/tvmaze-scraper').call({
mode: 'cast',
showId: '169',
});Daily TV schedule (schedule)
const run = await client.actor('logiover/tvmaze-scraper').call({
mode: 'schedule',
country: 'US',
date: '2026-07-06',
});People search or by ID (people)
const run = await client.actor('logiover/tvmaze-scraper').call({
mode: 'people',
query: 'bryan cranston',
maxResults: 20,
});listItems supports offset and limit so you can stream through big result sets:
const datasetClient = client.dataset(run.defaultDatasetId);
let offset = 0;
const limit = 1000;
while (true) {
const { items, total } = await datasetClient.listItems({ offset, limit });
for (const item of items) {
// process each show / episode / cast / schedule row
}
offset += items.length;
if (offset >= total || items.length === 0) break;
}// .start() returns immediately with the run object
const run = await client.actor('logiover/tvmaze-scraper').start({
mode: 'showIndex',
maxResults: 20000,
});
console.log('Run started:', run.id);
// Later, wait for it and read results:
const finished = await client.run(run.id).waitForFinish();
const { items } = await client.dataset(finished.defaultDatasetId).listItems();// Download the dataset in a specific format as a Buffer
const csvBuffer = await client.dataset(run.defaultDatasetId).downloadItems('csv');
// e.g. fs.writeFileSync('tvmaze.csv', csvBuffer);
const xlsxBuffer = await client.dataset(run.defaultDatasetId).downloadItems('xlsx');Supported formats include json, csv, xlsx, jsonl, and xml.