Forum Settings
Forums

Receiving error when passing synopsis field to manga ranking request

New
Mar 12, 2022 8:56 PM
#1
Offline
Oct 2020
3
Hello there! I'm working on a project to keep track of trends in MAL over time. I'm using the following endpoints to collect the data that I'll need for the project:
/v2/manga/ranking
/v2/anime/ranking

I am encountering an issue with the manga ranking endpoint that I'm not see when I use the anime ranking endpoint. For some reason, after 9,000 records, requests start failing when I pass the "synopsis" field in the "fields" parameter.

The following curl commands should hopefully repeat the behavior that I'm seeing.

Without the synopsis field, this request returns results, as expected:
curl https://api.myanimelist.net/v2/manga/ranking \
    --verbose \
    --request GET \
    --header 'Accept: application/json' \
    --header 'X-MAL-CLIENT-ID: [omitted]' \
    --get \
    --data 'limit=500' \
    --data 'offset=9000' \
    --data 'ranking_type=all' \
    --data 'fields=id,title'

...

When I include the synopsis field, I receive the following error:
curl https://api.myanimelist.net/v2/manga/ranking \
    --verbose \
    --request GET \
    --header 'Accept: application/json' \
    --header 'X-MAL-CLIENT-ID: [omitted]' \
    --get \
    --data 'limit=500' \
    --data 'offset=9000' \
    --data 'ranking_type=all' \
    --data 'fields=id,title,synopsis'

{"errors":[{"message":"invalid request"}]}

I am able to fetch these records just fine with the anime ranking endpoint, so I have a feeling this might be an issue with the API itself, but I may be missing something else on my end.

Your help is greatly appreciated. Thanks!
Reply Disabled for Non-Club Members
Mar 13, 2022 6:55 AM
#2
四十二

Offline
Mar 2016
479
Hi @x4ku, thanks for the report! Upon further investigation, I've noticed that the error is caused by a single manga, Toki Nazumi, Futari Nazumu.. The synopsis contains an invalid Unicode character which prevents the API from correctly formatting the response.

It should get fixed in a few hours.
HTCPCP/1.0  ★ MetaMAL  ★ Picture credits: Kieed & 1041uuu
Mar 13, 2022 3:21 PM
#3
Offline
Oct 2020
3
Thank you @ZeroCrystal! I was able to get past offset 9000 with my script this time.

For testing purposes, just to see if there were any more titles with this issue, I modified my script to paginate through the entire ranking. I was able to get all the way to offset 41500 this time, but then I'm getting the same error again, so there might be an issue with another title after that point.
Mar 13, 2022 3:29 PM
#4
四十二

Offline
Mar 2016
479
Thanks, I'll give it a look tomorrow.

Don't hesitate to ping me when you run into this kind of problem again in the future.
HTCPCP/1.0  ★ MetaMAL  ★ Picture credits: Kieed & 1041uuu
Mar 14, 2022 6:03 AM
#5
四十二

Offline
Mar 2016
479
x4ku said:
I was able to get all the way to offset 41500 this time, but then I'm getting the same error again, so there might be an issue with another title after that point.

This time the incriminated manga are:
They'll get fixed in a few hours. I checked the entire ranking and there shouldn't be any other corrupted synopses. Same for the anime ranking.
HTCPCP/1.0  ★ MetaMAL  ★ Picture credits: Kieed & 1041uuu
Mar 14, 2022 12:34 PM
#6
Offline
Oct 2020
3
Confirming on my end that I was also able to page through the entire ranking without any issues. Thanks again!
Reply Disabled for Non-Club Members

More topics from this board

» [discontinued] I made a webapp to compare plan-to-watch lists

daux - Apr 16, 2022

33 by daux »»
Oct 2, 4:17 PM

» Requesting additional authorizations

SomeNewGuy - Aug 18

1 by ZeroCrystal »»
Aug 22, 8:31 AM

» Scraping from HTML suggested rate

Davenzo - Jan 8, 2023

4 by 7k72 »»
Jun 23, 6:35 AM

» Accessing Many Users' List

loukylor - Jun 11

0 by loukylor »»
Jun 11, 3:07 PM

» Caching strategy to avoid making additional API calls

Jakuten - Jun 3

4 by Jakuten »»
Jun 8, 11:30 AM
It’s time to ditch the text file.
Keep track of your anime easily by creating your own list.
Sign Up Login