Overview

Fetches a list of the episodes for a specific anime. This function takes a dataId as a parameter. It is required to pass dataId to fetch the episodes of an anime.

Usage

index.ts
import { Hianime } from "hianime";

async function main() {
  const hianime = new Hianime();

  // Takes a dataId as a parameter,
  // in the example it is "112" which is the dataId of the anime "Attack on Titan"
  const result = await hianime.getEpisodes("112");
  console.log(JSON.stringify(result, null, 2));
}

main();
The dataId can be found on each Result object from the getMostPopular(), getTopAiring(), getSpecialList(), getDubbedAnime(), getSubbedAnime(), getTVShows(), getONAList(), getMovies(), getOVAList() methods.

Response

response
[
  {
    "id": "3303",
    "number": "1",
    "title": "To You Two Thousand Years Later",
    "href": "/watch/attack-on-titan-112?ep=3303"
  },
  {
    "id": "3304",
    "number": "2",
    "title": "That Day",
    "href": "/watch/attack-on-titan-112?ep=3304"
  },
  {
    "id": "3305",
    "number": "3",
    "title": "Shining Dimly in the Midst of Despair",
    "href": "/watch/attack-on-titan-112?ep=3305"
  },
  {
    "id": "3306",
    "number": "4",
    "title": "Night of the Disbanding",
    "href": "/watch/attack-on-titan-112?ep=3306"
  }
  // more episodes...
]

Parameters

dataId

  • Type: string
  • Required: true
  • Description: The unique identifier of the anime