Mika Scraper / Animob
Class: Animob
Defined in: src/animob/animob.ts:69
The Animob class provides a wrapper around unofficial HiAnime/AniWatch APIs, enabling access to various functionalities, including:
- Fetching featured anime from the homepage
- Searching and filtering anime by genre
- Retrieving detailed information about specific anime and their episodes
- Extracting streaming links based on server ID
Example Usage
const client = new Animob();
const popularAnime = await client.home();
const narutoAnime = await client.search('naruto');
const narutoDetails = await client.detail('naruto');
const streamingLinks = await client.episode('naruto-ep-1?ep=1', 'HD-1');Constructors
Constructor
new Animob():
Animob
Defined in: src/animob/animob.ts:73
Returns
Animob - An instance of the Animob class.
Methods
home()
home():
Promise<Anime[]>
Defined in: src/animob/animob.ts:95
Fetches curated content from the homepage, including trending, latest, and popular anime.
Returns
Promise<Anime[]> - A list of anime blocks featured on the homepage.
genre()
genre(
genre,page):Promise<Anime[]>
Defined in: src/animob/animob.ts:107
Retrieves a paginated list of anime for a specific genre.
Parameters
genre
string = 'action' - The genre slug (e.g., βactionβ, βdramaβ, βfantasyβ).
page
number = 1 - The page number for pagination.
Returns
Promise<Anime[]> - A list of anime under the specified genre.
Throws
Error if the specified genre is not supported.
search()
search(
query,page):Promise<Anime[]>
Defined in: src/animob/animob.ts:135
Searches for anime using a given keyword.
Parameters
query
string - The title or keyword used to search for anime.
page
number = 1 - The page number for pagination.
Returns
Promise<Anime[]> - A list of anime matching the search query.
Throws
Error if no query is provided.
detail()
detail(
id):Promise<Anime&object>
Defined in: src/animob/animob.ts:151
Fetches comprehensive metadata for a specific anime, including all episodes.
Parameters
id
string - The slug ID of the anime (e.g., βnarutoβ).
Returns
Promise<Anime & object> - An object containing the animeβs metadata along with an array of episodes.
Throws
Error if the ID is not provided.
episode()
episode(
episodeId,server):Promise<StreamResponse>
Defined in: src/animob/animob.ts:170
Fetches streaming sources for a specified episode ID on a particular server.
Parameters
episodeId
string - The full episode ID string (e.g., βbleach-ep-1?ep=1β).
server
string = 'HD-1' - The name of the server (e.g., βHD-1β, βHD-2β, βAutoβ).
Returns
Promise<StreamResponse> - A StreamResponse object containing streaming sources and headers for the specified episode.
Throws
Error if the episode ID is invalid or the specified server does not exist.