Discuss Scratch

kashifau
New to Scratch
22 posts

Scratch 3 API

For Scratch 2 it was possible to download the code in JSON format using https://cdn.projects.scratch.mit.edu/internalapi/{id}/get. Is there something similar available for Scratch 3?

Last edited by kashifau (Nov. 26, 2019 22:15:45)

Sheep_maker
Scratcher
1000+ posts

Scratch 3 API

https://projects.scratch.mit.edu/[project ID here]
Example: https://projects.scratch.mit.edu/284516654 (it downloads a JSON file automatically if you visit it in the browser)

If you want to get an asset,
https://cdn.assets.scratch.mit.edu/internalapi/asset/[asset ID].[file extension]/get/
Example: https://cdn.assets.scratch.mit.edu/internalapi/asset/94202b299af67872b4ee31a37bb7ebea.mp3/get/

The Scratch forums don't let you use the asset URLs to host images; they probably have a good reason for that

- Sheep_maker This is a kumquat-free signature. :P
This, my signature, appears below all my posts. Discuss it on my profile, not the forums. Here's how to make your own.
Post count: more than 6
.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }
-Snipet-
Scratcher
100+ posts

Scratch 3 API

Maybe this could help

I make stuff. I also own a website.


Blasted little 60 second rule…
Sheep_maker
Scratcher
1000+ posts

Scratch 3 API

-Snipet- wrote:

Maybe this could help
The title of the linked article says “Scratch API (2.0).” The OP wanted the API for Scratch 3.0.

- Sheep_maker This is a kumquat-free signature. :P
This, my signature, appears below all my posts. Discuss it on my profile, not the forums. Here's how to make your own.
Post count: more than 6
.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }
kashifau
New to Scratch
22 posts

Scratch 3 API

Sheep_maker wrote:

https://projects.scratch.mit.edu/[project ID here]
Example: https://projects.scratch.mit.edu/284516654 (it downloads a JSON file automatically if you visit it in the browser)

If you want to get an asset,
https://cdn.assets.scratch.mit.edu/internalapi/asset/[asset ID].[file extension]/get/
Example: https://cdn.assets.scratch.mit.edu/internalapi/asset/94202b299af67872b4ee31a37bb7ebea.mp3/get/

The Scratch forums don't let you use the asset URLs to host images; they probably have a good reason for that

Thanks exactly what I wanted. Thanks!
superfireninja9
Scratcher
5 posts

Scratch 3 API

I found out how to use the API links, but are there API assets or links that can tell me the number of views a project has? Or just general info about the project? I know that was possible in scratch 2. Here is a website that is able to tell you the number of views a project has using API requests. https://scratch.alphabetica.io/apps/scratchTotale/

Last edited by superfireninja9 (Jan. 29, 2020 21:57:44)

Sheep_maker
Scratcher
1000+ posts

Scratch 3 API

superfireninja9 wrote:

I found out how to use the API links, but are there API assets or links that can tell me the number of views a project has? Or just general info about the project? I know that was possible in scratch 2. Here is a website that is able to tell you the number of views a project has using API requests. https://scratch.alphabetica.io/apps/scratchTotale/
https://api.scratch.mit.edu/projects/[project ID here] gives some information about a project.
Example: https://api.scratch.mit.edu/projects/343427953

Probably the relevant part for you is the “stats” property:
{
  "stats": {
    "views": 43,
    "loves": 7,
    "favorites": 4,
    "comments": 8,
    "remixes": 1
  }
}

- Sheep_maker This is a kumquat-free signature. :P
This, my signature, appears below all my posts. Discuss it on my profile, not the forums. Here's how to make your own.
Post count: more than 6
.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }
A-E-
Scratcher
100+ posts

Scratch 3 API

Are you looking for https://projects.scratch.mit.edu/ID_HERE?

Last edited by A-E- (Feb. 5, 2020 22:28:10)

543017
Scratcher
1 post

Scratch 3 API

43434

Powered by DjangoBB

Standard | Mobile