Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Scratch APIs
- Firedrake969
-
1000+ posts
Scratch APIs
Idea partially from this.
We should try to find as many APIs under /site-api/ as possible - the wiki definitely doesn't document all of them!
Projects
General project data
Comments on any given project project
Studios
Comments on any given studio
Projects in any given studio
Studios the logged-in user curates
Users
User list
User activity
User profile comments
User's featured project
Miscellaneous
Friend activity
Your Backpack (must be logged in)
Sending Data
Following request - PUT
Follow/unfollow topic
Not many of these have been found by me - I'm just compiling everything I find.
Contributors:
Firedrake969
Cheeseeater
PullJosh
Superdoggy
Thepuzzlegame
We should try to find as many APIs under /site-api/ as possible - the wiki definitely doesn't document all of them!
Projects
General project data
http://scratch.mit.edu/api/v1/project/[project id]/?format=json
Comments on any given project project
http://scratch.mit.edu/site-api/comments/project/[project-id]/?page=[page number]
Studios
Comments on any given studio
http://scratch.mit.edu/site-api/comments/gallery/[studio id]/?page=[page number]
Projects in any given studio
http://scratch.mit.edu/site-api/projects/in/[studio id]/[page number]
Studios the logged-in user curates
http://scratch.mit.edu/site-api/galleries/
Users
User list
http://scratch.mit.edu/api/v1/user/?offset=[user number to start at]&limit=[number of people to show]&format=json
User activity
http://scratch.mit.edu/messages/ajax/user-activity/?user=[username]&max=[how many]
User profile comments
http://scratch.mit.edu/site-api/comments/user/[username]/
User's featured project
http://scratch.mit.edu/site-api/users/all/[username]/
Miscellaneous
Friend activity
http://scratch.mit.edu/messages/ajax/friends-activity/?max=[how many]
Your Backpack (must be logged in)
http://scratch.mit.edu/internalapi/backpack/[username - must be logged in]/get/
Sending Data
Following request - PUT
http://scratch.mit.edu/site-api/users/followers/[username to follow]/add/?usernames=[your username]
Follow/unfollow topic
http://scratch.mit.edu/discuss/subscription/topic/[topic id]/[add/remove]
Not many of these have been found by me - I'm just compiling everything I find.
Contributors:
Firedrake969
Cheeseeater
PullJosh
Superdoggy
Thepuzzlegame
Last edited by Firedrake969 (March 9, 2015 00:07:15)
- cheeseeater
-
1000+ posts
Scratch APIs
From the wiki-
List projects: http://scratch.mit.edu/api/v1/project/?format=json&limit=3
Project info: http://scratch.mit.edu/api/v1/project/2778121/?format=json
User list in sequence: http://scratch.mit.edu/api/v1/user/?format=json
List projects: http://scratch.mit.edu/api/v1/project/?format=json&limit=3
Project info: http://scratch.mit.edu/api/v1/project/2778121/?format=json
User list in sequence: http://scratch.mit.edu/api/v1/user/?format=json
- PullJosh
-
1000+ posts
Scratch APIs
I started a topic about this after this topic was posted. The two have since been merged. Below is my original topic post, if anyone cares to see it:
Many of the below posts are from the topic I made. If a few posts below are confusing, that's probably why.
I'm going to try to compile as many of the /site-api/ urls as possible. If you don't know what that is, then this topic really won't help you. If you do know, hopefully it will.Site-api Unofficial Reference
Receiving Data
Gotta get me some json…
And apparently ajax happens too.
Users
Get comments on user page:Get recent activity by user:http://scratch.mit.edu/site-api/comments/user/[username]/?page=[page number]Get activity from user the currently logged in user is following (basically what shows up in the “What's Happening” feed on the homepage):http://scratch.mit.edu/messages/ajax/user-activity/?user=[username]&max=[max items to return]Get backpack of currently logged in user:http://scratch.mit.edu/messages/ajax/friends-activity/?max=[max items to return]Get list of all the users who ever joined, in order of sign up date:http://scratch.mit.edu/internalapi/backpack/[must be logged in user]/get/https://scratch.mit.edu/api/v1/user/?offset=[user number to start at]&limit=[number of people to show]&format=json
Projects
Get general project info:Get comments on project page:https://scratch.mit.edu/api/v1/project/[project id]/?format=jsonhttp://scratch.mit.edu/site-api/comments/project/[project id]/?page=[page number]
Studios
Get general studio info:(Each page shows a maximum of 60 projects)https://scratch.mit.edu/site-api/projects/in/[studio id]/[page number]/
Get comments on studio:Get all studios curated by current signed in user:http://scratch.mit.edu/site-api/comments/gallery/[studio id]/?page=[page number]Sending Data (Coming Soon)http://scratch.mit.edu/site-api/galleries/
Getting interactive…
Users
Projects
Studios
Thanks for contributions from the following people:
Superdoggy
Thepuzzlegame
Many of the below posts are from the topic I made. If a few posts below are confusing, that's probably why.

Last edited by PullJosh (March 9, 2015 23:04:44)
- PullJosh
-
1000+ posts
Scratch APIs
Please let me know if you know of any other site-api urls!
- Superdoggy
-
1000+ posts
Scratch APIs
Why not include some ajax requests too? 
http://scratch.mit.edu/messages/ajax/user-activity/?user=Superdoggy&max=1000 //user activity
http://scratch.mit.edu/messages/ajax/friends-activity/?max=1000 //friends activity
And here's some links from other similar / duplicate topics:
https://scratch.mit.edu/api/v1/project/47293584/?format=json //lots of info regarding project with specified URL
https://scratch.mit.edu/api/v1/user/?offset=0&limit=200&format=json //first X number of users, starting at user offset
https://scratch.mit.edu/site-api/projects/in/353712/1/ //nth page of projects in studio ID

http://scratch.mit.edu/messages/ajax/user-activity/?user=Superdoggy&max=1000 //user activity
http://scratch.mit.edu/messages/ajax/friends-activity/?max=1000 //friends activity
And here's some links from other similar / duplicate topics:
https://scratch.mit.edu/api/v1/project/47293584/?format=json //lots of info regarding project with specified URL
https://scratch.mit.edu/api/v1/user/?offset=0&limit=200&format=json //first X number of users, starting at user offset
https://scratch.mit.edu/site-api/projects/in/353712/1/ //nth page of projects in studio ID
Last edited by Superdoggy (March 8, 2015 23:03:10)
- Thepuzzlegame
-
1000+ posts
Scratch APIs
http://scratch.mit.edu/internalapi/backpack/[username]/get/
Last edited by Thepuzzlegame (March 8, 2015 22:50:05)
- PullJosh
-
1000+ posts
Scratch APIs
Okay if I use those to make a more structured topic? (With credit) Um…
http://scratch.mit.edu/discuss/topic/96414/
- PullJosh
-
1000+ posts
Scratch APIs
Perhaps… Perhaps the two topics should be merged.
Ooh, shiny! Didn't know about those. I'll add them when I get the chance. Why not include some ajax requests too?
http://scratch.mit.edu/messages/ajax/user-activity/?user=Superdoggy&max=1000
http://scratch.mit.edu/messages/ajax/friends-activity/?max=1000

Awesome! I'll add that as well.The above returns the contents of a users backpack, however only the backpack of the logged in user can be accessed.http://scratch.mit.edu/internalapi/backpack/[username]/get/
@Everyone For now, I have to do math homework, but I'll update the topic soon.

- PullJosh
-
1000+ posts
Scratch APIs
A merge would probably be best. Is that okay with you? Mine was first though
- Firedrake969
-
1000+ posts
Scratch APIs
I've already requested the mods to check it out and decide (since mine looks like yours, so a merge would have duplicate posts)
Last edited by Firedrake969 (March 8, 2015 23:08:56)
- PullJosh
-
1000+ posts
Scratch APIs
K. Srry I didn't see yours first. However, this one seems to be getting quite a bit more attention than yours did, so… yeah. Merges. Yay! Yeah, I've already requested it
Edit: O_o Quoted before your edit.
Last edited by PullJosh (March 8, 2015 23:10:42)
- PullJosh
-
1000+ posts
Scratch APIs
We'll let the mods decide what's best. Possibly just move all the replies from this over?
- Paddle2See
-
1000+ posts
Scratch APIs
A merge seemed like the best solution - perhaps you can make sure that the first post has all the information from the other topic and then maybe later request that the redundant posts be removed.
- Firedrake969
-
1000+ posts
Scratch APIs
I believe I've added all of the APIs in PullJosh's post.
Last edited by Firedrake969 (March 9, 2015 00:06:29)
- Discussion Forums
- » Advanced Topics
-
» Scratch APIs