CEDDSDEV
🚀

Niheaven

BuildingProven

A simple anime streaming scraper package

Visit site

README

nimeheaven-api

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

Journey

No updates yet.

Building a dev tool or hiring developers? Get seen here. Become our Sponsor

Stays free because of
  • wacxv
  • <JRJDev>
  • Ian de Jesus
  • Michael William Mesina
  • Ruri
  • King Salomon
  • RCastromero()
  • Lixter Niño D. Dinawanao
  • euphydev
  • Lewis John Villamor
  • Joowd
  • Mon Albert Gamil
  • </Peter> "21st Dev Vinci"
  • rodge-dev
  • Doctor Scoliosis
  • Nico Alumbro
  • wacxv
  • <JRJDev>
  • Ian de Jesus
  • Michael William Mesina
  • Ruri
  • King Salomon
  • RCastromero()
  • Lixter Niño D. Dinawanao
  • euphydev
  • Lewis John Villamor
  • Joowd
  • Mon Albert Gamil
  • </Peter> "21st Dev Vinci"
  • rodge-dev
  • Doctor Scoliosis
  • Nico Alumbro
Join them

Building a dev tool or hiring developers? Get seen here. Become our Sponsor

Stays free because of
  • euphydev
  • Ruri
  • wacxv
  • Michael William Mesina
  • Ian de Jesus
  • Mon Albert Gamil
  • </Peter> "21st Dev Vinci"
  • Lixter Niño D. Dinawanao
  • Doctor Scoliosis
  • RCastromero()
  • King Salomon
  • Joowd
  • Lewis John Villamor
  • <JRJDev>
  • rodge-dev
  • Nico Alumbro
  • euphydev
  • Ruri
  • wacxv
  • Michael William Mesina
  • Ian de Jesus
  • Mon Albert Gamil
  • </Peter> "21st Dev Vinci"
  • Lixter Niño D. Dinawanao
  • Doctor Scoliosis
  • RCastromero()
  • King Salomon
  • Joowd
  • Lewis John Villamor
  • <JRJDev>
  • rodge-dev
  • Nico Alumbro
Join them