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

nimeheaven-api

v1.0.0

Published

A simple anime scraper NimeHeaven anime streaming API.

Readme

nimeheaven-api

npm version npm downloads license Node.js

A simple anime streaming scraper package

Created by CEDDSDEV.

Installation

npm install nimeheaven-api

Quick start

const NimeHeaven = require('nimeheaven-api');

async function cedds() {
  try {
    const api = new NimeHeaven();
    const results = await api.search('naruto', { page: 1, limit: 10 });

    console.log(results);
  } catch (error) {
    console.error(error);
  }
}

cedds();

The package uses Node's built-in fetch, so it has no runtime dependencies.

ESM usage

The package supports both CommonJS and modern ESM imports:

import NimeHeaven from 'nimeheaven-api';

const api = new NimeHeaven();
const home = await api.home({ page: 1, limit: 20 });

console.log(home);

Named exports are also available:

import NimeHeaven, {
  nimeheaven,
  NimeHeavenError,
} from 'nimeheaven-api';

Examples

Each example can be used independently after installing the package.

1. Get API information

const NimeHeaven = require('nimeheaven-api');

async function cedds() {
  try {
    const api = new NimeHeaven();
    const info = await api.info();

    console.log(info);
  } catch (error) {
    console.error(error);
  }
}

cedds();

2. Get the home schedule

const NimeHeaven = require('nimeheaven-api');

async function cedds() {
  try {
    const api = new NimeHeaven();
    const home = await api.home({ page: 1, limit: 20 });

    console.log('Current schedule:', home.schedule);
    console.log('Pagination:', home.pagination);
  } catch (error) {
    console.error(error);
  }
}

cedds();

The home() method requests the API root with the supplied pagination options.

3. Get new episodes

const NimeHeaven = require('nimeheaven-api');

async function cedds() {
  try {
    const api = new NimeHeaven();
    const episodes = await api.newEpisodes({ page: 1, limit: 20 });

    console.log(episodes);
  } catch (error) {
    console.error(error);
  }
}

cedds();

4. Get popular anime

const NimeHeaven = require('nimeheaven-api');

async function cedds() {
  try {
    const api = new NimeHeaven();
    const popular = await api.popular({ page: 1, limit: 20 });

    console.log(popular);
  } catch (error) {
    console.error(error);
  }
}

cedds();

5. Search for anime

const NimeHeaven = require('nimeheaven-api');

async function cedds() {
  try {
    const api = new NimeHeaven();
    const results = await api.search('one piece', {
      page: 1,
      limit: 10,
    });

    console.log(results);
  } catch (error) {
    console.error(error);
  }
}

cedds();

6. Search autocomplete suggestions

const NimeHeaven = require('nimeheaven-api');

async function cedds() {
  try {
    const api = new NimeHeaven();
    const suggestions = await api.fastSearch('one pi', {
      page: 1,
      limit: 10,
    });

    console.log(suggestions);
  } catch (error) {
    console.error(error);
  }
}

cedds();

7. Get anime from a season

const NimeHeaven = require('nimeheaven-api');

async function cedds() {
  try {
    const api = new NimeHeaven();
    const season = await api.season('2025summer', {
      page: 1,
      limit: 20,
    });

    console.log(season);
  } catch (error) {
    console.error(error);
  }
}

cedds();

8. Get anime information

const NimeHeaven = require('nimeheaven-api');

async function cedds() {
  try {
    const api = new NimeHeaven();
    const anime = await api.anime('1ht8d');

    console.log('Title:', anime.title);
    console.log('Anime details:', anime);
  } catch (error) {
    console.error(error);
  }
}

cedds();

9. Get stream information for an episode

const NimeHeaven = require('nimeheaven-api');

async function cedds() {
  try {
    const api = new NimeHeaven();
    const stream = await api.stream('1ht8d', 1165);

    console.log('Stream information:', stream);
  } catch (error) {
    console.error(error);
  }
}

cedds();

The stream() method uses an anime ID and episode ID to request stream information.

Available methods

await api.info();
await api.home({ page: 1, limit: 20 });
await api.newEpisodes({ page: 1, limit: 20 });
await api.popular({ page: 1, limit: 20 });
await api.search('one piece', { page: 1, limit: 20 });
await api.fastSearch('one pi', { page: 1, limit: 10 });
await api.season('2025summer', { page: 1, limit: 20 });
await api.anime('1ht8d');
await api.stream('1ht8d', 1165);

Pagination defaults are provided by the API. limit must be from 1 to 100.

Error handling

Network failures, timeouts, and API errors throw NimeHeavenError:

const { NimeHeavenError } = require('nimeheaven-api');

try {
  await api.anime('unknown-id');
} catch (error) {
  if (error instanceof NimeHeavenError) {
    console.error(error.code, error.status, error.message);
  }
}

TypeScript

Type declarations.

import NimeHeaven from 'nimeheaven-api';

const api = new NimeHeaven();

async function cedds() {
  try {
    const home = await api.home({
      page: 1,
      limit: 20,
    });

    const searchResults = await api.search('naruto', {
      page: 1,
      limit: 10,
    });

    console.log(home);
    console.log(searchResults);
  } catch (error) {
    console.error(error);
  }
}

cedds();

TypeScript generics when you have a known response shape:

interface SearchResponse {
  results: unknown[];
  pagination?: {
    page: number;
    total: number;
  };
}

const results = await api.search<SearchResponse>('naruto');
console.log(results.results);

License

MIT © CEDDSDEV