Discuss Scratch
- Discussion Forums
 - » Advanced Topics
 - » Why doesn't this work?
        
         
- Reev0102
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Why doesn't this work?
When I ran
it output
Then, when I visited the page through my browser, I saw this:
Why didn't my code work?
                        
                            response = requests.get("https://api.scratch.mit.edu/users/ceebee/messages/count") print(response.json()["count"])
0
Then, when I visited the page through my browser, I saw this:
{"count":173672}
Why didn't my code work?
Last edited by Reev0102 (Aug. 16, 2021 14:07:22)
- hello_smile
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Why doesn't this work?
When I ranApi restricted.it outputresponse = requests.get("https://api.scratch.mit.edu/users/ceebee/messages/count") print(response.json()["count"])0
Then, when I visited the site through my browser, I saw this:{"count":173672}
Why didn't my code work?
- CST1229
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Why doesn't this work?
The API intentionally returns
when a computer with certain user agents that are usually related to programs tries to GET from the message count API and probably a few others.
Maybe that happened?
                        
                            {"count":0}Maybe that happened?
Last edited by CST1229 (Aug. 16, 2021 13:56:58)
- Reev0102
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Why doesn't this work?
Scratch Javascript On!Scratch Javascript Python On!
Last edited by Reev0102 (Aug. 16, 2021 15:42:08)
- CST1229
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Why doesn't this work?
Pyth On!Scratch Javascript On!Scratch Javascript Python On!
- Chiroyce
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Why doesn't this work?
Hi there,
Someone requested the messages API A LOT using a script (python or JavaScript) and so the scratch team has put some restrictions for the message count api. The URL is still available but I don't think I'm allowed to share it now, so yeah, I'm sorry but the scratch team has had some struggles with the message count api and I'm very sure that they wouldn't like any external scripts to request the message count API.
So in short - please don't request the message count API.
Have a nice day and scratch Python on!
                        
                            Someone requested the messages API A LOT using a script (python or JavaScript) and so the scratch team has put some restrictions for the message count api. The URL is still available but I don't think I'm allowed to share it now, so yeah, I'm sorry but the scratch team has had some struggles with the message count api and I'm very sure that they wouldn't like any external scripts to request the message count API.
So in short - please don't request the message count API.
Have a nice day and scratch Python on!
when a computer with ….I recommend you don't explain the problem with this - people may workaround this and spam the servers again, so why don't we just say that there are some “restrictions” and not exactly what those “restrictions” are?
Maybe that happened?
Last edited by Chiroyce (Aug. 16, 2021 15:42:07)
- Discussion Forums
 - » Advanced Topics
 - 
            » Why doesn't this work? 
         



