The mod portal API currently fails with Error 503 when used with page_size=max: https://mods.factorio.com/api/mods?page_size=max
A workaround for that is to use page_size with a really big number (more than the amount of mods): https://mods.factorio.com/api/mods?page_size=999999
I have written a bugreport, in the factorio forum: https://forums.factorio.com/viewtopic.php?f=189&t=94119&p=531316