Discuss Scratch

Firedrake969
Scratcher
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
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)

PullJosh
Scratcher
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:
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:
http://scratch.mit.edu/site-api/comments/user/[username]/?page=[page number]
Get recent activity by user:
http://scratch.mit.edu/messages/ajax/user-activity/?user=[username]&max=[max items to return]
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/friends-activity/?max=[max items to return]
Get backpack of currently logged in user:
http://scratch.mit.edu/internalapi/backpack/[must be logged in user]/get/
Get list of all the users who ever joined, in order of sign up date:
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:
https://scratch.mit.edu/api/v1/project/[project id]/?format=json
Get comments on project page:
http://scratch.mit.edu/site-api/comments/project/[project id]/?page=[page number]

Studios
Get general studio info:
https://scratch.mit.edu/site-api/projects/in/[studio id]/[page number]/
(Each page shows a maximum of 60 projects)
Get comments on studio:
http://scratch.mit.edu/site-api/comments/gallery/[studio id]/?page=[page number]
Get all studios curated by current signed in user:
http://scratch.mit.edu/site-api/galleries/
Sending Data (Coming Soon)
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
Scratcher
1000+ posts

Scratch APIs

Please let me know if you know of any other site-api urls!
Superdoggy
Scratcher
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

Last edited by Superdoggy (March 8, 2015 23:03:10)

Thepuzzlegame
Scratcher
1000+ posts

Scratch APIs

http://scratch.mit.edu/internalapi/backpack/[username]/get/
The above returns the contents of a users backpack, however only the backpack of the logged in user can be accessed.

Last edited by Thepuzzlegame (March 8, 2015 22:50:05)

Firedrake969
Scratcher
1000+ posts

Scratch APIs

bump
PullJosh
Scratcher
1000+ posts

Scratch APIs

Firedrake969 wrote:

Um…
http://scratch.mit.edu/discuss/topic/96414/
Okay if I use those to make a more structured topic? (With credit)
Thepuzzlegame
Scratcher
1000+ posts

Scratch APIs

Perhaps the two topics should be merged.
PullJosh
Scratcher
1000+ posts

Scratch APIs

Thepuzzlegame wrote:

Perhaps the two topics should be merged.
Perhaps…

Superdoggy wrote:

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
Ooh, shiny! Didn't know about those. I'll add them when I get the chance.

Thepuzzlegame wrote:

http://scratch.mit.edu/internalapi/backpack/[username]/get/
The above returns the contents of a users backpack, however only the backpack of the logged in user can be accessed.
Awesome! I'll add that as well.

@Everyone For now, I have to do math homework, but I'll update the topic soon.
Firedrake969
Scratcher
1000+ posts

Scratch APIs

Mine was first though
PullJosh
Scratcher
1000+ posts

Scratch APIs

Firedrake969 wrote:

Mine was first though
A merge would probably be best. Is that okay with you?
Firedrake969
Scratcher
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
Scratcher
1000+ posts

Scratch APIs

Firedrake969 wrote:

Yeah, I've already requested it
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!

Edit: O_o Quoted before your edit.

Last edited by PullJosh (March 8, 2015 23:10:42)

Firedrake969
Scratcher
1000+ posts

Scratch APIs

Possibly just move all the replies from this over?
PullJosh
Scratcher
1000+ posts

Scratch APIs

Firedrake969 wrote:

Possibly just move all the replies from this over?
We'll let the mods decide what's best.
Paddle2See
Scratch Team
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
Scratcher
1000+ posts

Scratch APIs

Ok, will do.
Firedrake969
Scratcher
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)

Powered by DjangoBB