crunchyroll.js is an npm module that allows you to easily access the Crunchyroll API.
This project is not affiliated with or endorsed by Crunchyroll. The use of this project may violate the terms of service between you and stream provider. Use with caution and at your own risk.
npm i crunchyroll.js
const cr = require('crunchyroll.js');
(async () => {
// Login to crunchyroll
await cr.login(email, password);
// Get anime info
const anime = await cr.getAnime("GY9PJ5KWR"); // "Naruto"
// Get anime seasons and eps
const { items: seasons } = await cr.getSeasons(anime.id);
const eps = await cr.getEps(seasons[0].id);
})();
• Change default language
await cr.login(email, password, "pt-BR");
• Get user profile
const profile = await cr.getProfile();
• Search anime/episode/movie
const search = await cr.search("naruto");
• Get anime info
const categories = await cr.getCategories("[anime-id]");
const rate = await cr.getRate("[anime-id]");
const similar = await cr.getSimilar("[anime-id]", 10);
• Get NewsFeed
const newsFeed = await cr.getNewsFeed();
console.log(newsFeed.latest_news.items[0]); // Log the latest
• Get last updated animes list
// Get last 10 animes
const { items } = await cr.getAllAnimes(0, 10, "newly_added");
// Log animes title
console.log(items.map(anime => anime.title));
• Basic episodes counting system by anime seasons
const anime = await cr.getAnime("GY9PJ5KWR");
const { items: seasons } = await cr.getSeasons(anime.id);
console.log(`${anime.title} Seasons:`);
for(season of seasons) {
const episodes = await cr.getEpisodes(season.id);
console.log(`${season.title}: ${episodes.total} eps`);
}
Contributions are welcome! Please feel free to open an issue or submit a pull request, for bug fixes or new features.
- Fork the repository
- Create a new branch
git checkout -b <new-feature-name>
- Make the changes
- Commit the changes
git commit -am "Add new feature"
- Push the changes
git push origin <new-feature-name>
- Create a pull request on GitHub
Many thanks!