Skip to main content

Overview

Fetches a paginated list of the Searched anime. It filters based on anime’s title

Usage

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

const hianime = new Hianime();

async function main() {
  const response = await hianime.search("Attack on titan");
  console.log(JSON.stringify(response, null, 2));
}

main();

Response

response
{
  "page": 1,
  "totalPage": 4,
  "hasNextPage": true,
  "results": [
    {
      "id": "/watch/attack-on-titan-chronicle-2600",
      "image": "https://cdn.noitatnemucod.net/thumbnail/300x400/100/3713cf887e4098f283fef5b0336e6083.jpg",
      "title": "Attack on Titan: Chronicle",
      "type": "MOVIE",
      "language": {
        "sub": "1",
        "dub": null
      },
      "dataId": "2600"
    },
    {
      "id": "/watch/attack-on-titan-the-last-attack-19391",
      "image": "https://cdn.noitatnemucod.net/thumbnail/300x400/100/9b17cd8c7479d523d77e5e2cbbb5ad67.jpg",
      "title": "Attack on Titan: The Last Attack",
      "type": "MOVIE",
      "language": {
        "sub": "1",
        "dub": "1"
      },
      "dataId": "19391"
    }
  ]
}

Response fields

  • page: number — current page index returned by the API.
  • totalPage: number — total number of pages available.
  • hasNextPage: boolean — indicates whether another page is available.
  • results: array of items containing:
    • id: string — anime identifier or path.
    • image: string — poster/thumbnail URL.
    • title: string — anime title.
    • type: string — e.g., “TV”, “Movie” (values depend on site data).
    • language.sub / language.dub: string — episode availability counts as reported by the site.
    • dataId: string — site-specific numeric identifier.

Parameters

  • page: number — page to fetch. Defaults to 1. Must be a positive integer.
    Use page together with hasNextPage and totalPage to implement pagination in your app.

Notes & limitations

  • Ordering and availability are determined by HiAnime and may change over time.
  • Pagination limits (max pages) can vary; always check hasNextPage.
  • This is an unofficial scraper-based method; site changes can break behavior without notice. Use responsibly and respect the website’s Terms of Service.
I