テンプレート:Other version
Scratch APIは、プログラマーとって簡単な方法でデータの様々なインスタンスにアクセスするためのインターフェースですScratchウェブサイトとの間でデータを送受信するアプリケーションを作成するために、さまざまな方法で使用することができる。現在のScratch APIのアドレスは、https://api.scratch.mit.edu
警告:
APIは、責任を持って、
利用規約に合わせて使用すること。 APIの悪用は、
BANにつながる可能性がある。{{:en:cite post|Paddle2See|15/11/2021|アカウントは間違いなくAPIを悪用するためにブロックされています。|
post:5784428}}
api.scratch.mit.edu インターフェイス
api.scratch.mit.edu インターフェースは、Scratch API の最新版である。Scratchのウェブサイトに関する様々なデータを返すために使用できる。この API には以下の URL でアクセスできる。
https://api.scratch.mit.edu
All endpoints that return an array accept query parameters named limit
and offset
, except /studios/<studio_id>/activity
which only supports limit
. limit
is the maximum number of items in the response (up to 40). offset
is the zero-based index of the first item in the response. For example, /users/mres/projects/142/comments?limit=3&offset=10
returns the 11th, 12th and 13th comment. The default limit is 20 and the default offset is 0.
見出しタイトル
GET /
The root of the api interface provides basic information regarding the API and the Scratch website.
- 要求の例
GET https://api.scratch.mit.edu
- 応答の例
Response
|
{
"website":"scratch.mit.edu",
"api":"api.scratch.mit.edu",
"help":"help@scratch.mit.edu"
}
|
Health
GET /health
Used to return the status of the Scratch website.
- 要求の例
GET https://api.scratch.mit.edu/health
- 応答の例
Response
|
{
"version":"2d7d8b5e9c7a72cfe15a97ebcc5818ec7380374c",
"uptime":11791451,
"load":[
0.0283203125,
0.03515625,
0.04541015625
],
"sql":{
"ssl":true,
"started":"2016-03-03T20:54:19.798Z",
"min":0,
"max":20
}
}
|
News
GET /news
Returns information regarding the "Scratch News" section of the homepage.
- 要求の例
GET https://api.scratch.mit.edu/news
- 応答の例
Response
|
[
{
"id":140458468423,
"stamp":"2016-03-04T19:08:01.000Z",
"headline":"Scratch Video Update Ep. 14",
"url":"https://scratch.mit.edu/discuss/topic/186558/",
"image":"https://40.media.tumblr.com/b563e9425dfca8ac53396d997db312ba/tumblr_inline_nwua1f4Chy1szpavb_540.png",
"copy":"Want to know what's happening on Scratch? Check out the latest video update!"
},
{
"id":140391071468,
"stamp":"2016-03-03T15:13:27.000Z",
"headline":"New Community Blog Post!",
"url":"https://scratch.mit.edu/discuss/topic/186359/",
"image":"https://36.media.tumblr.com/b8e8bc37f38a135a0f873a6fe7788701/tumblr_inline_nwuak8hOun1szpavb_540.png",
"copy":"6 Dance Parties on Scratch To Join Right Now!"
},
...
]
|
Projects
GET /projects/count/all
Returns the total number of shared projects on the Scratch website.
- 要求の例
GET https://api.scratch.mit.edu/projects/count/all
- 応答の例
Response
|
{
"count":13561186
}
|
GET /projects/<project_id>
Returns information about the project. The response is the same as /users/<username>/projects/<project_id>
except that it includes the author's username.
- 要求の例
GET https://api.scratch.mit.edu/projects/142
- 応答の例
Response
|
{
"id": 142,
"title": "PlayWithYourFace",
"description": "...",
"instructions": "...",
"visibility": "visible",
"public": true,
"comments_allowed": true,
"is_published": true,
"author": {
"id": 167,
"username": "mres",
"scratchteam": false,
"history": {
"joined": "1900-01-01T00:00:00.000Z"
},
"profile": {
"id": null,
"images": {
"90x90": "https://cdn2.scratch.mit.edu/get_image/user/167_90x90.png?v=",
"60x60": "https://cdn2.scratch.mit.edu/get_image/user/167_60x60.png?v=",
"55x55": "https://cdn2.scratch.mit.edu/get_image/user/167_55x55.png?v=",
"50x50": "https://cdn2.scratch.mit.edu/get_image/user/167_50x50.png?v=",
"32x32": "https://cdn2.scratch.mit.edu/get_image/user/167_32x32.png?v="
}
}
},
"image": "https://cdn2.scratch.mit.edu/get_image/project/142_480x360.png",
"images": {
"282x218": "https://cdn2.scratch.mit.edu/get_image/project/142_282x218.png?v=1492110178",
"216x163": "https://cdn2.scratch.mit.edu/get_image/project/142_216x163.png?v=1492110178",
"200x200": "https://cdn2.scratch.mit.edu/get_image/project/142_200x200.png?v=1492110178",
"144x108": "https://cdn2.scratch.mit.edu/get_image/project/142_144x108.png?v=1492110178",
"135x102": "https://cdn2.scratch.mit.edu/get_image/project/142_135x102.png?v=1492110178",
"100x80": "https://cdn2.scratch.mit.edu/get_image/project/142_100x80.png?v=1492110178"
},
"history": {
"created": "2007-03-07T14:48:22.000Z",
"modified": "2017-04-13T19:02:58.000Z",
"shared": "2007-03-07T14:48:22.000Z"
},
"stats": {
"views": 5220,
"loves": 296,
"favorites": 238,
"remixes": 32
},
"remix": {
"parent": null,
"root": null
},
"project_token": "1657533369_d4e43df47c361a4150d085cfb58cd184a0a4c34b"
}
|
GET /projects/<project_id>/remixes
Returns an array of the project's remixes.
- 要求の例
GET https://api.scratch.mit.edu/projects/142/remixes
- 応答の例
Response
|
[
{
"id": 138240950,
"title": "PlayWithYourFace remix",
"description": "...",
"instructions": "...",
"visibility": "visible",
"public": true,
"comments_allowed": true,
"is_published": true,
"author": {
"id": 19462034,
"username": "EAPO",
"scratchteam": false,
"history": {
"joined": "1900-01-01T00:00:00.000Z"
},
"profile": {
"id": null,
"images": {
"90x90": "https://cdn2.scratch.mit.edu/get_image/user/19462034_90x90.png?v=",
"60x60": "https://cdn2.scratch.mit.edu/get_image/user/19462034_60x60.png?v=",
"55x55": "https://cdn2.scratch.mit.edu/get_image/user/19462034_55x55.png?v=",
"50x50": "https://cdn2.scratch.mit.edu/get_image/user/19462034_50x50.png?v=",
"32x32": "https://cdn2.scratch.mit.edu/get_image/user/19462034_32x32.png?v="
}
}
},
"image": "https://cdn2.scratch.mit.edu/get_image/project/138240950_480x360.png",
"images": {
"282x218": "https://cdn2.scratch.mit.edu/get_image/project/138240950_282x218.png?v=1483207072",
"216x163": "https://cdn2.scratch.mit.edu/get_image/project/138240950_216x163.png?v=1483207072",
"200x200": "https://cdn2.scratch.mit.edu/get_image/project/138240950_200x200.png?v=1483207072",
"144x108": "https://cdn2.scratch.mit.edu/get_image/project/138240950_144x108.png?v=1483207072",
"135x102": "https://cdn2.scratch.mit.edu/get_image/project/138240950_135x102.png?v=1483207072",
"100x80": "https://cdn2.scratch.mit.edu/get_image/project/138240950_100x80.png?v=1483207072"
},
"history": {
"created": "2016-12-31T17:57:50.000Z",
"modified": "2016-12-31T17:57:52.000Z",
"shared": "2016-12-31T17:57:52.000Z"
},
"stats": {
"views": 60,
"loves": 0,
"favorites": 0,
"remixes": 0
},
"remix": {
"parent": 142,
"root": 142
}
},
{
"id": 140921529,
"title": "PlayWithMyFace",
"description": "...",
"instructions": "...",
"visibility": "visible",
"public": true,
"comments_allowed": true,
"is_published": true,
"author": {
"id": 7076324,
"username": "Babygoo25",
"scratchteam": false,
"history": {
"joined": "1900-01-01T00:00:00.000Z"
},
"profile": {
"id": null,
"images": {
"90x90": "https://cdn2.scratch.mit.edu/get_image/user/7076324_90x90.png?v=",
"60x60": "https://cdn2.scratch.mit.edu/get_image/user/7076324_60x60.png?v=",
"55x55": "https://cdn2.scratch.mit.edu/get_image/user/7076324_55x55.png?v=",
"50x50": "https://cdn2.scratch.mit.edu/get_image/user/7076324_50x50.png?v=",
"32x32": "https://cdn2.scratch.mit.edu/get_image/user/7076324_32x32.png?v="
}
}
},
"image": "https://cdn2.scratch.mit.edu/get_image/project/140921529_480x360.png",
"images": {
"282x218": "https://cdn2.scratch.mit.edu/get_image/project/140921529_282x218.png?v=1484949186",
"216x163": "https://cdn2.scratch.mit.edu/get_image/project/140921529_216x163.png?v=1484949186",
"200x200": "https://cdn2.scratch.mit.edu/get_image/project/140921529_200x200.png?v=1484949186",
"144x108": "https://cdn2.scratch.mit.edu/get_image/project/140921529_144x108.png?v=1484949186",
"135x102": "https://cdn2.scratch.mit.edu/get_image/project/140921529_135x102.png?v=1484949186",
"100x80": "https://cdn2.scratch.mit.edu/get_image/project/140921529_100x80.png?v=1484949186"
},
"history": {
"created": "2017-01-19T22:44:38.000Z",
"modified": "2017-01-20T21:53:06.000Z",
"shared": "2017-01-19T23:13:40.000Z"
},
"stats": {
"views": 84,
"loves": 2,
"favorites": 1,
"remixes": 0
},
"remix": {
"parent": 142,
"root": 142
}
},
...
]
|
Studios
GET /studios/<studio_id>
Returns information about the studio.
- 要求の例
GET https://api.scratch.mit.edu/studios/31659696
- 応答の例
Response
|
{
"id": 31659696,
"title": "Silhouettes & Shadows",
"host": 128878,
"description": "...",
"visibility": "visible",
"public": true,
"open_to_all": false,
"comments_allowed": true,
"image": "https://cdn2.scratch.mit.edu/get_image/gallery/31659696_170x100.png",
"history": {
"created": "2022-05-23T14:36:18.000Z",
"modified": "2022-06-02T13:59:01.000Z"
},
"stats": {
"comments": 100,
"followers": 2327,
"managers": 18,
"projects": 100
}
}
|
GET /studios/<studio_id>/projects
Returns an array of projects in the studio.
- 要求の例
GET https://api.scratch.mit.edu/studios/31659696/projects
- 応答の例
Response
|
[
{
"id": 712482210,
"title": "Siren head - point and click and shadows",
"image": "https://cdn2.scratch.mit.edu/get_image/project/712482210_480x360.png",
"creator_id": 80340175,
"username": "karkulin123",
"avatar": {
"90x90": "https://cdn2.scratch.mit.edu/get_image/user/80340175_90x90.png?v=",
"60x60": "https://cdn2.scratch.mit.edu/get_image/user/80340175_60x60.png?v=",
"55x55": "https://cdn2.scratch.mit.edu/get_image/user/80340175_55x55.png?v=",
"50x50": "https://cdn2.scratch.mit.edu/get_image/user/80340175_50x50.png?v=",
"32x32": "https://cdn2.scratch.mit.edu/get_image/user/80340175_32x32.png?v="
},
"actor_id": 95464324
},
{
"id": 712758811,
"title": "Cool Shadow that does shadow thing",
"image": "https://cdn2.scratch.mit.edu/get_image/project/712758811_480x360.png",
"creator_id": 56350936,
"username": "google-X",
"avatar": {
"90x90": "https://cdn2.scratch.mit.edu/get_image/user/56350936_90x90.png?v=",
"60x60": "https://cdn2.scratch.mit.edu/get_image/user/56350936_60x60.png?v=",
"55x55": "https://cdn2.scratch.mit.edu/get_image/user/56350936_55x55.png?v=",
"50x50": "https://cdn2.scratch.mit.edu/get_image/user/56350936_50x50.png?v=",
"32x32": "https://cdn2.scratch.mit.edu/get_image/user/56350936_32x32.png?v="
},
"actor_id": 67144386
},
...
]
|
GET /studios/<studio_id>/managers
Returns an array of the studio's managers.
- 要求の例
GET https://api.scratch.mit.edu/studios/31659696/managers
- 応答の例
Response
|
[
{
"id": 128878,
"username": "ScratchDesignStudio",
"scratchteam": false,
"history": {
"joined": "2008-06-20T12:21:46.000Z"
},
"profile": {
"id": 128546,
"images": {
"90x90": "https://cdn2.scratch.mit.edu/get_image/user/128878_90x90.png?v=",
"60x60": "https://cdn2.scratch.mit.edu/get_image/user/128878_60x60.png?v=",
"55x55": "https://cdn2.scratch.mit.edu/get_image/user/128878_55x55.png?v=",
"50x50": "https://cdn2.scratch.mit.edu/get_image/user/128878_50x50.png?v=",
"32x32": "https://cdn2.scratch.mit.edu/get_image/user/128878_32x32.png?v="
},
"status": "...",
"bio": "...",
"country": "United States"
}
},
{
"id": 2755634,
"username": "ceebee",
"scratchteam": true,
"history": {
"joined": "2013-09-21T14:57:20.000Z"
},
"profile": {
"id": 2755634,
"images": {
"90x90": "https://cdn2.scratch.mit.edu/get_image/user/2755634_90x90.png?v=",
"60x60": "https://cdn2.scratch.mit.edu/get_image/user/2755634_60x60.png?v=",
"55x55": "https://cdn2.scratch.mit.edu/get_image/user/2755634_55x55.png?v=",
"50x50": "https://cdn2.scratch.mit.edu/get_image/user/2755634_50x50.png?v=",
"32x32": "https://cdn2.scratch.mit.edu/get_image/user/2755634_32x32.png?v="
},
"status": "...",
"bio": "...",
"country": "United States"
}
},
...
]
|
GET /studios/<studio_id>/curators
Returns an array of the studio's curators.
- 要求の例
GET https://api.scratch.mit.edu/studios/31659696/curators
- 応答の例
Response
|
[
{
"id": 74326749,
"username": "Aloeheart6",
"scratchteam": false,
"history": {
"joined": "2021-03-25T20:41:05.000Z"
},
"profile": {
"id": 74326749,
"images": {
"90x90": "https://cdn2.scratch.mit.edu/get_image/user/74326749_90x90.png?v=",
"60x60": "https://cdn2.scratch.mit.edu/get_image/user/74326749_60x60.png?v=",
"55x55": "https://cdn2.scratch.mit.edu/get_image/user/74326749_55x55.png?v=",
"50x50": "https://cdn2.scratch.mit.edu/get_image/user/74326749_50x50.png?v=",
"32x32": "https://cdn2.scratch.mit.edu/get_image/user/74326749_32x32.png?v="
},
"status": "...",
"bio": "...",
"country": "Antarctica"
}
},
{
"id": 68657543,
"username": "Mirtillo_Strawberry",
"scratchteam": false,
"history": {
"joined": "2020-12-08T18:51:49.000Z"
},
"profile": {
"id": 68657543,
"images": {
"90x90": "https://cdn2.scratch.mit.edu/get_image/user/68657543_90x90.png?v=",
"60x60": "https://cdn2.scratch.mit.edu/get_image/user/68657543_60x60.png?v=",
"55x55": "https://cdn2.scratch.mit.edu/get_image/user/68657543_55x55.png?v=",
"50x50": "https://cdn2.scratch.mit.edu/get_image/user/68657543_50x50.png?v=",
"32x32": "https://cdn2.scratch.mit.edu/get_image/user/68657543_32x32.png?v="
},
"status": "...",
"bio": "...",
"country": "United States"
}
},
...
]
|
GET /studios/<studio_id>/activity?dateLimit=<date>
Returns an array of events related to the studio's activity. The dateLimit
is optional: if specified, the response will contain events at least as old as the limit.
- 要求の例
GET https://api.scratch.mit.edu/studios/31659696/activity?dateLimit=2022-07-09T13:35:07.000Z
- 応答の例
Response
|
[
{
"datetime_created": "2022-07-09T13:35:07.000Z",
"id": "removeprojectstudio-16068410",
"actor_id": 79368904,
"project_id": 699062641,
"project_title": "THUNDER STORM || Platformer + Animation || @parthox|| #all #games #art ||",
"type": "removeprojectstudio",
"actor_username": "parthox"
},
{
"datetime_created": "2022-07-09T07:00:25.000Z",
"id": "addprojecttostudio-119328879",
"actor_id": 78545638,
"project_id": 711404463,
"project_title": "⟪Shadow Climb⟫",
"type": "addprojecttostudio",
"actor_username": "sihan666666"
},
...
]
|
Returns an array of comments posted in the studio. Replies are not included in the response, so a separate request needs to be made for each comment with a "reply_count"
greater than 0.
- 要求の例
GET https://api.scratch.mit.edu/studios/5342/comments
- 応答の例
Response
|
[
{
"id": 180043907,
"parent_id": null,
"commentee_id": null,
"content": "Hi",
"datetime_created": "2022-03-28T04:21:41.000Z",
"datetime_modified": "2022-03-28T04:21:41.000Z",
"visibility": "visible",
"author": {
"id": 52550610,
"username": "THEKINGTUCK",
"scratchteam": false,
"image": "https://cdn2.scratch.mit.edu/get_image/user/52550610_60x60.png"
},
"reply_count": 0
},
{
"id": 169074717,
"parent_id": null,
"commentee_id": null,
"content": "Welcome wiki users!",
"datetime_created": "2021-12-13T16:37:27.000Z",
"datetime_modified": "2021-12-13T16:37:27.000Z",
"visibility": "visible",
"author": {
"id": 34254819,
"username": "beanyboy512",
"scratchteam": false,
"image": "https://cdn2.scratch.mit.edu/get_image/user/34254819_60x60.png"
},
"reply_count": 0
},
...
]
|
Returns information about the studio comment.
- 要求の例
GET https://api.scratch.mit.edu/studios/5342/comments/121123167
- 応答の例
Response
|
{
"id": 121123167,
"parent_id": null,
"commentee_id": null,
"content": "Hello random person learning about the scratch api !",
"datetime_created": "2021-01-11T15:27:40.000Z",
"datetime_modified": "2021-01-11T15:27:40.000Z",
"visibility": "visible",
"author": {
"id": 49759421,
"username": "programminguy",
"scratchteam": false,
"image": "https://cdn2.scratch.mit.edu/get_image/user/49759421_60x60.png"
},
"reply_count": 5
}
|
Returns an array of replies to the specified studio comment.
- 要求の例
GET https://api.scratch.mit.edu/studios/5342/comments/121123167/replies
- 応答の例
Response
|
[
{
"id": 164453087,
"parent_id": 121123167,
"commentee_id": 49759421,
"content": "ha I was doing that.",
"datetime_created": "2021-10-22T21:29:23.000Z",
"datetime_modified": "2021-10-22T21:29:23.000Z",
"visibility": "visible",
"author": {
"id": 40018021,
"username": "bluepig600",
"scratchteam": false,
"image": "https://cdn2.scratch.mit.edu/get_image/user/40018021_60x60.png"
},
"reply_count": 0
},
{
"id": 168271657,
"parent_id": 121123167,
"commentee_id": 49759421,
"content": "Hah same!",
"datetime_created": "2021-12-04T07:30:10.000Z",
"datetime_modified": "2021-12-04T07:30:10.000Z",
"visibility": "visible",
"author": {
"id": 86337330,
"username": "Le-Frog",
"scratchteam": false,
"image": "https://cdn2.scratch.mit.edu/get_image/user/86337330_60x60.png"
},
"reply_count": 0
},
...
]
|
Proxy
GET /proxy/featured
Returns information regarding the projects currently visible on the front page of the website.
- 要求の例
GET https://api.scratch.mit.edu/proxy/featured
- 応答の例
Response
|
{
"community_newest_projects":[
{
"thumbnail_url":"//cdn.scratch.mit.edu/static/site/projects/thumbnails/10157/8493.png",
"title":"Take To The Sky- CC ~OPEN~ remix",
"creator":"Sapphire19",
"type":"project",
"id":101578493,
"love_count":0
},
{
"thumbnail_url":"//cdn.scratch.mit.edu/static/site/projects/thumbnails/10157/8191.png",
"title":"Untitled",
"creator":"Sally_Williams-",
"type":"project",
"id":101578191,
"love_count":0
},
...
],
"community_most_remixed_projects":[
{
"title":"Oreo!!!",
"type":"project",
"remixers_count":429,
"love_count":11395,
"thumbnail_url":"//cdn.scratch.mit.edu/static/site/projects/thumbnails/2625/7525.png",
"creator":"FunnyAnimatorJimTV",
"id":26257525
},
...
],
"scratch_design_studio":[
{
"gallery_id":1859165,
"creator":"NaturalmotionStudios",
"remixers_count":0,
"gallery_title":"Remix-A-Thon",
"love_count":8,
"thumbnail_url":"//cdn.scratch.mit.edu/static/site/projects/thumbnails/9805/1641.png",
"title":"My Dream House - SDS",
"type":"project",
"id":98051641
},
...
],
"curator_top_projects":[
{
"title":"Colour Dash! ",
"creator":"enderbrick",
"love_count":30,
"thumbnail_url":"//cdn.scratch.mit.edu/static/site/projects/thumbnails/9647/1680.png",
"curator_name":"Cirrus-",
"type":"project",
"id":96471680
},
...
],
"community_featured_studios":[
{
"thumbnail_url":"//cdn.scratch.mit.edu/static/site/galleries/thumbnails/139/9754.png",
"type":"gallery",
"id":1399754,
"title":"Robots, Androids, and Artificial Intelligence"
},
...
],
"community_most_loved_projects":[
{
"thumbnail_url":"//cdn.scratch.mit.edu/static/site/projects/thumbnails/10022/2418.png",
"title":"Instrument Sprites",
"creator":"ceebee",
"type":"project",
"id":100222418,
"love_count":104
},
...
],
"community_featured_projects":[
{
"thumbnail_url":"//cdn.scratch.mit.edu/static/site/projects/thumbnails/9486/8644.png",
"title":"Cavern | Platformer",
"creator":"Influenzi",
"type":"project",
"id":94868644,
"love_count":334
},
...
]
}
|
Users
GET /users/<username>
Returns information about the specified user.
- 要求の例
GET https://api.scratch.mit.edu/users/mres
- 応答の例
Response
|
{
"id":167,
"username":"mres",
"history":{
"joined":"2007-03-07T03:50:14.000Z"
},
"profile":{
"id":29,
"images":{
"90x90":"https://cdn2.scratch.mit.edu/get_image/user/167_90x90.png?v=",
"60x60":"https://cdn2.scratch.mit.edu/get_image/user/167_60x60.png?v=",
"55x55":"https://cdn2.scratch.mit.edu/get_image/user/167_55x55.png?v=",
"50x50":"https://cdn2.scratch.mit.edu/get_image/user/167_50x50.png?v=",
"32x32":"https://cdn2.scratch.mit.edu/get_image/user/167_32x32.png?v="
},
"status":"...",
"bio":"...",
"country":"United States"
}
}
|
GET /users/<username>/favorites
Returns an array of details regarding the projects that a given user has favourited on the website.
- 要求の例
GET https://api.scratch.mit.edu/users/mres/favorites
- 応答の例
Response
|
[
{
"id":291,
"title":"Collision detection example",
"description":"...",
"instructions":"...",
"history":{
"created":"2007-03-11T21:13:46.000Z",
"modified":"2007-03-11T21:13:46.000Z",
"shared":"2007-03-11T21:13:46.000Z"
},
"stats":{
"views":8567,
"loves":17,
"favorites":10,
"comments":24
}
},
{
"id":495,
"title":"Digital Logic Toolkit",
"description":"...",
"instructions":"...",
"history":{
"created":"2007-03-16T03:45:07.000Z",
"modified":"2007-03-16T03:45:07.000Z",
"shared":"2007-03-16T03:45:07.000Z"
},
"stats":{
"views":739,
"loves":32,
"favorites":25,
"comments":15
}
},
...
]
|
GET /users/<username>/followers
Returns a list of a user's most recent followers.
- 要求の例
GET https://api.scratch.mit.edu/users/mres/followers
- 応答の例
Response
|
[
{
"id":15833514,
"username":"Dylan_Test",
"history":{
"joined":"2016-03-15T12:27:56.000Z"
},
"profile":{
"id":15833514,
"avatar":"1583/3514.png",
"status":"...",
"bio":"...",
"country":"Antarctica"
}
},
{
"id":4149226,
"username":"ILoveGerbils25",
"history":{
"joined":"2014-05-16T23:08:00.000Z"
},
"profile":{
"id":4149226,
"avatar":"414/9226.png",
"status":"...",
"bio":"...",
"country":"United States"
}
},
...
]
|
GET /users/<username>/following
Returns a list of the users that the specified user has most recently followed.
- 要求の例
GET https://api.scratch.mit.edu/users/mres/following
- 応答の例
Response
|
[
{
"id":1197797,
"username":"bubble103",
"history":{
"joined":"2012-02-16T06:26:12.000Z"
},
"profile":{
"id":1197797,
"avatar":"119/7797.png",
"status":"...",
"bio":"...",
"country":"South Africa"
}
},
{
"id":10707222,
"username":"-MarzBarz-",
"history":{
"joined":"2015-06-18T23:00:09.000Z"
},
"profile":{
"id":10707222,
"avatar":"1070/7222.png",
"status":"...",
"bio":"...",
"country":"United States"
}
},
...
]
|
GET /users/<username>/messages/count
This returns the number of unread messages a user currently has. This is what the system looks for showing the message count.
- 要求の例
GET https://api.scratch.mit.edu/users/mres/messages/count
- 応答の例
GET /users/<username>/projects
Returns an array with information regarding the projects that a given user has shared on the Scratch website.
- 要求の例
GET https://api.scratch.mit.edu/users/mres/projects
- 応答の例
Response
|
[
{
"id":142,
"title":"PlayWithYourFace",
"description":"...",
"instructions":"...",
"history":{
"created":"2007-03-07T14:48:22.000Z",
"modified":"2007-03-07T14:48:22.000Z",
"shared":"2007-03-07T14:48:22.000Z"
},
"stats":{
"views":669,
"loves":19,
"favorites":19,
"comments":58
}
},
{
"id":864,
"title":"OceanMusicBox",
"description":"...",
"instructions":"...",
"history":{
"created":"2007-03-28T14:01:50.000Z",
"modified":"2007-03-28T14:01:50.000Z",
"shared":"2007-03-28T14:01:50.000Z"
},
"stats":{
"views":239,
"loves":21,
"favorites":18,
"comments":11
}
},
...
]
|
GET /users/<username>/projects/<project_id>
Returns information relevant to the given project.
- 要求の例
GET https://api.scratch.mit.edu/users/mres/projects/142
- 応答の例
Response
|
{
"id":142,
"title":"PlayWithYourFace",
"description":"...",
"instructions":"...",
"history":{
"created":"2007-03-07T14:48:22.000Z",
"modified":"2007-03-07T14:48:22.000Z",
"shared":"2007-03-07T14:48:22.000Z"
},
"stats":{
"views":669,
"loves":19,
"favorites":19,
"comments":58
}
}
|
GET /users/<username>/projects/<project_id>/studios
Returns an array of studios the project is in.
- 要求の例
GET https://api.scratch.mit.edu/users/mres/projects/142/studios
- 応答の例
Response
|
[
{
"id": 5342,
"title": "MAS714 - Intro Projects-5342",
"host": 167,
"description": "...",
"visibility": "visible",
"public": true,
"open_to_all": false,
"comments_allowed": true,
"image": "https://cdn2.scratch.mit.edu/get_image/gallery/5342_170x100.png",
"history": {
"created": "2008-05-03T17:01:39.000Z",
"modified": "2012-05-11T18:17:00.000Z"
},
"stats": {}
},
{
"id": 16617,
"title": "All projects go here!",
"host": 68887,
"description": "...",
"visibility": "visible",
"public": true,
"open_to_all": false,
"comments_allowed": true,
"image": "https://cdn2.scratch.mit.edu/get_image/gallery/16617_170x100.png",
"history": {
"created": "2008-04-18T08:15:42.000Z",
"modified": "2012-06-03T13:10:35.000Z"
},
"stats": {}
},
...
]
|
Returns an array of comments posted on the project. Replies are not included in the response, so a separate request needs to be made for each comment with a "reply_count"
greater than 0.
- 要求の例
GET https://api.scratch.mit.edu/users/mres/projects/142/comments
- 応答の例
Response
|
[
{
"id": 276455882,
"parent_id": null,
"commentee_id": null,
"content": "yas",
"datetime_created": "2022-06-28T03:37:43.000Z",
"datetime_modified": "2022-06-28T03:37:43.000Z",
"visibility": "visible",
"author": {
"id": 97472616,
"username": "AIYAHNA",
"scratchteam": false,
"image": "https://cdn2.scratch.mit.edu/get_image/user/97472616_60x60.png"
},
"reply_count": 0
},
{
"id": 272303677,
"parent_id": null,
"commentee_id": null,
"content": "Nice! And... erm... made before I was born...",
"datetime_created": "2022-06-02T00:38:43.000Z",
"datetime_modified": "2022-06-02T00:38:43.000Z",
"visibility": "visible",
"author": {
"id": 63496063,
"username": "WarriorsFan999",
"scratchteam": false,
"image": "https://cdn2.scratch.mit.edu/get_image/user/63496063_60x60.png"
},
"reply_count": 1
},
...
]
|
Returns information about the project comment.
- 要求の例
GET https://api.scratch.mit.edu/users/mres/projects/142/comments/272303677
- 応答の例
Response
|
{
"id": 272303677,
"parent_id": null,
"commentee_id": null,
"content": "Nice! And... erm... made before I was born...",
"datetime_created": "2022-06-02T00:38:43.000Z",
"datetime_modified": "2022-06-02T00:38:43.000Z",
"visibility": "visible",
"author": {
"id": 63496063,
"username": "WarriorsFan999",
"scratchteam": false,
"image": "https://cdn2.scratch.mit.edu/get_image/user/63496063_60x60.png"
},
"reply_count": 1
}
|
Returns an array of replies to the specified project comment.
- 要求の例
GET https://api.scratch.mit.edu/users/mres/projects/142/comments/272303677/replies
- 応答の例
Response
|
[
{
"id": 276870346,
"parent_id": 272303677,
"commentee_id": 63496063,
"content": "meh too lol",
"datetime_created": "2022-07-01T02:56:59.000Z",
"datetime_modified": "2022-07-01T02:57:00.000Z",
"visibility": "visible",
"author": {
"id": 66601246,
"username": "HAPPY0412",
"scratchteam": false,
"image": "https://cdn2.scratch.mit.edu/get_image/user/66601246_60x60.png"
},
"reply_count": 0
}
]
|
GET /users/<username>/studios/curate
Returns an array of studios curated by the user.
- 要求の例
GET https://api.scratch.mit.edu/users/mres/studios/curate
- 応答の例
Response
|
[
{
"id": 5342,
"title": "MAS714 - Intro Projects-5342",
"host": 167,
"description": "...",
"visibility": "visible",
"public": true,
"open_to_all": false,
"comments_allowed": true,
"image": "https://cdn2.scratch.mit.edu/get_image/gallery/5342_170x100.png",
"history": {
"created": "2008-05-03T17:01:39.000Z",
"modified": "2012-05-11T18:17:00.000Z"
},
"stats": {}
},
{
"id": 5889,
"title": "MAS.714 Favorites",
"host": 167,
"description": "...",
"visibility": "visible",
"public": true,
"open_to_all": false,
"comments_allowed": true,
"image": "https://cdn2.scratch.mit.edu/get_image/gallery/5889_170x100.png",
"history": {
"created": "2007-09-25T12:36:55.000Z",
"modified": "2008-02-23T01:14:25.000Z"
},
"stats": {}
},
...
]
|
Accounts
GET /accounts/checkusername/<username>
Checks if a username can be registered. The "msg"
property of the response object is "valid username"
if it is available, "invalid username"
if it is too short, too long or contains invalid characters, "username exists"
if it is taken and "bad username"
if it is inappropriate.
- 要求の例
GET https://api.scratch.mit.edu/accounts/checkusername/mres
- 応答の例
Response
|
{
"username": "mres",
"msg": "username exists"
}
|
Explore
GET /explore/projects?q=<query>&mode=<mode>&language=<language_code>
Returns an array of projects displayed on the Projects tab of the Explore page. The query (q
parameter) specifies which keywords to search for. It can be set to *
or omitted to get all projects. The mode can be popular
(default) or trending
. A language code can be specified to prefer results in a certain language.
- 要求の例
GET https://api.scratch.mit.edu/explore/projects?q=games&mode=trending&language=en
- 応答の例
Response
|
[
{
"id": 408410919,
"title": "Classic arcade games",
"description": "...",
"instructions": "...",
"visibility": "notvisible",
"public": false,
"comments_allowed": false,
"is_published": false,
"author": {
"id": 60763959,
"username": "best_friends2",
"scratchteam": false,
"history": {
"joined": "2020-05-21T20:18:54.000Z"
},
"profile": {
"id": null,
"images": {
"90x90": "https://cdn2.scratch.mit.edu/get_image/user/60763959_90x90.png?v=",
"60x60": "https://cdn2.scratch.mit.edu/get_image/user/60763959_60x60.png?v=",
"55x55": "https://cdn2.scratch.mit.edu/get_image/user/60763959_55x55.png?v=",
"50x50": "https://cdn2.scratch.mit.edu/get_image/user/60763959_50x50.png?v=",
"32x32": "https://cdn2.scratch.mit.edu/get_image/user/60763959_32x32.png?v="
}
}
},
"image": "https://cdn2.scratch.mit.edu/get_image/project/408410919_480x360.png",
"images": {
"282x218": "https://cdn2.scratch.mit.edu/get_image/project/408410919_282x218.png?v=1654615007",
"216x163": "https://cdn2.scratch.mit.edu/get_image/project/408410919_216x163.png?v=1654615007",
"200x200": "https://cdn2.scratch.mit.edu/get_image/project/408410919_200x200.png?v=1654615007",
"144x108": "https://cdn2.scratch.mit.edu/get_image/project/408410919_144x108.png?v=1654615007",
"135x102": "https://cdn2.scratch.mit.edu/get_image/project/408410919_135x102.png?v=1654615007",
"100x80": "https://cdn2.scratch.mit.edu/get_image/project/408410919_100x80.png?v=1654615007"
},
"history": {
"created": "2020-06-29T12:05:13.000Z",
"modified": "2022-06-07T15:16:47.000Z",
"shared": "2022-06-07T15:16:47.000Z"
},
"stats": {
"views": 856,
"loves": 27,
"favorites": 23,
"remixes": 0
},
"remix": {
"root": null
}
},
{
"id": 443287357,
"title": "[Forever-Jump] A speedrun platformer #GAMES #ALL #STORIES",
"description": "...",
"instructions": "...",
"visibility": "notvisible",
"public": false,
"comments_allowed": false,
"is_published": false,
"author": {
"id": 65862725,
"username": "-CodingAnimations-",
"scratchteam": false,
"history": {
"joined": "2020-10-25T18:24:48.000Z"
},
"profile": {
"id": null,
"images": {
"90x90": "https://cdn2.scratch.mit.edu/get_image/user/65862725_90x90.png?v=",
"60x60": "https://cdn2.scratch.mit.edu/get_image/user/65862725_60x60.png?v=",
"55x55": "https://cdn2.scratch.mit.edu/get_image/user/65862725_55x55.png?v=",
"50x50": "https://cdn2.scratch.mit.edu/get_image/user/65862725_50x50.png?v=",
"32x32": "https://cdn2.scratch.mit.edu/get_image/user/65862725_32x32.png?v="
}
}
},
"image": "https://cdn2.scratch.mit.edu/get_image/project/443287357_480x360.png",
"images": {
"282x218": "https://cdn2.scratch.mit.edu/get_image/project/443287357_282x218.png?v=1654108120",
"216x163": "https://cdn2.scratch.mit.edu/get_image/project/443287357_216x163.png?v=1654108120",
"200x200": "https://cdn2.scratch.mit.edu/get_image/project/443287357_200x200.png?v=1654108120",
"144x108": "https://cdn2.scratch.mit.edu/get_image/project/443287357_144x108.png?v=1654108120",
"135x102": "https://cdn2.scratch.mit.edu/get_image/project/443287357_135x102.png?v=1654108120",
"100x80": "https://cdn2.scratch.mit.edu/get_image/project/443287357_100x80.png?v=1654108120"
},
"history": {
"created": "2020-10-30T17:04:14.000Z",
"modified": "2022-06-01T18:28:40.000Z",
"shared": "2022-05-29T19:25:37.000Z"
},
"stats": {
"views": 7361,
"loves": 235,
"favorites": 178,
"remixes": 0
},
"remix": {
"root": null
}
},
...
]
|
GET /explore/studios?q=<query>&mode=<mode>&language=<language_code>
Returns an array of studios displayed on the Studios tab of the Explore page. The query (q
parameter) specifies which keywords to search for. It can be set to *
or omitted to get all studios. The mode can be popular
(default) or trending
. A language code can be specified to prefer results in a certain language.
- 要求の例
GET https://api.scratch.mit.edu/explore/studios?q=animations&mode=trending&language=en
- 応答の例
Response
|
[
{
"id": 30862185,
"title": " -Animations-",
"host": 87536920,
"description": "...",
"visibility": "notvisible",
"public": false,
"open_to_all": false,
"comments_allowed": false,
"image": "https://cdn2.scratch.mit.edu/get_image/gallery/30862185_170x100.png",
"history": {
"created": "2022-01-03T08:58:13.000Z",
"modified": "2022-04-22T06:24:01.000Z"
},
"stats": {}
},
{
"id": 30967042,
"title": "Best Animators Of 2022",
"host": 54434902,
"description": "...",
"visibility": "notvisible",
"public": false,
"open_to_all": true,
"comments_allowed": false,
"image": "https://cdn2.scratch.mit.edu/get_image/gallery/30967042_170x100.png",
"history": {
"created": "2022-01-22T23:44:36.000Z",
"modified": "2022-05-26T13:17:20.000Z"
},
"stats": {}
},
...
]
|
Search
GET /search/projects?q=<query>&mode=<mode>&language=<language_code>
Searches for projects that match the query (q
parameter). The mode can be popular
(default) or trending
. A language code can be specified but it does not affect the results.テンプレート:Cn
- 要求の例
GET https://api.scratch.mit.edu/search/projects?q=scratch%203.0&mode=popular&language=en
- 応答の例
Response
|
[
{
"id": 276660763,
"title": "Scratch 3.0 is here!",
"description": "...",
"instructions": "...",
"visibility": "notvisible",
"public": false,
"comments_allowed": false,
"is_published": false,
"author": {
"id": 15883188,
"username": "ScratchCat",
"scratchteam": false,
"history": {
"joined": "2007-03-05T00:00:00.000Z"
},
"profile": {
"id": null,
"images": {
"90x90": "https://cdn2.scratch.mit.edu/get_image/user/15883188_90x90.png?v=",
"60x60": "https://cdn2.scratch.mit.edu/get_image/user/15883188_60x60.png?v=",
"55x55": "https://cdn2.scratch.mit.edu/get_image/user/15883188_55x55.png?v=",
"50x50": "https://cdn2.scratch.mit.edu/get_image/user/15883188_50x50.png?v=",
"32x32": "https://cdn2.scratch.mit.edu/get_image/user/15883188_32x32.png?v="
}
}
},
"image": "https://cdn2.scratch.mit.edu/get_image/project/276660763_480x360.png",
"images": {
"282x218": "https://cdn2.scratch.mit.edu/get_image/project/276660763_282x218.png?v=1546613339",
"216x163": "https://cdn2.scratch.mit.edu/get_image/project/276660763_216x163.png?v=1546613339",
"200x200": "https://cdn2.scratch.mit.edu/get_image/project/276660763_200x200.png?v=1546613339",
"144x108": "https://cdn2.scratch.mit.edu/get_image/project/276660763_144x108.png?v=1546613339",
"135x102": "https://cdn2.scratch.mit.edu/get_image/project/276660763_135x102.png?v=1546613339",
"100x80": "https://cdn2.scratch.mit.edu/get_image/project/276660763_100x80.png?v=1546613339"
},
"history": {
"created": "2019-01-02T19:26:00.000Z",
"modified": "2019-01-04T14:48:59.000Z",
"shared": "2019-01-02T19:42:07.000Z"
},
"stats": {
"views": 133580,
"loves": 5269,
"favorites": 4000,
"remixes": 0
},
"remix": {
"root": null
}
},
{
"id": 109686323,
"title": "Shaper [Broken by Scratch 3.0, see desc.]",
"description": "...",
"instructions": "...",
"visibility": "notvisible",
"public": false,
"comments_allowed": false,
"is_published": false,
"author": {
"id": 2197903,
"username": "Nitttram",
"scratchteam": false,
"history": {
"joined": "2013-03-03T06:44:26.000Z"
},
"profile": {
"id": null,
"images": {
"90x90": "https://cdn2.scratch.mit.edu/get_image/user/2197903_90x90.png?v=",
"60x60": "https://cdn2.scratch.mit.edu/get_image/user/2197903_60x60.png?v=",
"55x55": "https://cdn2.scratch.mit.edu/get_image/user/2197903_55x55.png?v=",
"50x50": "https://cdn2.scratch.mit.edu/get_image/user/2197903_50x50.png?v=",
"32x32": "https://cdn2.scratch.mit.edu/get_image/user/2197903_32x32.png?v="
}
}
},
"image": "https://cdn2.scratch.mit.edu/get_image/project/109686323_480x360.png",
"images": {
"282x218": "https://cdn2.scratch.mit.edu/get_image/project/109686323_282x218.png?v=1602445178",
"216x163": "https://cdn2.scratch.mit.edu/get_image/project/109686323_216x163.png?v=1602445178",
"200x200": "https://cdn2.scratch.mit.edu/get_image/project/109686323_200x200.png?v=1602445178",
"144x108": "https://cdn2.scratch.mit.edu/get_image/project/109686323_144x108.png?v=1602445178",
"135x102": "https://cdn2.scratch.mit.edu/get_image/project/109686323_135x102.png?v=1602445178",
"100x80": "https://cdn2.scratch.mit.edu/get_image/project/109686323_100x80.png?v=1602445178"
},
"history": {
"created": "2016-05-14T16:24:46.000Z",
"modified": "2020-10-11T19:39:38.000Z",
"shared": "2016-05-14T17:57:16.000Z"
},
"stats": {
"views": 131980,
"loves": 6455,
"favorites": 5555,
"remixes": 0
},
"remix": {
"root": null
}
},
...
]
|
GET /search/studios?q=<query>&mode=<mode>&language=<language_code>
Searches for studios that match the query (q
parameter). The mode can be popular
(default) or trending
. A language code can be specified but it does not affect the results.テンプレート:Cn
- 要求の例
GET https://api.scratch.mit.edu/search/studios?q=scratch%20welcoming%20committee&mode=popular&language=en
- 応答の例
Response
|
[
{
"id": 146521,
"title": "Scratch Welcoming Committee!",
"host": 11655,
"description": "...",
"visibility": "notvisible",
"public": false,
"open_to_all": false,
"comments_allowed": true,
"image": "https://cdn2.scratch.mit.edu/get_image/gallery/146521_170x100.png",
"history": {
"created": "2011-12-07T14:42:45.000Z",
"modified": "2019-11-20T19:30:02.000Z"
},
"stats": {}
},
...
]
|
Removed endpoints
GET /proxy/users/<user_id>/featured
Returned information regarding the Projects by Scratchers I'm Following, Projects Loved by Scratchers I'm Following and Projects in Studios I'm Following rows on the Front Page. Each row now has its own API endpoint.
- 要求の例
GET https://api.scratch.mit.edu/proxy/users/167/featured
- 応答の例
Response
|
{
"custom_projects_by_following":[
{
"title":"Justify",
"type":"project",
"remixers_count":"0",
"love_count":"17",
"thumbnail_url":"//cdn.scratch.mit.edu/static/site/projects/thumbnails/10012/2918.png",
"creator":"NickyNouse",
"id":"100122918"
},
{
"title":"Cosmic Narwhal ",
"type":"project",
"remixers_count":"0",
"love_count":"10",
"thumbnail_url":"//cdn.scratch.mit.edu/static/site/projects/thumbnails/10090/1960.png",
"creator":"petrichord",
"id":"100901960"
},
...
],
"custom_projects_in_studios_following":[
{
"thumbnail_url":"//cdn.scratch.mit.edu/static/site/projects/thumbnails/10098/9479.png",
"title":"Life",
"creator":"Shoujo-ai",
"type":"project",
"id":"100989479",
"love_count":"22"
},
...
],
"custom_projects_loved_by_following":[
{
"creator":"Meap77",
"remixers_count":"32",
"love_count":"1099",
"thumbnail_url":"//cdn.scratch.mit.edu/static/site/projects/thumbnails/9530/1826.png",
"title":"Can You Remember? (the game)",
"type":"project",
"id":"95301826"
},
...
]
}
|
GET /proxy/users/<username>/activity
Returned information regarding the "What's Happening?" section of the homepage for a given user. Moved to /users/<username>/following/users/activity
.
- 要求の例
GET https://api.scratch.mit.edu/proxy/users/mres/activity
- 応答の例
Response
|
[
{
"obj_id":100736613,
"datetime_created":"2016-03-14T12:09:49",
"actor":{
"username":"ceebee",
"pk":2755634,
"thumbnail_url":"//cdn.scratch.mit.edu/static/site/users/avatars/275/5634.png",
"admin":true
},
"pk":227790976,
"message":"\nfavorited\n <a href=\"/projects/100736613/\">I'm A Cat AMV</a>",
"extra_data":{
"project_title":"I'm A Cat AMV"
},
"type":3
},
{
"obj_id":100736613,
"datetime_created":"2016-03-14T12:09:49",
"actor":{
"username":"ceebee",
"pk":2755634,
"thumbnail_url":"//cdn.scratch.mit.edu/static/site/users/avatars/275/5634.png",
"admin":true
},
"pk":227790975,
"message":"\nloved\n <a href=\"/projects/100736613/\">I'm A Cat AMV</a>",
"extra_data":{
"project_title":"I'm A Cat AMV"
},
"type":2
},
{
"obj_id":101537695,
"datetime_created":"2016-03-14T07:13:36",
"actor":{
"username":"ericr",
"pk":159,
"thumbnail_url":"//cdn.scratch.mit.edu/static/site/users/avatars/0/0159.png",
"admin":false
},
"pk":227767012,
"message":"\nshared the project \n <a href=\"/projects/101537695/\" data-tag=\"object\">a little band</a>",
"extra_data":{
"project_title":"a little band"
},
"type":10
},
{
"obj_id":13182467,
"datetime_created":"2016-03-14T04:33:18",
"actor":{
"username":"ericr",
"pk":159,
"thumbnail_url":"//cdn.scratch.mit.edu/static/site/users/avatars/0/0159.png",
"admin":false
},
"pk":227757062,
"message":"\nis now following\n <a href=\"/users/juanneco/\">juanneco</a>",
"extra_data":{
"followee_username":"juanneco"
},
"type":0
},
...
]
|
GET /proxy/users/<username>/activity/count
Was used to return the number of unread messages a user currently has. Moved to /users/<username>/messages/count
.
- 要求の例
GET https://api.scratch.mit.edu/proxy/users/mres/activity/count
- 応答の例
Response
|
{
"msg_count":12
}
|
April Fools' Day, 2018
As an easter egg for April Fools' Day 2018, a counter endpoint was added.
POST /surprise
Increments the counter and returns its current value.
- 要求の例
POST https://api.scratch.mit.edu/surprise
- 応答の例
Response
|
{
"surprise":63064
}
|
GET /surprise
Returns the counter's current value. This is cached on the server, and so might return an earlier value.
- 要求の例
GET https://api.scratch.mit.edu/surprise
- 応答の例
Response
|
{
"surprise":63064
}
|
site-api Interface (Deprecated)
The site-api is a legacy interface which was officially deprecated on 25 October 2015, as announced by Scratch Team member, thisandagain.テンプレート:Cite post It is still available though, and is used by some parts of the Scratch website. This API can be accessed via the following URL:
https://scratch.mit.edu/site-api/
Returns the comments on a studio in the form of raw HTML.
- 要求の例
GET https://scratch.mit.edu/site-api/comments/gallery/5342/
- 応答の例
Response
|
(no response available)
|
Returns the comments on a project in the form of raw HTML.
- 要求の例
GET https://scratch.mit.edu/site-api/comments/project/142/
- 応答の例
Response
|
(no response available)
|
Returns the comments on a given user's profile in the form of raw HTML.
- 要求の例
GET https://scratch.mit.edu/site-api/comments/user/mres/
- 応答の例
Response
|
(no response available)
|
These are the request headers which may be filled out.
Host:
User-Agent:
Accept:
Accept-Language:
Accept-Encoding:
Content-Type:
X-CSRFToken:
X-Requested-With:
Referer:
Content-Length:
Cookie:
Connection:
varserver Interface (Removed)
テンプレート:Obsolete feature
The varserver API could be utilised to request the values of cloud variables in projects. This API could be accessed via the following URL. It is no longer available, and future requests will return 404 errors.テンプレート:Cite postテンプレート:Dead link
https://scratch.mit.edu/varserver/
GET /<project_id>
Returned information regarding the cloud data of a given project.
- 要求の例
GET https://scratch.mit.edu/varserver/10080213
- 応答の例
Response
|
{
"variables":[
{
"name":"☁ Scratch Cat",
"value":"2"
},
{
"name":"☁ Tera",
"value":"6"
},
{
"name":"☁ Gobo",
"value":"1"
}
],
"lists":[
]
}
|
api/v1 Interface (Removed)
テンプレート:Obsolete feature
As of 23 April 2018, the API v1 interface no longer exists queries to this path are immediately met with HTTP 403 errors.
The API v1 interface is a legacy interface which was originally built during the development of Scratch 2.0. It was accessed via the following URL.
https://scratch.mit.edu/api/v1/
GET /
The root of the API v1 interface provides basic information regarding the API.
- 要求の例
GET https://scratch.mit.edu/api/v1/
- 応答の例
Response
|
{
"project":{
"list_endpoint":"/api/v1/project/",
"schema":"/api/v1/project/schema/"
},
"projecttag":{
"list_endpoint":"/api/v1/projecttag/",
"schema":"/api/v1/projecttag/schema/"
},
"tag":{
"list_endpoint":"/api/v1/tag/",
"schema":"/api/v1/tag/schema/"
},
"user":{
"list_endpoint":"/api/v1/user/",
"schema":"/api/v1/user/schema/"
}
}
|
Projects
GET /project/<project_id>/
Returns information regarding a project and its author.
- 要求の例
GET https://scratch.mit.edu/api/v1/project/142/
- 応答の例
Response
|
{
"creator":{
"username":"mres",
"userprofile":{
"bio":"...",
"country":"United States",
"status":"..."
}
},
"datetime_shared":"2007-03-07T14:48:22",
"description":"...",
"favorite_count":"19",
"id":142,
"love_count":"19",
"resource_uri":"/api/v1/project/142/",
"thumbnail":"//cdn.scratch.mit.edu/static/site/projects/thumbnails/0/0142.png",
"title":"PlayWithYourFace",
"view_count":"669"
}
|
GET /project/set/<project_ids>/
Returns information regarding a set of projects and their authors. Project IDs are separated with a semicolon.
- 要求の例
GET https://scratch.mit.edu/api/v1/project/set/142;864/
- 応答の例
Response
|
{
"objects":[
{
"creator":{
"username":"mres",
"userprofile":{
"bio":"...",
"country":"United States",
"status":"..."
}
},
"datetime_shared":"2007-03-07T14:48:22",
"description":"...",
"favorite_count":"19",
"id":142,
"love_count":"19",
"resource_uri":"/api/v1/project/142/",
"thumbnail":"//cdn.scratch.mit.edu/static/site/projects/thumbnails/0/0142.png",
"title":"PlayWithYourFace",
"view_count":"669"
},
{
"creator":{
"username":"mres",
"userprofile":{
"bio":"...",
"country":"United States",
"status":"..."
}
},
"datetime_shared":"2007-03-28T14:01:50",
"description":"...",
"favorite_count":"18",
"id":864,
"love_count":"21",
"resource_uri":"/api/v1/project/864/",
"thumbnail":"//cdn.scratch.mit.edu/static/site/projects/thumbnails/0/0864.png",
"title":"OceanMusicBox",
"view_count":"239"
}
]
}
|
Users
GET /user/<username>/
Returns information regarding the given user.
- 要求の例
GET https://scratch.mit.edu/api/v1/user/mres/
- 応答の例
Response
|
{
"username":"mres",
"userprofile":{
"bio":"...",
"country":"United States",
"status":"..."
}
}
|
GET /user/set/<usernames>/
Returns information regarding the given users. Names should be separated with semicolons. The "userprofile" value for each user object is currently empty making this feature of the API effectively useless. One should note that the single user feature remains functional.
- 要求の例
GET https://scratch.mit.edu/api/v1/user/set/mres;ScratchCat/
- 応答の例
Response
|
{
"objects":[
{
"username":"mres",
"userprofile":""
},
{
"username":"ScratchCat",
"userprofile":""
}
]
}
|
関連項目
External Links
テンプレート:External Programs
出典