Dev news: Launching API version 2 (also v1 deprecation notice) | Last updated 2021-01-17

Status
Not open for further replies.
Custom title
Staff
Developer
Joined
Jan 19, 2018
Messages
2,474
Goddamnit, I didn't notice that the relation/tags/followtype responses are objects instead of arrays. This is what I get for testing on Firefox, I guess.

I'm just going to keep them as they are since it doesn't really affect anything. Sorry about the inconsistency.
 
Member
Joined
Apr 29, 2020
Messages
334
There's some missing info on fetching images from chapters. (Maybe? Maybe I'm just blind, illiterate, or both.) I guess I'll post it here so people won't have to discover it independently again.

Get manga's chapters, mangadex org/api/v2/manga/22615/chapters
Select a chapter and get its hash: 36bdbd1d95d3013c9c9682aa5b5be944
Get its images: mangadex org/api/v2/chapter/36bdbd1d95d3013c9c9682aa5b5be944
Build URL: "server" + "hash" + "pages"[0]
In this case: mangadex org/data/36bdbd1d95d3013c9c9682aa5b5be944/1-768f1c3868a89bfa48c09fe743f629b179da58947cf4d3a0a03490c8de671685.png
 
Custom title
Staff
Developer
Joined
Jan 19, 2018
Messages
2,474
I guess I could have documented that better. But yes, it's intentional that the chapter lists don't return the necessary page information and that you need to actually fetch it from the /chapter endpoint, hence why the index uses "partial information" when referring to incomplete chapter entities.
 
Joined
Mar 1, 2018
Messages
3
I'm confused, am I supposed to login to mangadex manually then copy the cookie that it returns? Is there a way to login programmatically?
 
Joined
Aug 15, 2018
Messages
5
Would it be possible to add a parameter to /manga/{id}/chapters, so that `data` only contains an array of chapters and each chapters groups are included in the same way as they are in /chapter/{id} (i.e. `[{"id":123,"name":"Foo"}]` instead of `[123]`)?
 
Joined
Jan 5, 2020
Messages
4
I'm currently working on an OpenAPI (Swagger) document for the v2 API. I still have a number of endpoints to add and I've been guessing some of the field descriptions but I hope others will find it useful. I'd be happy if MangaDex decides to use what I started and refine it as well. 😄

If there are any suggestions or fixes, feel free to submit a merge request or create an issue in the project.

https://gitlab.com/gondolyr/mangadex-api/-/blob/main/src/v2/openapi.yaml

F4spNHo.png


Regarding login examples, I've made a login function in Rust which stores the session in the HTTP client: https://gitlab.com/gondolyr/mangascholar/-/blob/master/mangascholar_api/src/sources/mangadex.rs#L287

There's also the Komikku project (written in Python) which also uses the AJAX endpoint to log in: https://gitlab.com/valos/Komikku/-/blob/master/komikku/servers/mangadex.py#L289

Edit 2020-11-14: I've finished adding all of the public endpoints to the best of my understanding for the OpenAPI document.
 
Joined
Sep 13, 2019
Messages
3
could you add functionality that allows us to check if a chapter is read or not based on the user currently logged in?
there is a way to get reading progress but as far as I know, you cant set it this too would be nice to have.
URL for RSS feed when querying manga this could be used for notifications on a mobile app for instance.
these combined would make it easy to make a mobile version with notifications for new chapters.

other than these suggestions I'm overjoyed with the API because now I could probably create a mobile version of it and read while on the train or something.
 
Joined
Nov 13, 2020
Messages
1
Currently creating a wrapper for this API and noticed that my CI sometimes randomly fails:
9tfcVx4.png

Turns out that the API sometimes returns a DB error in non-json:
Code:
<html>
<head>
    <link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
    <title>Database Error - MangaDex</title>
</head>

<body>
<h1 style="text-align: center; ">Database Error</h1>
<hr />
<a href="/"><img style="margin: 0 auto; display: block;" src="/images/avatars/default1.jpg" alt="DB Error" /></a>
<p style="text-align: center; ">The Database server is under heavy load and can't serve your request. Please wait a bit and try refreshing the page.</p>
</body>
</html>

Would you mind changing this error to a JSON error? If this is not possible, what HTTP Return Code does this have? I'm guessing some 5xx one but I haven't logged that yet. My Wrapper currently assumes the API only outputs in JSON, tries to parse the HTML and fails...
 

rdn

Forum Admin
Staff
Developer
Joined
Jan 18, 2018
Messages
282
@erri120 the database error currently might happen before the api has the opportunity to catch the error. We'll add a fix for that
 
Joined
Oct 21, 2019
Messages
30
well, i run out of ideas to help, but i still think that you guys should optimize the reader, idk how.
 
Joined
Jan 18, 2018
Messages
1
Is there a deadline to adopt V2? This pet project of mine don't get a lot of attention lately due to work but it would be nice if we have some sort of deadline on when v1 API gonna kick the bucket. Understandable if we don't have one though.

Still, thanks for doing the god work.
 
Custom title
Staff
Developer
Joined
Jan 19, 2018
Messages
2,474
@UnlikelyChopshopNacho posted:

Would it be possible to add a parameter to /manga/{id}/chapters, so that `data` only contains an array of chapters and each chapters groups are included in the same way as they are in /chapter/{id} (i.e. `[{"id":123,"name":"Foo"}]` instead of `[123]`)?
Absolutely not, that's pointless duplicate data potentially thousands of times over. Especially with how long group names can get.

@AMRAAM_Missiles posted:

Is there a deadline to adopt V2? This pet project of mine don't get a lot of attention lately due to work but it would be nice if we have some sort of deadline on when v1 API gonna kick the bucket. Understandable if we don't have one though.
As long as the site itself is still using v1, I won't give it a deadline. Would be cool if we could it by 2021-01-01 I guess, that's a nice date.
 

tbf

Joined
Jan 18, 2018
Messages
3
Through
Code:
https://mangadex.org/api/v2/user/{id}/followed-manga
, is there a way to view other people's list or to view public lists? I can see my friend's list via
Code:
https://mangadex.org/list/{id}
and public lists, but not via the API (I can only get my own list).
 
Custom title
Staff
Developer
Joined
Jan 19, 2018
Messages
2,474
2020-11-18
- Fixed chapter list pagination by using the
Code:
p
parameter returning results from the wrong offset
- Fixed chapter views being incremented even when the chapter was unavailable to the user
 
Dex-chan lover
Joined
Oct 15, 2018
Messages
37
Can you add additional search filters, such as choosing the language of the chapters returned. And either I don't understand what lastChapter means when receiving the manga, or it still doesn't work (
Code:
https://mangadex.org/api/v2/manga/23439
still null here). And I still don't understand why there is a limit that you can return at least 10 chapters.
 
Status
Not open for further replies.

Users who are viewing this thread

Top