MangaDex Full API
An unofficial MangaDex API built with the official JSON API. Supports Node.js and browsers.
Documentation

npm install mangadex-full-api@6.0.0
Manga.search({
title: 'One Piece',
limit: Infinity,
hasAvailableChapters: true,
}).then((mangas) => {
console.log('There are', mangas.length, 'mangas with One Piece in the title!');
mangas.forEach((manga) => {
console.log(manga.localTitle);
});
});
Tutorials
View more info on the documentation website.
Authentication
To login with a personal account, you must have a Client ID and Secret.
await loginPersonal({
clientId: 'id',
clientSecret: 'secret',
password: 'password',
username: 'username',
});
Page Images
const manga = await Manga.getByQuery({ order: { followedCount: 'desc' }, availableTranslatedLanguage: ['en'] });
if (!manga) throw new Error('No manga found!');
const chapters = await manga.getFeed({ translatedLanguage: ['en'], limit: 1 });
const chapter = chapters[0];
const pages = await chapter.getReadablePages();
console.log(pages);
Relationships
MangaDex will return Relationship objects for associated data objects instead of the entirety of each object.
For example, authors and artists will be returned as Relationship<Author> when requesting a manga. To request the author data, use the resolve method.
Additionally, you can supply 'author' to the includes parameter to include the author data alongside the manga request. You will still need to call the resolve method, but the promise will return instantly.
const manga = await Manga.getRandom();
const firstAuthor = await manga.authors[0].resolve();
console.log('The first author is', firstAuthor.name);
const allAuthors = await resolveArray(manga.authors);
console.log('All authors are', allAuthors.map((a) => a.name).join(', '));
const otherManga = await Manga.getByQuery({ includes: ['author'] });
if (otherManga) {
console.log('The authors for this manga are included and cached:', otherManga.authors[0].cached);
const author = await otherManga.authors[0].resolve();
console.log('The author is', author.name);
}
Finding Manga
The most common way to find manga is to use the search method. However, there are a few other ways as well:
Manga.search({
title: 'One Piece',
limit: Infinity,
hasAvailableChapters: true,
}).then((mangas) => {
console.log('There are', mangas.length, 'mangas with One Piece in the title!');
mangas.forEach((manga) => {
console.log(manga.localTitle);
});
});
Manga.getByQuery({ title: 'One Piece' }).then((manga) => {
if (manga) console.log('Found a One Piece manga with id', manga.id);
else console.log('No One Piece manga found');
});
Manga.getRandom().then((manga) => console.log('Random:', manga.localTitle));
Manga.get('manga-uuid-here').then((manga) => console.log(manga));
Uploading Chapters
await loginPersonal({
clientId: 'id',
clientSecret: 'secret',
password: 'password',
username: 'username',
});
const session = await UploadSession.begin('manga-id', ['group-id']);
await session.uploadPages([
new Blob([fs.readFileSync('path/to/page1.jpg')], new Blob([fs.readFileSync('path/to/page2.jpg')])),
]);
await session.commit({
chapter: '1',
title: 'A new chapter!',
translatedLanguage: 'en',
volume: '1',
});