MangaUpdates API Comments/Suggestions/Bugs
3 years ago
Posts: 2
I have a userscript for Mangadex that, if there's MangaDex has a MangaUpdates link for a series, scrapes the MangaUpdates series page to see if MangaUpdates knows of a more recent release than Mangadex. As it is now, the new API is not an improvement for this particular purpose.
Having to scrape the series page for the new ID prevents my userscript from benefiting from the API's laxer rate limit. Scraping the series page also gives me release times at hour granularity (ie "4 hours ago" vs only day granularity for api.mangaupdates.com/v1/releases/search. If that information is available from api.mangaupdates.com/v1/releases/{id}, it requires authentication, unlike scraping.
3 years ago
Posts: 82
https://api.mangaupdates.com/#operation/retrieveLists
https://api.mangaupdates.com/#operation/retrievePublicLists
and
https://api.mangaupdates.com/#operation/searchPublicListsPost
https://api.mangaupdates.com/#operation/searchListsPost
Same functions?

3 years ago
Posts: 2852
One can be accessed by others publicly, and the other one is for access by you only...

3 years ago
Posts: 2852
I want to discourage scraping as it really reduces the performance of the site for others. I know some people will scrape the pages and get the new ids, but I don't want to make it easy because that's not the way I want people to use the API. I prefer people to use the search function.
3 years ago
Posts: 2
I tried putting the old id into https://api.mangaupdates.com/v1/releases/search and https://api.mangaupdates.com/v1/series/search without success
You want to discourage scraping and I want to avoid it, so what should I do instead of
The docs say "This API powers our website." What API functions enable fetching the series info for old urls like https://www.mangaupdates.com/series.html?id=53203? What API functions enable reporting releases as X hours ago instead of the day of the release?

3 years ago
Posts: 2852
All we want to prevent is enumeration of the database, because it's extremely heavy on our servers. That means we don't want folks to just run 200k GET requests, from 1-200k, all at once. If you scrape a page occasionally or on demand when you want to find the new ID, we realize that's going to happen and we're not going to prevent it. However, we would prefer you use our API's search function to find series going forward.
We have an API function that does what you're asking, but it's tagged as admin and hidden from the public schema. It is also controlled behind a service account role. We have several other functions that are available (that our site uses) that are hidden with this tag as well. These are mostly based around administrative functions like spam control and reporting, and aren't really of interest to users anyway.

3 years ago
Posts: 3
Do you have an example API request using this? https://api.mangaupdates.com/v1/series/search
Or is there a method to do a simple search with just the name?
3 years ago
Posts: 82
Using python + requests lib:
import requests
r = requests.post('https://api.mangaupdates.com/v1/series/search', data={'search': 'naruto'})
print(r.json()['results'][ 0 ]['record']['series_id'])
3 years ago
Posts: 82
Anyway people will find a way to scrape. Maybe you just release db dump monthly or so? Like anidb or wikipedia.

3 years ago
Posts: 3
Sorry, i'm using java, do you have an example?

3 years ago
Posts: 2852
https://github.com/OpenAPITools/openapi-generator
OpenAPI Generator is a good tool for generating clients from API definitions for multiple languages.
You can point it at the API Definition here: https://api.mangaupdates.com/openapi.yaml
3 years ago
Posts: 2
I think I found an issue with https://api.mangaupdates.com/v1/releases/days
In the response, the "time_added" object is missing from "record".

3 years ago
Posts: 1
How about a field for description without any HTML tags?

3 years ago
Posts: 2852
Quote from romdierom
How about a field for description without any HTML tags?
You can use the unrenderedFields option, but other than that you can strip the tags easily... I've been wanting to move to markdown for editing, so at some point I will do a mass update.
3 years ago
Posts: 3
Can anyone confirm if per_page doesn't work in search or I'm getting something wrong?
requests.post('https://api.mangaupdates.com/v1/series/search', data={'search': 'naruto', 'per_page': 2})
Header of result:
{'total_hits': 822, 'page': 1, 'per_page': 25, 'results':
Thanks.