Forum Settings
Forums
New
Mar 27, 4:39 PM
#1

Offline
Jan 2015
20
I'm processing my own list that has around 600 rows... I discovered that around 150 requests the API throws me a 504 Gateway Timeout.
Someone had the same problem?

I tried to add a retrying time, or a "pausing" after those amount of requests, but it didn't went well.

        if request_count % 150 == 0:
            print("150 requests processed. Pausing for 30 seconds...")
            time.sleep(30)


                if e.response is not None and e.response.status_code == 504:
                    print(f"504 Gateway Timeout for anime id {anime_id}. Retrying in 30 seconds...")
                    time.sleep(30)
Reply Disabled for Non-Club Members
Mar 27, 11:16 PM
#2
Offline
Aug 2019
1
Yup. It looks like after around 150-200 requests within a short amount you get throttled and banned for 5-10 minutes. https://myanimelist.net/forum/?topicid=2142532 There is an older thread about the same issue. You could try setting a 5 min timeout if you hit 504 and see if that works.
Mar 29, 9:04 AM
#3

Offline
Apr 2010
2844
You may want to use the /users/{user}/animelist endpoint instead. It returns slightly less data than /anime/{id}, but it is much more suited to retrieving your whole list (as you can request up to 1000 anime entries at a time).
Apr 13, 7:13 AM
#4

Offline
Jan 2015
20
Reply to Jhiday
You may want to use the /users/{user}/animelist endpoint instead. It returns slightly less data than /anime/{id}, but it is much more suited to retrieving your whole list (as you can request up to 1000 anime entries at a time).
Yeah, I'm using /users/{user}/animelist endpoint to retrieve my list first, and then I search the details of the animes in my list using /anime/{id}.

But, if there's a way to get more details using the first endpoint I'd love to know. For now I'm using just fields=list_status.
KriefferApr 13, 7:17 AM
Apr 13, 7:24 AM
#5

Offline
Jan 2015
20
Reply to UncrownedGod
Yup. It looks like after around 150-200 requests within a short amount you get throttled and banned for 5-10 minutes. https://myanimelist.net/forum/?topicid=2142532 There is an older thread about the same issue. You could try setting a 5 min timeout if you hit 504 and see if that works.
@UncrownedGod I changed to 5 minutes and now it's running "better" than before. Thanks for the advice!
Reply Disabled for Non-Club Members

More topics from this board

» I built a spotify-styled 'MyAnimeList Wrapped' for a yearly review of your anime and manga

XAvishkar - Dec 14

1 by Joeliazeers »»
Dec 17, 1:01 PM

» [Repost] list of all relation_type and media_type.

Mr_UnknownOtaku - Dec 8

4 by -DxP- »»
Dec 12, 8:43 AM

» How to get author name?

EdibleMuffin - Feb 12

4 by XAvishkar »»
Dec 8, 9:52 AM

» 401 Unauthorized when doing authorization flow

Konng_ - Nov 16

2 by Konng_ »»
Nov 28, 3:24 PM

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

daux - Apr 16, 2022

33 by daux »»
Oct 2, 4:17 PM
It’s time to ditch the text file.
Keep track of your anime easily by creating your own list.
Sign Up Login