502 Bad Gateway on API call

I’m requesting an API call that is pretty huge and can be seen right at the bottom of this post.

When executed it constantly returns a 502 Bad Gateway response but when testing it with less names it works. I assume this is because the server becomes overloaded and fails to send anything back.

Is there any well known fix to this? Should I split the names down into smaller groups and get their JSON files separately?

http://api.justin.tv/api/stream/list.json?channel=DrFunkz,ivan,Tokyoboi808,Santana,smesty,IIRiskantII,BruceVayne,kreichjr,dad_of_steel,chaosknight373,carnage64,luke994,keymakr,infoutlaw,explodroid,thegentlemaninc,odepery,optimusprimemini,mrbubbleskp,kr0g3rnazy1,mrspeedrun,onlydefusea,xguerilla,zellyzel,dangerless,blackwin5,zurcio,tobiastros,slyzer,cferens,gulmo,zuloph,roryextralife,blinkzy,it0a,26pt2,outside_lutz,mhfsilver,wypy,blackchaosx12,zealarn,saibot__,syralys,sean9o8o,Walatt,alexandallen,dj71807,moomoo_the_cow,atkinsj7,cannotbedone1,tamahawk,JimmyJamma15,gnager,RCFstupca,JPtheGeek,BldAgl,MegaSuperUltraThingy,renimfeeg,kalijey,grockey3,rollingrockruns,nenkozan,frostblitz20,roymishima,deathtome,runnerwatcher,rsmvbomb04,kromexrainbow,elainespencer,dampylle,firebandicoot,sirwazzabi,ker,hereliesed,Disenchantment,Theepicflame,Roytjaah,Gothiclogic,agaomen,halodude862,oldschoolgamingvidz,noufozzy,malouna,samsiditer,loafofbread13,ajefk12555,altidorian,JimmyNintendo,hyphen_ated,danblast86,disturbed1992,mgsfan876,antartiida,smelipanda,everalert,lordmajeh,zmaster91,kingarthur23007,gaminghunter,rectangularbox,djkanjo,shizze,cedric522,Failinator,therpguru,spark,gobbitybobbity,logeek044,neoslash72,occifermagnets,nejasu,slask2prask,mattisticus,webster141,maelficus,soulcrusher842,lyssavengeance,senorchilla,xyulf,lzhjarrett,steelflarecraft,tutegos,dak_rey,hookshot1436,garlock009,zelkystv,harpooncannon,isigmav2,biddygofast,chukkeyfly,adamtimothy0,thorimgauser,jazzychoi1991,kheartz,mysterize,jtnoble321,FatalFrame,thewolfboss,spaceboundbear,kartseven,Game_Complete,ohaithereman,Calebhart42,passivebobomb,plunkettfla,retromadnesszone,daddypnot3d,hetsig,archpotato,karmerz,fallenwind,dtchow,Khanster786,Multiwinner,Unbarringslinky,Sweftunivers,zellpree,elbodykso,bluecrystal004,abahbob,jamacanbacn,dellec,sincenatti,atratus,jrp2234gaming,Thursday__,th3schwartz,habbys20,angelsprayer,kingofeds,glocklan,championbeef,sevenup1203,speedruntrainer,cooltrainermichael,enjoi_ev,kaorru,freshtoast2,themegaful900,chaoslinkx33,jumpyluff,brantoast75,nightchildo,elyzsabo,liquidwifi,archadiestv,sk84uhlivin,al_skorcho_,bjfinn,shizuha_aki,

`

I believe the current twitch api can handle this, but it looks like you need justin.tv as well. is this correct?

If you are query Twitch channels then you should probably use the Kraken API: https://github.com/justintv/Twitch-API/blob/master/v2_resources/streams.md#get-streams