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 🙏

© 2026 – Pkg Stats / Ryan Hefner

mcuapi-client

v2.2.0

Published

Typed client for MCUAPI — Marvel Cinematic Universe movies, TV shows, characters and chronological timeline. No API key required.

Readme

mcuapi-client

Typed client for MCUAPI — Marvel Cinematic Universe movies, movie editions, TV shows, characters, people, and the chronology that orders them.

No API key. No runtime dependencies. ESM and CJS. ~10 kB packed.

npm install mcuapi-client

Usage

import { MCUAPI } from 'mcuapi-client';

const mcu = new MCUAPI();

const ironMan = await mcu.movies.get(1);
//    ^? Movie

const { data, total } = await mcu.movies.list({
  filter: 'title=Spider',
  order: 'release_date,DESC',
  limit: 5,
});

Requires Node 18+ (for global fetch), or pass your own — see Options.

Reading a whole collection

limit is capped at 100 server-side. .all() walks the pages for you by following the API's own _links.next, yielding one record at a time:

for await (const character of mcu.characters.all()) {
  console.log(character.name, character.played_by);
}

Following hypermedia links

Every resource ships HAL-style _links, so you can traverse the graph without building paths yourself:

const movie = await mcu.movies.get(1);
const cast = await mcu.follow(movie._links!.characters!);

API

| Call | Returns | | --- | --- | | mcu.movies.list(params?) | Paginated<Movie> | | mcu.movies.get(id) | Movie | | mcu.movies.all(params?) | AsyncGenerator<Movie> | | mcu.movies.characters(id) | WithRole<Character>[] | | mcu.movies.postCreditScenes(id) | PostCreditScene[] | | mcu.tvshows.list(params?) | Paginated<TVShow> | | mcu.tvshows.get(id) | TVShow | | mcu.tvshows.all(params?) | AsyncGenerator<TVShow> | | mcu.tvshows.characters(id) | WithRole<Character>[] | | mcu.tvshows.postCreditScenes(id) | PostCreditScene[] | | mcu.characters.list(params?) | Paginated<Character> | | mcu.characters.get(id) | Character | | mcu.characters.all(params?) | AsyncGenerator<Character> | | mcu.characters.movies(id) | WithRole<Movie>[] | | mcu.characters.tvshows(id) | WithRole<TVShow>[] | | mcu.people.list(params?) | Paginated<Person> | | mcu.people.get(id) | Person | | mcu.people.all(params?) | AsyncGenerator<Person> | | mcu.people.characters(id) | WithRecastOrder<Character>[] | | mcu.people.titles(id) | PersonTitle[] | | mcu.postCreditScenes.list(params?) | Paginated<PostCreditScene> | | mcu.postCreditScenes.get(id) | PostCreditScene | | mcu.postCreditScenes.all(params?) | AsyncGenerator<PostCreditScene> | | mcu.movieEditions.list(params?) | Paginated<MovieEdition> | | mcu.movieEditions.get(id) | MovieEdition | | mcu.movieEditions.all(params?) | AsyncGenerator<MovieEdition> | | mcu.timeline.get(params?) | TimelineGroup[] | | mcu.upcoming.list(params?) | Paginated<UpcomingItem> | | mcu.upcoming.all(params?) | AsyncGenerator<UpcomingItem> | | mcu.titles.list(params?) | Paginated<TitleItem> | | mcu.titles.all(params?) | AsyncGenerator<TitleItem> | | mcu.search.list(params) | Paginated<SearchHit> | | mcu.search.all(params) | AsyncGenerator<SearchHit> | | mcu.stats.get() | Stats | | mcu.health() | Health | | mcu.follow(link) | whatever the link points at |

List params: page, limit, order, filter, continuity, multiverse_designation — plus studio and is_mcu on movies and TV shows. people.list() and postCreditScenes.list() only honour page, limit, order, and filter; neither has continuity or multiverse_designation columns to filter by. timeline.get() takes multiverse. upcoming.list()/.all() take page, limit, type ('movie' | 'tvshow'), continuity, multiverse_designation, and is_mcu — movies and TV shows whose release_date is strictly in the future, merged and sorted ascending; titles with no announced release date are excluded. titles.list()/.all() take the same params as movies/tvshows (TitleListParams, now including type) — the same movies+tvshows merge as upcoming, but paged over the whole dataset instead of only future releases, so undated titles are included and sorted last. stats.get() takes no params.

movieEditions.list() also accepts movie_id to list editions attached to one movie.

WithRole<T> (the appearance-relation return types above) also carries appeared_in?: string — the reality the appearance actually happened in. It only differs from the title's own multiverse_designation for rare per-appearance exceptions (e.g. the Void sequences in Deadpool & Wolverine).

Two things worth knowing

box_office is a string, not a number. Postgres returns bigint as a string to avoid precision loss, so you get "585171547". Convert deliberately:

const gross = movie.box_office ? Number(movie.box_office) : null;

Most fields are nullable, including obvious ones. Recently announced titles often have no release_date, phase, saga, box_office, or runtime yet. The types reflect what the API really returns — verified against production, not copied from the server's entity definitions — so the compiler will make you handle it.

Errors

Non-2xx responses throw MCUAPIError:

import { MCUAPIError } from 'mcuapi-client';

try {
  await mcu.movies.get(99999);
} catch (err) {
  if (err instanceof MCUAPIError) {
    err.status;        // 404
    err.isNotFound;    // true
    err.isRateLimited; // true only on 429
    err.body;          // Problem Details JSON, or raw text
  }
}

The API allows 100 requests per minute per IP and sends RateLimit-* headers.

Options

const mcu = new MCUAPI({
  baseUrl: 'http://localhost:3333', // point at your own instance
  timeout: 10_000,                  // per-request, in ms
  headers: { 'User-Agent': 'my-app/1.0' },
  fetch: myFetch,                   // undici, a proxy agent, a test double
});

Every method takes an optional { signal } for cancellation:

const controller = new AbortController();
const page = await mcu.movies.list({}, { signal: controller.signal });

Caching

Successful cacheable responses carry Cache-Control: public, max-age=3600 and an ETag; API JSON responses are also cached server-side in Redis and invalidated after MCP data writes. Error responses use Cache-Control: no-store.

Licence

MIT. Source and issues: https://github.com/AugustoMarcelo/mcuapi

Not affiliated with Marvel, Marvel Studios, or The Walt Disney Company.