Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Scratch 3 API
- kashifau
-
New Scratcher
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
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
-
Scratcher
1000+ posts
Scratch 3 API
Maybe this could help…The title of the linked article says “Scratch API (2.0).” The OP wanted the API for Scratch 3.0.
- kashifau
-
New Scratcher
22 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
Thanks exactly what I wanted. Thanks!
- superfireninja9
-
Scratcher
12 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
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 } }
- 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)
- Discussion Forums
- » Advanced Topics
-
» Scratch 3 API