提供: Japanese Scratch-Wiki

(GET /users//studios/curate/)
 
(7人の利用者による、間の27版が非表示)
1行目: 1行目:
{{外部リンク}}[[en:Scratch API (2.0)]][[カテゴリ:Scratchウェブサイト]]{{stub}}[[カテゴリ:Scratch 2.0]]
+
{{for3/o}}
Scratch APIを使うと、[[Scratch]]に関するさまざまなデータが取得できます。
+
{{stub}}
 +
{{Update3.0}}
 +
{{ひらがなヘッダ}}
 +
Scratch APIを使うと、[[Scratch]]に関するさまざまなデータが取得できる。
 +
 
 +
各項目の「リクエスト例」のURLへアクセスすることで実際に試す事ができる。
 +
 
 +
== パラメーター ==
 +
* 一覧を返すJSON APIにおいて、<code>?limit=数字</code>にて、個数制限ができる。
 +
* 一部のAPIは、<code>?offset=数字</code>にて、範囲指定ができる。
 +
 
 +
{{Note|実際に帰ってくるコードはインデントなどの成型はされていない。}}
  
 
== api.scratch.mit.edu ==
 
== api.scratch.mit.edu ==
api.scratch.mit.eduは、最新のScratch APIです。このAPIのURLは次の通りです:
+
api.scratch.mit.eduは、最新のScratch APIである。このAPIのURLは次の通り:
 
{{テキストボックス|<nowiki>https://api.scratch.mit.edu</nowiki>|code}}
 
{{テキストボックス|<nowiki>https://api.scratch.mit.edu</nowiki>|code}}
 
=== GET /===
 
=== GET /===
9行目: 20行目:
 
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu</nowiki>|code}}
 
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu</nowiki>|code}}
 
'''応答例'''
 
'''応答例'''
{{テキストボックス|<nowiki>{"website":"scratch.mit.edu","api":"api.scratch.mit.edu","help":"help@scratch.mit.edu"}</nowiki>|code}}
+
<syntaxhighlight lang="json" inline>{"website":"scratch.mit.edu","api":"api.scratch.mit.edu","help":"help@scratch.mit.edu"}</syntaxhighlight>
  
 
=== サーバーの状態 ===
 
=== サーバーの状態 ===
 
==== GET /health ====
 
==== GET /health ====
 +
Scratchのサーバーの状態を返す。
 +
 
'''リクエスト例'''
 
'''リクエスト例'''
 
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/health</nowiki>|code}}
 
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/health</nowiki>|code}}
 
'''応答例'''
 
'''応答例'''
{{テキストボックス|<pre>{
+
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="json">{
 
   "version": "682c409583cb3f06e855ce1c163cd2f1e1cd1406",
 
   "version": "682c409583cb3f06e855ce1c163cd2f1e1cd1406",
 
   "uptime": 18634934,
 
   "uptime": 18634934,
31行目: 45行目:
 
     "ready": true
 
     "ready": true
 
   }
 
   }
}</pre>|code}}
+
}</syntaxhighlight>
 +
{{collapse bottom}}
 
=== ニュース ===
 
=== ニュース ===
 
==== GET /news ====
 
==== GET /news ====
 +
[[トップページ]]の[[Scratchニュース]]の情報を返す。
 +
 
'''リクエスト例'''
 
'''リクエスト例'''
 
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/news</nowiki>|code}}
 
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/news</nowiki>|code}}
 
'''応答例'''
 
'''応答例'''
{{テキストボックス|<pre>[
+
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="json">[
 
   {
 
   {
 
     "id": 160769150358,
 
     "id": 160769150358,
55行目: 73行目:
 
   },
 
   },
 
   ...
 
   ...
]</pre>|code}}
+
]</syntaxhighlight>
=== [[プロジェクト]] ===
+
{{collapse bottom}}
 +
 
 
==== GET /projects/count/all ====
 
==== GET /projects/count/all ====
 +
共有されているプロジェクトの総数を返す。
 +
 
'''リクエスト例'''
 
'''リクエスト例'''
 
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/projects/count/all</nowiki>|code}}
 
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/projects/count/all</nowiki>|code}}
 
'''応答例'''
 
'''応答例'''
{{テキストボックス|<nowiki>{"count":22850560}</nowiki>|code}}
+
<syntaxhighlight lang="json" inline>{"count":22850560}</syntaxhighlight>
 +
 
 +
=== プロキシ ===
 +
==== GET /proxy/featured ====
 +
[[トップページ]]に表示されているプロジェクトの情報を返す。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/proxy/featured</nowiki>|code}}
 +
'''応答例'''
 +
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="json">
 +
{
 +
    "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
 +
        },
 +
        ...
 +
    ]
 +
}
 +
</syntaxhighlight>
 +
{{collapse bottom}}
 +
 
 +
==== GET /proxy/users/<username>/activity ====
 +
[[プロフィールページ]]の「私が行ったこと」セクションの内容を返す。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/proxy/users/abee/activity</nowiki>|code}}
 +
'''応答例'''
 +
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="json">
 +
[
 +
  {
 +
    "project_title": "Scratchの大型アプデについて",
 +
    "actor": {
 +
      "username": "happy-happy2",
 +
      "pk": 13893342,
 +
      "thumbnail_url": "//uploads.scratch.mit.edu/users/avatars/13893342.png",
 +
      "admin": false
 +
    },
 +
    "project": 196556683,
 +
    "project_creator": {
 +
      "username": "rn-m-rn",
 +
      "pk": 26093807,
 +
      "thumbnail_url": "//uploads.scratch.mit.edu/users/avatars/26093807.png",
 +
      "admin": false
 +
    },
 +
    "datetime_created": "2018-02-10T08:34:18",
 +
    "message": "\nお気に入り\n  <a href=\"/projects/196556683/\">Scratchの大型アプデについて</a>",
 +
    "type": 3
 +
  },
 +
  {
 +
    "title": "Scratchの大型アプデについて",
 +
    "recipient": {
 +
      "username": "rn-m-rn",
 +
      "pk": 26093807,
 +
      "thumbnail_url": "//uploads.scratch.mit.edu/users/avatars/26093807.png",
 +
      "admin": false
 +
    },
 +
    "actor": {
 +
      "username": "happy-happy2",
 +
      "pk": 13893342,
 +
      "thumbnail_url": "//uploads.scratch.mit.edu/users/avatars/13893342.png",
 +
      "admin": false
 +
    },
 +
    "project": 196556683,
 +
    "datetime_created": "2018-02-10T08:34:18",
 +
    "message": "\n好き\n    <a href=\"/projects/196556683/\">Scratchの大型アプデについて</a>",
 +
    "type": 2
 +
  },
 +
  {
 +
    "actor": {
 +
      "username": "mucchi110",
 +
      "pk": 11220260,
 +
      "thumbnail_url": "//uploads.scratch.mit.edu/users/avatars/11220260.png",
 +
      "admin": false
 +
    },
 +
    "datetime_created": "2018-02-10T08:33:38",
 +
    "followed_user": {
 +
      "username": "kasaha",
 +
      "pk": 20995851,
 +
      "thumbnail_url": "//uploads.scratch.mit.edu/users/avatars/20995851.png",
 +
      "admin": false
 +
    },
 +
    "message": "\nフォローしている\n    <a href=\"/users/kasaha/\">kasaha</a>",
 +
    "type": 0,
 +
    "followed_username": "kasaha"
 +
  }
 +
  ...
 +
]</syntaxhighlight>
 +
{{collapse bottom}}
 +
 
 +
==== GET /proxy/users/<username>/activity/count (廃止) ====
 +
未読メッセージの個数を返す。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/proxy/users/Paddle2See/activity/count</nowiki>|code}}
 +
'''応答例'''
 +
<syntaxhighlight lang="json">
 +
{
 +
  "msg_count": 14
 +
}
 +
</syntaxhighlight>
 +
 
 +
=== ユーザー ===
 +
==== GET /users/<username> ====
 +
ユーザーのアカウント情報を返す。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/users/apple502j</nowiki>|code}}
 +
'''応答例'''
 +
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="json">
 +
{
 +
  "id": 10817178,
 +
  "username": "apple502j",
 +
  "history": {
 +
    "joined": "2015-06-26T22:47:57.000Z"
 +
  },
 +
  "profile": {
 +
    "id": 9986108,
 +
    "images": {
 +
      "90x90": "https://cdn2.scratch.mit.edu/get_image/user/10817178_90x90.png?v=",
 +
      "60x60": "https://cdn2.scratch.mit.edu/get_image/user/10817178_60x60.png?v=",
 +
      "55x55": "https://cdn2.scratch.mit.edu/get_image/user/10817178_55x55.png?v=",
 +
      "50x50": "https://cdn2.scratch.mit.edu/get_image/user/10817178_50x50.png?v=",
 +
      "32x32": "https://cdn2.scratch.mit.edu/get_image/user/10817178_32x32.png?v="
 +
    },
 +
    "status": "・Scratch Wiki JP SYSOP& Create a projects\n・GitHub \n・Scratch mod\n\n\n",
 +
    "bio": "My icon is by me.\n\nDon't eat apple502j!\n(I have been eaten many times.)\nMy sister's account @banana302\nSub @apple502j_sub",
 +
    "country": "Japan"
 +
  }
 +
}</syntaxhighlight>
 +
{{collapse bottom}}
 +
 
 +
==== GET /users/<username>/favorites ====
 +
「[[お気に入り]]」を押したプロジェクトの詳細を配列で返す。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/users/ScratchCat/favorites</nowiki>|code}}
 +
'''応答例'''
 +
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="json">
 +
[
 +
  {
 +
    "id": 103776594,
 +
    "title": "Scratch Cat Explores The World",
 +
    "description": "EDIT 3 MANY YEARS LATER)\nsuprise attack comments are alive again >:)\n\nEDIT 2: If you want to remix this, Please read this first. https://scratch.mit.edu/projects/103776594/\n\nEDIT: OH MY GOD, i log back on after an hour and HOLY POPATO OVER 1000 MESSAGES\n*head explodes*\nThank you all so much for this!!\n\nI decided to make a project about the famous kitty, Scratch Cat!\n\nI hope you all like it :)\nFeel free to remix and add scratch cat going to even MORE places\nBut, please credit me if you do remix it :P\n\n-x- Credits -x-\nWalking Cat Sprite - @griffpatch\nOther Cat Sprites - @ScratchCat\nScripting - @Dreampelt\nSong (Monody) - TheFatRat",
 +
    "instructions": "",
 +
    "author": {
 +
      "id": 11282880
 +
    },
 +
    "image": "https://uploads.scratch.mit.edu/projects/thumbnails/103776594.png",
 +
    "history": {
 +
      "created": "2016-04-01T16:00:43.000Z",
 +
      "modified": "2017-09-19T23:59:23.000Z",
 +
      "shared": "2016-04-01T17:20:18.000Z"
 +
    },
 +
    "stats": {
 +
      "views": 87108,
 +
      "loves": 6857,
 +
      "favorites": 5420,
 +
      "comments": 1076
 +
    },
 +
    "remix": {
 +
      "parent": null,
 +
      "root": null
 +
    }
 +
  }
 +
]</syntaxhighlight>
 +
{{collapse bottom}}
 +
 
 +
==== GET /users/<username>/followers ====
 +
ユーザーの最新のフォロワーの配列を返す。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/users/thisandagain/followers</nowiki>|code}}
 +
'''応答例'''
 +
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="json">
 +
[
 +
  {
 +
    "id": 18521501,
 +
    "username": "Scooby-Doo-Lover",
 +
    "history": {
 +
      "joined": "2016-09-26T10:24:49.000Z"
 +
    },
 +
    "profile": {
 +
      "id": 18521501,
 +
      "images": {
 +
        "90x90": "https://cdn2.scratch.mit.edu/get_image/user/18521501_90x90.png?v=",
 +
        "60x60": "https://cdn2.scratch.mit.edu/get_image/user/18521501_60x60.png?v=",
 +
        "55x55": "https://cdn2.scratch.mit.edu/get_image/user/18521501_55x55.png?v=",
 +
        "50x50": "https://cdn2.scratch.mit.edu/get_image/user/18521501_50x50.png?v=",
 +
        "32x32": "https://cdn2.scratch.mit.edu/get_image/user/18521501_32x32.png?v="
 +
      },
 +
      "status": "bof......",
 +
      "bio": "Hi I'm @Scooby-Doo-Lover but you can call me Scooby Doo, Scooby or Scoob (XD Scoob-adive!)\n\nThank you to @StrawberrySwirlinc for the AWESOME profile pic!\n\nI might to F4F if you insist.\nI love plush :3",
 +
      "country": "Australia"
 +
    }
 +
  },
 +
  {
 +
    "id": 22078175,
 +
    "username": "kyse",
 +
    "history": {
 +
      "joined": "2017-03-09T15:36:41.000Z"
 +
    },
 +
    "profile": {
 +
      "id": 22078175,
 +
      "images": {
 +
        "90x90": "https://cdn2.scratch.mit.edu/get_image/user/22078175_90x90.png?v=",
 +
        "60x60": "https://cdn2.scratch.mit.edu/get_image/user/22078175_60x60.png?v=",
 +
        "55x55": "https://cdn2.scratch.mit.edu/get_image/user/22078175_55x55.png?v=",
 +
        "50x50": "https://cdn2.scratch.mit.edu/get_image/user/22078175_50x50.png?v=",
 +
        "32x32": "https://cdn2.scratch.mit.edu/get_image/user/22078175_32x32.png?v="
 +
      },
 +
      "status": "Who ever is my 100th follower gets a prize. Congrats to RBdancer for being my 50th follower she got a prize. Lets see who is my 100th follower. Turns out I'm not leaving scratch. ",
 +
      "bio": " I  will always do f4f. I love LOINEL MESSi. Check out these scratchers @scratchcat74 KS89797 falzatari and GB2630 and yogi2016.",
 +
      "country": "United States"
 +
    }
 +
  },
 +
  {
 +
    "id": 28268895,
 +
    "username": "AK384762",
 +
    "history": {
 +
      "joined": "2017-12-12T15:38:50.000Z"
 +
    },
 +
    "profile": {
 +
      "id": 28268895,
 +
      "images": {
 +
        "90x90": "https://cdn2.scratch.mit.edu/get_image/user/28268895_90x90.png?v=",
 +
        "60x60": "https://cdn2.scratch.mit.edu/get_image/user/28268895_60x60.png?v=",
 +
        "55x55": "https://cdn2.scratch.mit.edu/get_image/user/28268895_55x55.png?v=",
 +
        "50x50": "https://cdn2.scratch.mit.edu/get_image/user/28268895_50x50.png?v=",
 +
        "32x32": "https://cdn2.scratch.mit.edu/get_image/user/28268895_32x32.png?v="
 +
      },
 +
      "status": "everthing100%\n",
 +
      "bio": "Troll face \n",
 +
      "country": "United States"
 +
    }
 +
  },
 +
  {
 +
    "id": 19156050,
 +
    "username": "sandropenner",
 +
    "history": {
 +
      "joined": "2016-10-24T17:41:09.000Z"
 +
    },
 +
    "profile": {
 +
      "id": 19156050,
 +
      "images": {
 +
        "90x90": "https://cdn2.scratch.mit.edu/get_image/user/19156050_90x90.png?v=",
 +
        "60x60": "https://cdn2.scratch.mit.edu/get_image/user/19156050_60x60.png?v=",
 +
        "55x55": "https://cdn2.scratch.mit.edu/get_image/user/19156050_55x55.png?v=",
 +
        "50x50": "https://cdn2.scratch.mit.edu/get_image/user/19156050_50x50.png?v=",
 +
        "32x32": "https://cdn2.scratch.mit.edu/get_image/user/19156050_32x32.png?v="
 +
      },
 +
      "status": "Dog-Man Game ------------------------------------------------->\n",
 +
      "bio": "i like coding\ni am a male\ni am 14 \ni have 11 followers looking for more (*wink, wink)\nbtw I do f4f",
 +
      "country": "Canada"
 +
    }
 +
  },
 +
  ...
 +
]</syntaxhighlight>
 +
{{collapse bottom}}
 +
 
 +
==== GET /users/<username>/following ====
 +
ユーザーがフォローしているユーザーのうち、直近5件を配列で返す。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/users/Paddle2See/following</nowiki>|code}}
 +
'''応答例'''
 +
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="json">
 +
[
 +
  {
 +
    "id": 26249744,
 +
    "username": "GulpTea",
 +
    "history": {
 +
      "joined": "2017-10-06T14:07:50.000Z"
 +
    },
 +
    "profile": {
 +
      "id": 26249744,
 +
      "images": {
 +
        "90x90": "https://cdn2.scratch.mit.edu/get_image/user/26249744_90x90.png?v=",
 +
        "60x60": "https://cdn2.scratch.mit.edu/get_image/user/26249744_60x60.png?v=",
 +
        "55x55": "https://cdn2.scratch.mit.edu/get_image/user/26249744_55x55.png?v=",
 +
        "50x50": "https://cdn2.scratch.mit.edu/get_image/user/26249744_50x50.png?v=",
 +
        "32x32": "https://cdn2.scratch.mit.edu/get_image/user/26249744_32x32.png?v="
 +
      },
 +
      "status": "Moderating!\n\n@bigpuppy made my icon, thank you!\n_B)_",
 +
      "bio": "Hi there!\nI'm a moderator for Scratch located in Canada.\n\nI'm a Christian, and I enjoy programming while listening to jazz and drinking tea!",
 +
      "country": "Canada"
 +
    }
 +
  },
 +
  {
 +
    "id": 6777752,
 +
    "username": "PutneyCat",
 +
    "history": {
 +
      "joined": "2014-12-31T16:17:24.000Z"
 +
    },
 +
    "profile": {
 +
      "id": 6777752,
 +
      "images": {
 +
        "90x90": "https://cdn2.scratch.mit.edu/get_image/user/6777752_90x90.png?v=",
 +
        "60x60": "https://cdn2.scratch.mit.edu/get_image/user/6777752_60x60.png?v=",
 +
        "55x55": "https://cdn2.scratch.mit.edu/get_image/user/6777752_55x55.png?v=",
 +
        "50x50": "https://cdn2.scratch.mit.edu/get_image/user/6777752_50x50.png?v=",
 +
        "32x32": "https://cdn2.scratch.mit.edu/get_image/user/6777752_32x32.png?v="
 +
      },
 +
      "status": "",
 +
      "bio": "Hello, this is PutneyCat. This was a shared daughter-father account (and we still do scratch together) but now we have our own accounts and father (lawyer hooked on scratch) uses this one.",
 +
      "country": "United Kingdom"
 +
    }
 +
  },
 +
  {
 +
    "id": 24137617,
 +
    "username": "dietbacon",
 +
    "history": {
 +
      "joined": "2017-05-30T16:46:03.000Z"
 +
    },
 +
    "profile": {
 +
      "id": 24137617,
 +
      "images": {
 +
        "90x90": "https://cdn2.scratch.mit.edu/get_image/user/24137617_90x90.png?v=",
 +
        "60x60": "https://cdn2.scratch.mit.edu/get_image/user/24137617_60x60.png?v=",
 +
        "55x55": "https://cdn2.scratch.mit.edu/get_image/user/24137617_55x55.png?v=",
 +
        "50x50": "https://cdn2.scratch.mit.edu/get_image/user/24137617_50x50.png?v=",
 +
        "32x32": "https://cdn2.scratch.mit.edu/get_image/user/24137617_32x32.png?v="
 +
      },
 +
      "status": "",
 +
      "bio": "",
 +
      "country": "United States"
 +
    }
 +
  },
 +
  {
 +
    "id": 5509488,
 +
    "username": "P444",
 +
    "history": {
 +
      "joined": "2014-10-31T08:48:21.000Z"
 +
    },
 +
    "profile": {
 +
      "id": 5509488,
 +
      "images": {
 +
        "90x90": "https://cdn2.scratch.mit.edu/get_image/user/5509488_90x90.png?v=",
 +
        "60x60": "https://cdn2.scratch.mit.edu/get_image/user/5509488_60x60.png?v=",
 +
        "55x55": "https://cdn2.scratch.mit.edu/get_image/user/5509488_55x55.png?v=",
 +
        "50x50": "https://cdn2.scratch.mit.edu/get_image/user/5509488_50x50.png?v=",
 +
        "32x32": "https://cdn2.scratch.mit.edu/get_image/user/5509488_32x32.png?v="
 +
      },
 +
      "status": "Not very active due to college...\nI can only answer to  \"major\" questions as my routine doesn't allow any further involvement.\nLast logged in date : 18th Dec 2017",
 +
      "bio": "A rare breed of the 44th series. Possibly 4...?\nalt @pl4l\nI hated pen, now I love it... how?!\nI have finally joined the \"one forever loop\" squad!",
 +
      "country": "NO"
 +
    }
 +
  },
 +
  {
 +
    "id": 15850198,
 +
    "username": "Rosyda",
 +
    "history": {
 +
      "joined": "2016-03-16T09:26:03.000Z"
 +
    },
 +
    "profile": {
 +
      "id": 15850198,
 +
      "images": {
 +
        "90x90": "https://cdn2.scratch.mit.edu/get_image/user/15850198_90x90.png?v=",
 +
        "60x60": "https://cdn2.scratch.mit.edu/get_image/user/15850198_60x60.png?v=",
 +
        "55x55": "https://cdn2.scratch.mit.edu/get_image/user/15850198_55x55.png?v=",
 +
        "50x50": "https://cdn2.scratch.mit.edu/get_image/user/15850198_50x50.png?v=",
 +
        "32x32": "https://cdn2.scratch.mit.edu/get_image/user/15850198_32x32.png?v="
 +
      },
 +
      "status": "Everyone here is really kind, thank you for making my experience here in scratch to be so wonderful, you're all amazing and I'm glad that you have been with me ^^",
 +
      "bio": "✿▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬✿\n. ᴀsɪᴀɴ | ɪsғᴘ | ᴄᴏᴅᴇʀ | ᴀʀᴛɪsᴛ | ᴘɪᴀɴɪsᴛ\n. ᴍʏ ᴅʀᴇᴀᴍ ɪs ᴛᴏ ʙᴇ ᴀ ᴛᴇᴀᴄʜᴇʀ ♡\n.­ ɢʜᴏsᴛ: @evelynn- icon: @sekkai",
 +
      "country": "Indonesia"
 +
    }
 +
  },
 +
  ...
 +
]</syntaxhighlight>
 +
{{collapse bottom}}
 +
 
 +
==== GET /users/<username>/messages/count ====
 +
ユーザーの未読メッセージ数を返す。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/users/Paddle2See/messages/count</nowiki>|code}}
 +
'''応答例'''
 +
<syntaxhighlight lang="json">
 +
{
 +
  "count": 14
 +
}
 +
</syntaxhighlight>
 +
 
 +
==== GET /users/<username>/studios/curate/ ====
 +
ユーザーがキュレーションしているスタジオの情報を返す。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/users/ScratchCat/studios/curate/</nowiki>|code}}
 +
'''応答例'''
 +
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="json">
 +
[
 +
  {
 +
    "id": 1963473,
 +
    "title": "Where in the World is Scratch Cat?",
 +
    "owner": 15883188,
 +
    "description": "Scratch Cat has returned from their vacation! But, you're still welcome to create a project for this studio!\n___ \n\nYou’ve got to be kitten me... Scratch Cat has gone on vacation! But where in the world have they gone??\n\nHelp tell the story of where Scratch Cat went on vacation! Create a project to share where you think they went!\n\nLeave a comment and a curator will add your project! \n\nCheck out these things to learn more about Scratch Cat’s vacation!\nVideo: https://scratch.mit.edu/discuss/topic/191220/ \nPostcards to Scratch Cat Studio: https://scratch.mit.edu/studios/1963476/ \nThe Curious Transportations of Scratch Cat Studio: https://scratch.mit.edu/studios/1963477/ \n\nAnd be sure to visit @ScratchCat's profile. Rumor has it Scratch Cat will be leaving clues as to where they are going on their vacation throughout the course of the day!",
 +
    "image": "https://cdn2.scratch.mit.edu/get_image/gallery/1963473_170x100.png",
 +
    "history": {
 +
      "created": "2016-03-31T18:40:42.000Z",
 +
      "modified": "2016-04-04T17:47:45.000Z"
 +
    },
 +
    "stats": {
 +
      "followers": 0
 +
    }
 +
  },
 +
  {
 +
    "id": 1963476,
 +
    "title": "Postcards to Scratch Cat",
 +
    "owner": 15883188,
 +
    "description": "Scratch Cat has returned from their vacation! But, you're still welcome to create a project for this studio!\n___ \n\nScratch Cat has gone on vacation, and we miss them. As a way to share this feeling, we've found a way to send Scratch Cat a message -- postcards! \n\nCreate your own postcard to send to Scratch Cat! \n\nIf you need help getting started, there is a postcard template in this project: https://scratch.mit.edu/projects/102652088/\nYou are welcome to use the template or you are free to design your own! \n\nHave a postcard you would like to send to Scratch Cat? Leave a comment and a curator will add your project! \n\nCheck out these things to learn more about Scratch Cat’s vacation!\nVideo: https://scratch.mit.edu/discuss/topic/191220/ \nWhere in the World is Scratch Cat?: https://scratch.mit.edu/studios/1963473/ \nThe Curious Transportations of Scratch Cat Studio: https://scratch.mit.edu/studios/1963477/ \n\nAnd be sure to visit @ScratchCat's profile. Rumor has it Scratch Cat will be leaving clues as to where they are going on their vacation throughout the course of the day!\n",
 +
    "image": "https://cdn2.scratch.mit.edu/get_image/gallery/1963476_170x100.png",
 +
    "history": {
 +
      "created": "2016-03-31T18:41:20.000Z",
 +
      "modified": "2016-04-04T17:47:55.000Z"
 +
    },
 +
    "stats": {
 +
      "followers": 0
 +
    }
 +
  },
 +
  {
 +
    "id": 2050750,
 +
    "title": "Make it Fly!",
 +
    "owner": 2755634,
 +
    "description": "Make something fly! \n\nWant to learn how?  See http://scratch.mit.edu/fly\n\nTo add your flying project, leave a comment with a link to your project. \n\nYou can find a link to your project by clicking the 'Embed' button on the project page (the button is below the Facebook logo).  \n\n'Make It Fly' was created in collaboration with Cartoon Network (@CartoonNetwork).\n\nCheck out this Powerpuff'd version of the @ScratchCat:\nhttps://scratch.mit.edu/projects/114019829/\n\nAlso, be sure to check out these awesome Powerpuff Girls assets made by @CartoonNetwork: https://scratch.mit.edu/projects/112012308/",
 +
    "image": "https://cdn2.scratch.mit.edu/get_image/gallery/2050750_170x100.png",
 +
    "history": {
 +
      "created": "2016-05-11T19:38:08.000Z",
 +
      "modified": "2016-06-17T16:34:17.000Z"
 +
    },
 +
    "stats": {
 +
      "followers": 0
 +
    }
 +
  },
 +
  ...
 +
]
 +
</syntaxhighlight>
 +
{{collapse bottom}}
 +
 
 +
==== GET /users/<username>/projects ====
 +
ユーザーが共有したプロジェクトの情報を返す。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/users/ScratchCat/projects</nowiki>|code}}
 +
'''応答例'''
 +
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="json">
 +
[
 +
  {
 +
    "id": 103343044,
 +
    "title": "Clue One",
 +
    "description": "",
 +
    "instructions": "After 9 years, I've finally decided to take a vacation! But the big question is, where in the world have I gone??\n\nI'll be sharing clues to my vacation adventures randomly throughout the day. This is your first clue!\n\nUse the sprites I leave behind as clues to help tell the story of my vacation! Add where you think I went, or where you think I should go next!\n\n =^..^= ",
 +
    "author": {
 +
      "id": 15883188
 +
    },
 +
    "image": "https://uploads.scratch.mit.edu/projects/thumbnails/103343044.png",
 +
    "history": {
 +
      "created": "2016-03-29T13:25:31.000Z",
 +
      "modified": "2016-03-31T18:54:32.000Z",
 +
      "shared": "2016-03-31T18:54:32.000Z"
 +
    },
 +
    "stats": {
 +
      "views": 9178,
 +
      "loves": 398,
 +
      "favorites": 311,
 +
      "comments": 1455
 +
    },
 +
    "remix": {
 +
      "parent": null,
 +
      "root": null
 +
    }
 +
  },
 +
  {
 +
    "id": 103343073,
 +
    "title": "Clue Six",
 +
    "description": "",
 +
    "instructions": "After 9 years, I've finally decided to take a vacation! But the big question is, where in the world have I gone??\n\nI'll be sharing clues to my vacation adventures randomly throughout the day. This is Clue #6!\n\nUse the sprites I leave behind as clues to help tell the story of my vacation! Add where you think I went, or where you think I should go next!\n\n =^..^= ",
 +
    "author": {
 +
      "id": 15883188
 +
    },
 +
    "image": "https://uploads.scratch.mit.edu/projects/thumbnails/103343073.png",
 +
    "history": {
 +
      "created": "2016-03-29T13:25:43.000Z",
 +
      "modified": "2016-04-01T15:58:33.000Z",
 +
      "shared": "2016-04-01T15:58:33.000Z"
 +
    },
 +
    "stats": {
 +
      "views": 1858,
 +
      "loves": 156,
 +
      "favorites": 123,
 +
      "comments": 487
 +
    },
 +
    "remix": {
 +
      "parent": null,
 +
      "root": null
 +
    }
 +
  },
 +
  ...
 +
]</syntaxhighlight>
 +
 
 +
==== GET /users/<username>/projects/<project_id> ====
 +
プロジェクトの詳細情報を返します。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/users/ScratchCat/projects/103530008</nowiki>}}
 +
'''応答例'''
 +
<syntaxhighlight lang="json">
 +
{
 +
  "id": 103530008,
 +
  "title": "Where in the World is Scratch Cat?",
 +
  "description": "+ Beginning logo very much inspired by \"Where in the World is Carmen Sandiego?\"\n+ Thanks to @Griffpatch for the Scratch Cat walk cycle\n+ Walking-in-water sound effect from freesound.org\n+ Graphics made using Illustrator and Scratch Vector Editor\n+ Music: \"The Show Must Be Go\" - Kevin MacLeod (incompetech.com)",
 +
  "instructions": "After 9 years, I've finally decided to take a vacation! But the big question is, where in the world have I gone??\n\nHelp tell the story of my vacation! Remix this project and add where you think I went, or where you think I should go next!\n\nAnd be sure to keep an eye on my profile, I'll be sharing clues to my vacation randomly throughout the day!  =^..^= ",
 +
  "author": {
 +
    "id": 15883188
 +
  },
 +
  "image": "https://uploads.scratch.mit.edu/projects/thumbnails/103530008.png",
 +
  "history": {
 +
    "created": "2016-03-30T19:44:12.000Z",
 +
    "modified": "2016-03-31T18:54:19.000Z",
 +
    "shared": "2016-03-31T18:54:19.000Z"
 +
  },
 +
  "stats": {
 +
    "views": 15473,
 +
    "loves": 1112,
 +
    "favorites": 911,
 +
    "comments": 1676
 +
  },
 +
  "remix": {
 +
    "parent": null,
 +
    "root": null
 +
  }
 +
}</syntaxhighlight>
 +
{{collapse bottom}}
 +
 
 +
=== プロジェクトの統計 ===
 +
==== GET /projects/<project_id>/ ====
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/projects/103530008</nowiki>}}
 +
'''応答例''': 上記に同じ。
 +
 
 +
==== GET /projects/<project_id>/remixes/ ====
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/projects/103530008/remixes/</nowiki>}}
 +
'''応答例'''
 +
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="json">
 +
[
 +
  {
 +
    "id": 103678231,
 +
    "title": "Where in the World is Scratch Cat? remix",
 +
    "description": "I found HIM!!!!!!!!",
 +
    "instructions": "After 9 years, I've finally decided to take a vacation! But the big question is, where in the world have I gone??\n\nHelp tell the story of my vacation! Remix this project and add where you think I went, or where you think I should go next!\n\nAnd be sure to keep an eye on my profile, I'll be sharing clues to my vacation randomly throughout the day!  =^..^= ",
 +
    "visibility": "visible",
 +
    "is_published": true,
 +
    "author": {
 +
      "id": 2585386,
 +
      "username": "goobitz"
 +
    },
 +
    "image": "https://cdn2.scratch.mit.edu/get_image/project/103678231_480x360.png",
 +
    "history": {
 +
      "created": "2016-03-31T20:59:48.000Z",
 +
      "modified": "2016-03-31T21:00:39.000Z",
 +
      "shared": "2016-03-31T21:00:19.000Z"
 +
    },
 +
    "stats": {
 +
      "views": 794,
 +
      "loves": 14,
 +
      "favorites": 13,
 +
      "comments": 0,
 +
      "remixes": 0
 +
    },
 +
    "remix": {
 +
      "parent": 103530008,
 +
      "root": 103530008
 +
    }
 +
  },
 +
  {
 +
    "id": 103678828,
 +
    "title": "Scratch Cat go's to MLG city",
 +
    "description": "Credit to ScratchCat",
 +
    "instructions": "Wow I have been all around the world now my next stop is MLG city.\nWho knows what will happen?",
 +
    "visibility": "visible",
 +
    "is_published": true,
 +
    "author": {
 +
      "id": 13805967,
 +
      "username": "PacketOfChips"
 +
    },
 +
    "image": "https://cdn2.scratch.mit.edu/get_image/project/103678828_480x360.png",
 +
    "history": {
 +
      "created": "2016-03-31T21:06:09.000Z",
 +
      "modified": "2016-04-09T04:02:02.000Z",
 +
      "shared": "2016-03-31T21:22:40.000Z"
 +
    },
 +
    "stats": {
 +
      "views": 422,
 +
      "loves": 22,
 +
      "favorites": 21,
 +
      "comments": 0,
 +
      "remixes": 0
 +
    },
 +
    "remix": {
 +
      "parent": 103530008,
 +
      "root": 103530008
 +
    }
 +
  },
 +
  ...
 +
]
 +
</syntaxhighlight>
 +
{{collapse bottom}}
 +
 
 +
==== GET /projects/<project-id>/studios/ ====
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/projects/103530008/studios/</nowiki>}}
 +
'''応答例'''
 +
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="json">
 +
[
 +
  {
 +
    "id": 249898,
 +
    "title": "ADD EVERY SCRATCH PROJECT EVER!!!!!!",
 +
    "owner": 2719617,
 +
    "description": "ADD EVERY SCRATCH PROJECT EVER!!!!!!! 2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)[[利用者:Apple bot|Apple bot]] ([[利用者・トーク:Apple bot|トーク]]) 2019年1月16日 (水) 03:18 (CET)\n\nHi scratchers!  I REALLY want this gallery to get featured, SO ADD ALL THE PROJECT YOU CAN FIND!! or else i`ll blast you with my muffin cannon...MYAHAHAHAHAHAHAHAHA!!!! Lol jk----thx for all the projects and coments and stuff!!!  ~Derpy\n\nP.S., if u want to curate, just ask in the coments, BUT U HAVE TO ADD AT LEAST 30 OR MORE PROJECTS!!! Lol",
 +
    "image": "https://cdn2.scratch.mit.edu/get_image/gallery/249898_170x100.png",
 +
    "history": {
 +
      "created": "2013-09-12T15:47:48.000Z",
 +
      "modified": "2017-07-20T04:13:00.000Z"
 +
    },
 +
    "stats": {
 +
      "followers": 0
 +
    }
 +
  },
 +
  {
 +
    "id": 250973,
 +
    "title": "ADD ALL PROJECTS!! GOAL: 50,000!",
 +
    "owner": 1767871,
 +
    "description": "ADD ALL OF YOUR PROJECTS!! *REPEAT!*\n\n50 projects  DONE!! :D\n\n100 projects  DONE!! :D\n\n200 projects DONE!! :D\n\n300 projects DONE!! :D\n\n500 projects DONE!! :D\n\n1,000 projects DONE!! :D\n\n10,000 projects DONE!! :D\n\n20,000 projects\n\n30,000 projects\n\nGOAL: 50,000 projects",
 +
    "image": "https://cdn2.scratch.mit.edu/get_image/gallery/250973_170x100.png",
 +
    "history": {
 +
      "created": "2013-09-15T14:33:47.000Z",
 +
      "modified": "2016-09-30T10:08:07.000Z"
 +
    },
 +
    "stats": {
 +
      "followers": 0
 +
    }
 +
  },
 +
  ...
 +
]
 +
</syntaxhighlight>
 +
{{collapse bottom}}
 +
 
 +
=== コメントAPI === <!-- 使用不可? -->
 +
==== GET /projects/<project-id>/comments/ ====
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/projects/103530008/comments/</nowiki>|code}}
 +
'''応答例'''
 +
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="json">
 +
[
 +
  {
 +
    "id": 100151059,
 +
    "parent_id": null,
 +
    "content": "hehe why don't you make the answer? It's been more than 2 years",
 +
    "datetime_created": "2018-09-22T14:59:09.000Z",
 +
    "datetime_modified": "2018-09-22T14:59:09.000Z",
 +
    "author": {
 +
      "id": 32768225,
 +
      "username": "Moonstream2000",
 +
      "image": "https://cdn2.scratch.mit.edu/get_image/user/32768225_60x60.png"
 +
    },
 +
    "reply_count": 0
 +
  },
 +
  {
 +
    "id": 100150712,
 +
    "parent_id": null,
 +
    "content": "lol",
 +
    "datetime_created": "2018-09-22T14:52:31.000Z",
 +
    "datetime_modified": "2018-09-22T14:52:31.000Z",
 +
    "author": {
 +
      "id": 35058080,
 +
      "username": "thefiery1",
 +
      "image": "https://cdn2.scratch.mit.edu/get_image/user/35058080_60x60.png"
 +
    },
 +
    "reply_count": 0
 +
  },
 +
  {
 +
    "id": 100046047,
 +
    "parent_id": null,
 +
    "content": "He's walking on the globe!",
 +
    "datetime_created": "2018-09-20T07:59:02.000Z",
 +
    "datetime_modified": "2018-09-20T07:59:02.000Z",
 +
    "author": {
 +
      "id": 34590836,
 +
      "username": "OfficialTailsTheFox",
 +
      "image": "https://cdn2.scratch.mit.edu/get_image/user/34590836_60x60.png"
 +
    },
 +
    "reply_count": 0
 +
  },
 +
  ...
 +
]
 +
</syntaxhighlight>
 +
{{collapse bottom}}
 +
 
 +
==== GET /project/<project-id>/comments/<parent-id>/replies/ ====
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/projects/203791193/comments/98229863/replies/</nowiki>|code}}
 +
'''応答例'''
 +
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="json">
 +
[
 +
  {
 +
    "id": 98229957,
 +
    "parent_id": 98229863,
 +
    "content": "Yes as the scratch editor only supports English characters.",
 +
    "datetime_created": "2018-08-09T19:34:47.000Z",
 +
    "datetime_modified": "2018-08-09T19:34:47.000Z",
 +
    "author": {
 +
      "id": 13594403,
 +
      "username": "jakel181",
 +
      "image": "https://cdn2.scratch.mit.edu/get_image/user/13594403_60x60.png"
 +
    },
 +
    "reply_count": 0
 +
  },
 +
  {
 +
    "id": 98230059,
 +
    "parent_id": 98229863,
 +
    "content": "Sorry, I don't understand. Netherlands have exzactly the same characters as English",
 +
    "datetime_created": "2018-08-09T19:37:53.000Z",
 +
    "datetime_modified": "2018-08-09T19:37:53.000Z",
 +
    "author": {
 +
      "id": 6809732,
 +
      "username": "schittering06",
 +
      "image": "https://cdn2.scratch.mit.edu/get_image/user/6809732_60x60.png"
 +
    },
 +
    "reply_count": 0
 +
  }
 +
]
 +
</syntaxhighlight>
 +
{{collapse bottom}}
 +
-->
 +
=== 教師用アカウントAPI ===
 +
<!-- 使用不可? -->
 +
==== GET /classrooms/<classroom-id>/ ====
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/comments/project/203791193/98229863/</nowiki>|code}}
 +
'''応答例'''
 +
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="json">
 +
{
 +
  "id": 5264,
 +
  "title": "小中高におけるコンピュータ教育",
 +
  "description": "小中高におけるコンピュータ教育",
 +
  "status": "小中高におけるコンピュータ教育",
 +
  "date_start": "2016-09-23T00:00:00.000Z",
 +
  "date_end": null,
 +
  "images": {
 +
    "250x150": "https://cdn2.scratch.mit.edu/get_image/classroom/5264_250x150.png?v=",
 +
    "170x100": "https://cdn2.scratch.mit.edu/get_image/classroom/5264_170x100.png?v=",
 +
    "150x85": "https://cdn2.scratch.mit.edu/get_image/classroom/5264_150x85.png?v=",
 +
    "75x55": "https://cdn2.scratch.mit.edu/get_image/classroom/5264_75x55.png?v="
 +
  },
 +
  "educator": {
 +
    "id": 17797140,
 +
    "username": "abee_abe",
 +
    "history": {
 +
      "joined": "2016-08-12T20:16:29.000Z"
 +
    },
 +
    "profile": {
 +
      "id": 16960771,
 +
      "images": {
 +
        "90x90": "https://cdn2.scratch.mit.edu/get_image/user/17797140_90x90.png?v=",
 +
        "60x60": "https://cdn2.scratch.mit.edu/get_image/user/17797140_60x60.png?v=",
 +
        "55x55": "https://cdn2.scratch.mit.edu/get_image/user/17797140_55x55.png?v=",
 +
        "50x50": "https://cdn2.scratch.mit.edu/get_image/user/17797140_50x50.png?v=",
 +
        "32x32": "https://cdn2.scratch.mit.edu/get_image/user/17797140_32x32.png?v="
 +
      },
 +
      "status": "",
 +
      "bio": "",
 +
      "country": "Japan"
 +
    }
 +
  }
 +
}
 +
</syntaxhighlight>
 +
{{collapse bottom}}
 +
 
 +
=== 検索 ===
 +
qパラメータがない場合、人気のものが返るので注意。
 +
 
 +
==== GET /search/projects/?q=<word> ====
 +
検索条件に当てはまるプロジェクトの情報を配列で返す。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/search/projects?q=Japan</nowiki>|code}}
 +
'''応答例'''
 +
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="json">
 +
[
 +
  {
 +
    "id": 142393073,
 +
    "title": "Japan",
 +
    "description": "Inspiration from Alto's Adventure\nOriginal Designer - Harry Nesbitt\n\nMusic:\nDavid Lanz & Paul Speer - Behind the Waterfall",
 +
    "instructions": "Japan - This is a remake of Harry Nesbitt's work\n\nThank You all, Honestly for the support!\n\nThis is my most viewed project!!!\n",
 +
    "visibility": "notvisible",
 +
    "is_published": false,
 +
    "author": {
 +
      "id": 12475304,
 +
      "username": "Vezto"
 +
    },
 +
    "image": "https://cdn2.scratch.mit.edu/get_image/project/142393073_480x360.png",
 +
    "history": {
 +
      "created": "2017-01-28T23:55:34.000Z",
 +
      "modified": "2017-02-03T05:17:11.000Z",
 +
      "shared": "2017-01-29T00:13:25.000Z"
 +
    },
 +
    "stats": {
 +
      "views": 21438,
 +
      "loves": 1450,
 +
      "favorites": 946,
 +
      "comments": 0,
 +
      "remixes": 0
 +
    },
 +
    "remix": {
 +
      "root": null
 +
    }
 +
  },
 +
  {
 +
    "id": 203255085,
 +
    "title": "Japan",
 +
    "description": "Information-my brain\nSprites-me\nMusic-cslhaileyg\nBackgrounds-Google and me\nThumbnail-Google\n",
 +
    "instructions": "Click map to go from place to place and click on the different things.\n\n2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)[[利用者:Apple bot|Apple bot]] ([[利用者・トーク:Apple bot|トーク]]) 2019年1月16日 (水) 03:18 (CET)Oh my gosh March 9th or sometime before 500+ views!!!!!\nOMG OMG OMG  1000+ views!!!!!!!!!  THX SO MUCH!!!  \n\n\n\n\n\n\n\n\n",
 +
    "visibility": "notvisible",
 +
    "is_published": false,
 +
    "author": {
 +
      "id": 25465510,
 +
      "username": "LilyJaguar30"
 +
    },
 +
    "image": "https://cdn2.scratch.mit.edu/get_image/project/203255085_480x360.png",
 +
    "history": {
 +
      "created": "2018-02-09T23:44:05.000Z",
 +
      "modified": "2018-05-30T23:39:26.000Z",
 +
      "shared": "2018-02-18T19:49:07.000Z"
 +
    },
 +
    "stats": {
 +
      "views": 1676,
 +
      "loves": 23,
 +
      "favorites": 16,
 +
      "comments": 0,
 +
      "remixes": 0
 +
    },
 +
    "remix": {
 +
      "root": null
 +
    }
 +
  },
 +
  ...
 +
]
 +
</syntaxhighlight>
 +
{{collapse bottom}}
 +
 
 +
==== GET /search/studios?q=<word> ====
 +
検索条件に当てはまるスタジオの情報を配列で返す。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://api.scratch.mit.edu/search/studios?q=Wiki</nowiki>|code}}
 +
'''応答例'''
 +
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="json">
 +
[
 +
  {
 +
    "id": 3541726,
 +
    "title": "Scratch Wiki Contributors",
 +
    "owner": 4515658,
 +
    "description": "☆ Check out the Scratch Wiki Interactive Timeline, our collab project: \nhttps://scratch.mit.edu/projects/238213919/\n\nWelcome to Scratch Wiki Contributors!\n--------------------------------------\nIn this studio, you are going to see a variety of Scratch Wiki contributors. If you are one, you may ask to curate. If not, and you want to consider to apply for a contributor, here's the link: https://en.scratch-wiki.info/wiki/S:JOIN\n--------------------------------------\nIn this studio, Wiki contributors may comment, add projects, and much more! Please don't ask to curate if you are not a contributor, but you may comment on this studio if you have a question or if there is something else you'd like to comment. Thanks!\n--------------------------------------\nManagers: Please don't add people without checking on the wiki using the \"user:[username]\" search - just in case one of the people you add is not a contributor. Thanks!\n--------------------------------------\nWith that said, have fun and enjoy!\n",
 +
    "image": "https://cdn2.scratch.mit.edu/get_image/gallery/3541726_170x100.png",
 +
    "history": {
 +
      "created": "2016-11-06T18:49:56.000Z",
 +
      "modified": "2018-08-24T23:49:17.000Z"
 +
    },
 +
    "stats": {
 +
      "followers": 51
 +
    }
 +
  },
 +
  {
 +
    "id": 4675048,
 +
    "title": "What is Wiki Wednesday?",
 +
    "owner": 2581759,
 +
    "description": "Info available in the following lanuages:\n\nFrench | Deutsch | English\n2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)\nLearn about Wiki Wednesday in one of the projects of this studio\n\n------------------------->\n\nAre you multilingual? Help by creating a remix of an info project and translating it to your language!\n2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)\nSUGGEST AN ARTICLE\n\nSuggest an English Wiki Wednesday article: https://scratch.mit.edu/discuss/topic/288005/\n\nSuggestion threads in other languages can be found in the corresponding language forum. \n\nSee past English Wiki Wednesday article suggestions:\nhttps://wiki.scratch.mit.edu/wiki/Scratch_Wiki:Wiki_Wednesday_Suggestions\n2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)2019年1月16日 (水) 03:18 (CET)\nWHAT IS THE SCRATCH WIKI?\n\nCheck out the Wikis: \nhttp://scratch-dach.info\nhttp://en.scratch-wiki.info\nhttp://fr.scratch-wiki.info\nhttp://hu.scratch-wiki.info\nhttp://scratch-indo.info\nhttp://ja.scratch-wiki.info\nhttp://nl.scratch-wiki.info\nhttp://scratch-ru.info\nhttp://test.scratch-wiki.info\n\nAre you really interested in helping out the wiki? Think about becoming an author: https://en.scratch-wiki.info/wiki/S:CONTRIB",
 +
    "image": "https://cdn2.scratch.mit.edu/get_image/gallery/4675048_170x100.png",
 +
    "history": {
 +
      "created": "2018-01-24T03:03:23.000Z",
 +
      "modified": "2018-02-17T10:17:22.000Z"
 +
    },
 +
    "stats": {
 +
      "followers": 30
 +
    }
 +
  },
 +
  ...
 +
]
 +
</syntaxhighlight>
 +
{{collapse bottom}}
 +
 
 +
=== ユーザー名API ===
 +
==== GET /accounts/check_username/<word> ====
 +
「username exists」(すでに存在)「bad username」([[検閲]])「invalid username」(無効)「valid username」(使用可能)を返す。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://scratch.mit.edu/accounts/check_username/UnavailableUser/</nowiki>|code}}
 +
'''応答例'''
 +
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="json">
 +
[
 +
  {
 +
    "username": "UnavailableUser",
 +
    "msg": "valid username"
 +
  }
 +
]
 +
</syntaxhighlight>
 +
{{collapse bottom}}
 +
 
 +
=== リクエストのエラー ===
 +
存在しないリソースへアクセスすると、以下のような連想配列が返される。
 +
<syntaxhighlight lang="json">
 +
{
 +
  "code":"NotFound",
 +
  "message":""
 +
}
 +
</syntaxhighlight>
 +
 
 +
 
 +
== scratch.mit.edu/site-api ==
 +
=== GET /comments/gallery/<studio_id>/ ===
 +
コメントを取得する。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://scratch.mit.edu/site-api/comments/gallery/5342/</nowiki>|code}}
 +
 
 +
=== GET /comments/project/<project_id>/ ===
 +
コメントを取得する。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://scratch.mit.edu/site-api/comments/project/103345354/</nowiki>|code}}
 +
 
 +
=== GET /comments/user/<username>/ ===
 +
コメントを取得する。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://scratch.mit.edu/site-api/comments/user/thisandagain/</nowiki>|code}}
 +
 
 +
=== PUT /users/followers/<username>/add/ ===
 +
フォローする。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>PUT https://scratch.mit.edu/site-api/users/followers/abee/add/</nowiki>|code}}
 +
 
 +
=== PUT /users/lovers/<project_id>/add/ ===
 +
「好き」を入れる。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>PUT https://scratch.mit.edu/site-api/users/lovers/154080544/add/</nowiki>|code}}
 +
 
 +
=== PUT /users/favoriters/<project_id>/add/ ===
 +
「お気に入り」にする。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>PUT https://scratch.mit.edu/site-api/users/favoriters/154080544/add/</nowiki>|code}}
 +
 
 +
=== PUT /users/all/<username> ===
 +
「私について」「私が取り組んでいること」の変更。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>PUT https://scratch.mit.edu/site-api/users/all/apple502j</nowiki>|code}}
 +
 
 +
=== 必要なヘッダー ===
 +
X-CSRFTokenというヘッダーに、トークンを設定する。トークンはCookieの「scratchcsrftoken」を参照すればいい。また、X-Requested-WithにはXMLHttpRequestを指定する。
 +
 
 +
Cookieは、scratchcsrftokenとscratchsessionsidが必要だ。
 +
 
 +
== varserver api (廃止) ==
 +
[[クラウド変数]]のAPI。
 +
=== GET /<project_id> ===
 +
[[クラウド変数]]の情報を返す。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://scratch.mit.edu/varserver/16805451</nowiki>|code}}
 +
'''応答例'''
 +
<syntaxhighlight lang="json">
 +
{
 +
  "variables": [
 +
    {
 +
      "name": "☁ たたかれた回数",
 +
      "value": "2546"
 +
    }
 +
  ],
 +
  "lists": []
 +
}
 +
</syntaxhighlight>
 +
 
 +
== api/v1 API (使用不可) ==
 +
=== GET / ===
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://scratch.mit.edu/api/v1/</nowiki>|code}}
 +
'''応答例'''
 +
<syntaxhighlight lang="json">
 +
{
 +
  "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/"
 +
  }
 +
}</syntaxhighlight>
 +
 
 +
=== GET /project/<project_id>/ ===
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://scratch.mit.edu/api/v1/project/178040314</nowiki>|code}}
 +
'''応答例'''
 +
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="json">
 +
{
 +
  "creator": {
 +
    "username": "ScratchCat",
 +
    "userprofile": {
 +
      "bio": "Meow! Meow Meow purrrr lick meow!",
 +
      "country": "United States",
 +
      "status": "Getting ready for Scratch Camp! -------->\n\nMrow! \n=^..^="
 +
    }
 +
  },
 +
  "datetime_shared": "2017-10-04T15:26:38",
 +
  "description": "Scratch In Space Studio: https://scratch.mit.edu/studios/4333395/\nVideo Sensing Blocks Tutorial: https://www.youtube.com/watch?v=8vHEqVdWn08 \n\nArtwork: Created in Illustrator\nFont: Adam.CG Pro, Marker Felt\nMusic: \"Feelin Good\" by Kevin MacLeod (incompetech.com)\nSpace background on thumbnail found here: http://www.designblognews.com/wp-content/uploads/2017/03/space-vector-background-vector-graphic-constellation-1488398377k84gn.jpg\n",
 +
  "favorite_count": "514",
 +
  "id": 178040314,
 +
  "love_count": "653",
 +
  "resource_uri": "/api/v1/project/178040314/",
 +
  "thumbnail": "//uploads.scratch.mit.edu/projects/thumbnails/178040314.png",
 +
  "title": "Scratch in Space",
 +
  "view_count": "13261"
 +
}</syntaxhighlight>
 +
{{collapse bottom}}
 +
 
 +
=== GET /project/set/<project_ids>/ ===
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://scratch.mit.edu/api/v1/project/set/169147225;178040314/</nowiki>|code}}
 +
'''応答例'''
 +
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="json">
 +
{
 +
  "objects": [
 +
    {
 +
      "creator": {
 +
        "username": "ScratchCat",
 +
        "userprofile": {
 +
          "bio": "Meow! Meow Meow purrrr lick meow!",
 +
          "country": "United States",
 +
          "status": "Getting ready for Scratch Camp! -------->\n\nMrow! \n=^..^="
 +
        }
 +
      },
 +
      "datetime_shared": "2017-10-04T15:26:38",
 +
      "description": "Scratch In Space Studio: https://scratch.mit.edu/studios/4333395/\nVideo Sensing Blocks Tutorial: https://www.youtube.com/watch?v=8vHEqVdWn08 \n\nArtwork: Created in Illustrator\nFont: Adam.CG Pro, Marker Felt\nMusic: \"Feelin Good\" by Kevin MacLeod (incompetech.com)\nSpace background on thumbnail found here: http://www.designblognews.com/wp-content/uploads/2017/03/space-vector-background-vector-graphic-constellation-1488398377k84gn.jpg\n",
 +
      "favorite_count": "514",
 +
      "id": 178040314,
 +
      "love_count": "653",
 +
      "resource_uri": "/api/v1/project/178040314/",
 +
      "thumbnail": "//uploads.scratch.mit.edu/projects/thumbnails/178040314.png",
 +
      "title": "Scratch in Space",
 +
      "view_count": "13261"
 +
    },
 +
    {
 +
      "creator": {
 +
        "username": "ScratchCat",
 +
        "userprofile": {
 +
          "bio": "Meow! Meow Meow purrrr lick meow!",
 +
          "country": "United States",
 +
          "status": "Getting ready for Scratch Camp! -------->\n\nMrow! \n=^..^="
 +
        }
 +
      },
 +
      "datetime_shared": "2017-07-19T13:04:35",
 +
      "description": "Lot's of hard work from @st19_galla to make this camp possible! \nMade in the Scratch Editor\n\nMusic: http://www.bensound.com\nCar based off of: https://www.google.com/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0ahUKEwiv6sT9xdTUAhXBUyYKHfeMCt8QjRwIBw&url=http%3A%2F%2Fwww.freepik.com%2Ffree-vector%2Fvehicle-pack-in-front-position_1071157.htm&psig=AFQjCNENsyTUfpcknsgkoqqJcf3DSqD4GA&ust=1498327214778216",
 +
      "favorite_count": "438",
 +
      "id": 169147225,
 +
      "love_count": "569",
 +
      "resource_uri": "/api/v1/project/169147225/",
 +
      "thumbnail": "//uploads.scratch.mit.edu/projects/thumbnails/169147225.png",
 +
      "title": "Scratch Camp 2017 Teaser",
 +
      "view_count": "9902"
 +
    }
 +
  ]
 +
}</syntaxhighlight>
 +
{{collapse bottom}}
 +
 
 +
=== GET /user/<username>/ ===
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://scratch.mit.edu/api/v1/user/mres/</nowiki>|code}}
 +
'''応答例'''
 +
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="json">
 +
{
 +
  "username": "mres",
 +
  "userprofile": {
 +
    "bio": "I'm a professor at the MIT Media Lab. But more important: I'm a member of the Scratch Team! \n\nCheck out my TED talk about Scratch: http://bit.ly/mres-ted-talk",
 +
    "country": "United States",
 +
    "status": "I just finished writing a book called \"Lifelong Kindergarten: Cultivating Creativity through Projects, Passion, Peers, and Play\". See lifelongkindergarten.net"
 +
  }
 +
}</syntaxhighlight>
 +
{{collapse bottom}}
 +
 
 +
=== GET /user/set/<usernames>/ ===
 +
現在使用できない。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://scratch.mit.edu/api/v1/user/set/ScratchCat;thisandagain/</nowiki>|code}}
 +
'''応答例'''
 +
<syntaxhighlight lang="json">
 +
{
 +
  "objects": [
 +
    {
 +
      "username": "ScratchCat",
 +
      "userprofile": ""
 +
    },
 +
    {
 +
      "username": "thisandagain",
 +
      "userprofile": ""
 +
    }
 +
  ]
 +
}</syntaxhighlight>
 +
 
 +
== プロジェクト素材のAPI ==
 +
=== プロジェクトのJSON ===
 +
[[JSONチュートリアル|ブロックのハッキング]]に使うJSONと同じものが返る。
 +
 
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://projects.scratch.mit.edu/internalapi/project/102747129/get/</nowiki>|code}}
 +
'''応答例'''
 +
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="json">
 +
{
 +
  "objName": "Stage",
 +
  "sounds": [{
 +
      "soundName": "ポップ",
 +
      "soundID": -1,
 +
      "md5": "83a9787d4cb6f3b7632b4ddfebf74367.wav",
 +
      "sampleCount": 258,
 +
      "rate": 11025,
 +
      "format": ""
 +
    }],
 +
  "costumes": [{
 +
      "costumeName": "背景1",
 +
      "baseLayerID": -1,
 +
      "baseLayerMD5": "739b5e2a2435f6e1ec2993791b423146.png",
 +
      "bitmapResolution": 1,
 +
      "rotationCenterX": 240,
 +
      "rotationCenterY": 180
 +
    }],
 +
  "currentCostumeIndex": 0,
 +
  "penLayerMD5": "5c81a336fab8be57adc039a8a2b33ca9.png",
 +
  "penLayerID": -1,
 +
  "tempoBPM": 60,
 +
  "videoAlpha": 0.5,
 +
  "children": [{
 +
      "objName": "スプライト2",
 +
      "scripts": [[39.4,
 +
          132.05,
 +
          [["whenGreenFlag"],
 +
            ["doForever",
 +
              [["turnRight:", 15],
 +
                ["changeSizeBy:", 10],
 +
                ["doIf", ["touching:", "_edge_"], [["setSizeTo:", 1]]]]]]]],
 +
      "sounds": [{
 +
          "soundName": "ニャー",
 +
          "soundID": -1,
 +
          "md5": "83c36d806dc92327b9e7049a565c6bff.wav",
 +
          "sampleCount": 18688,
 +
          "rate": 22050,
 +
          "format": ""
 +
        }],
 +
      "costumes": [{
 +
          "costumeName": "コスチューム1",
 +
          "baseLayerID": -1,
 +
          "baseLayerMD5": "f9a1c175dbe2e5dee472858dd30d16bb.svg",
 +
          "bitmapResolution": 1,
 +
          "rotationCenterX": 47,
 +
          "rotationCenterY": 55
 +
        },
 +
        {
 +
          "costumeName": "コスチューム2",
 +
          "baseLayerID": -1,
 +
          "baseLayerMD5": "6e8bd9ae68fdb02b7e1e3df656a75635.svg",
 +
          "bitmapResolution": 1,
 +
          "rotationCenterX": 47,
 +
          "rotationCenterY": 55
 +
        }],
 +
      "currentCostumeIndex": 0,
 +
      "scratchX": 0,
 +
      "scratchY": 0,
 +
      "scale": 3.1531914893617023,
 +
      "direction": -45,
 +
      "rotationStyle": "normal",
 +
      "isDraggable": false,
 +
      "indexInLibrary": 1,
 +
      "visible": true,
 +
      "spriteInfo": {
 +
      }
 +
    }],
 +
  "info": {
 +
    "projectID": "102747129",
 +
    "hasCloudData": false,
 +
    "spriteCount": 1,
 +
    "scriptCount": 1,
 +
    "videoOn": false,
 +
    "flashVersion": "WIN 21,0,0,216",
 +
    "swfVersion": "v445.2",
 +
    "userAgent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/49.0.2623.112 Safari\/537.36"
 +
  }
 +
}</syntaxhighlight>
 +
{{collapse bottom}}
 +
 
 +
=== 素材 ===
 +
'''リクエスト例'''
 +
{{テキストボックス|<nowiki>GET https://cdn.assets.scratch.mit.edu/internalapi/asset/5e037aca5446a7e57093e45fe6f18c9e.svg/get/</nowiki>|code}}
 +
'''応答例'''
 +
{{collapse top|APIの結果}}
 +
<syntaxhighlight lang="xml">
 +
<svg width="152px" height="136px" viewBox="0 0 152 136" version="1.1" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 +
  <!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
 +
  <defs/>
 +
  <g>
 +
    <title>referee-d</title>
 +
    <desc>Created with Sketch.</desc>
 +
    <g id="soccer" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
 +
      <g id="referee-d" fill-rule="nonzero">
 +
        <g id="scratch_footie_player_ref04" transform="translate(90.000000, 68.500000) scale(-1, 1) translate(-90.000000, -68.500000) translate(32.000000, 5.000000)">
 +
          <path d="M47.9120623,69.6248227 C32.1730739,70.4129433 19.8418677,71.2415957 12.3357198,71.6469149 C4.82957198,72.052234 0.117354086,72.2098582 0.0541634241,72.9574468 C0.00451361868,73.5429078 4.03066148,73.223156 5.9218677,73.3807801 C5.88575875,73.6059574 6.02116732,74.0923404 6.0663035,74.6958156 C6.22428016,76.8079787 10.2007782,77.3348936 13.0669261,77.5060284 C18.9933074,77.857305 35.1340078,78.0464539 51.0941634,78.1500355 C51.0941634,78.1500355 58.0812451,78.2130851 57.8645914,73.2681915 C57.6479377,68.3232979 47.9120623,69.6248227 47.9120623,69.6248227 Z" id="Shape" fill="#828278"/>
 +
          <path d="M5.65105058,70.9758865 C4.88824903,70.9083333 5.09587549,71.4037234 5.93089494,71.7279787 C6.50548916,71.9422298 7.10181129,72.0932429 7.7092607,72.1783333 C7.7092607,72.1783333 7.2263035,74.6642908 10.1827237,74.1103546 C11.5593774,73.8536525 11.3968872,72.2774113 10.155642,71.6153901 C8.7248249,70.8452837 6.05727626,71.0119149 5.65105058,70.9758865 Z" id="Shape" fill="#3C3C32"/>
 +
          <path d="M83.9171984,92.71 L83.2085603,107.688794 L75.4090272,107.634752 L75.494786,92.0479787 C75.494786,92.0479787 74.7049027,84.3694326 80.0084047,83.5452837 C85.3119066,82.7211348 83.9171984,92.71 83.9171984,92.71 Z" id="Shape" fill="#828278"/>
 +
          <path d="M74.9757198,106.941206 L83.709572,106.941206 L81.0014008,123.090922 C81.0014008,123.090922 84.7477043,122.84773 85.8851362,123.698901 L85.6368872,124.207801 C84.2828016,124.541064 85.4924514,126.00922 84.2828016,126.328972 C83.9262257,125.711986 84.5536187,123.379149 82.928716,124.207801 C82.9648249,124.797766 83.235642,125.950674 82.7075486,126.459574 L82.2110506,126.346986 C82.0575875,125.554362 82.454786,124.766241 82.0666148,124.054681 C81.6467952,123.89172 81.172417,123.956419 80.8118288,124.225816 L80.9562646,126.28844 L80.1077043,126.500106 L80.1077043,124.653652 C79.6337743,124.608617 79.4622568,124.090709 78.9341634,124.203298 C78.8890272,124.95539 79.2456031,126.56766 78.0314397,126.16234 C77.9817899,125.518333 78.3744747,124.811277 77.8283268,124.194291 L76.9707393,124.194291 C76.6999222,124.491525 76.8849805,126.040745 76.8849805,126.238901 L76.3929961,126.603688 L75.9416342,126.337979 C75.8874708,125.549858 75.2781323,109.773936 74.9757198,106.941206 Z" id="Shape" fill="#000000"/>
 +
          <rect id="Rectangle-path" fill="#FFFFFF" transform="translate(79.412607, 107.468121) rotate(-180.000000) translate(-79.412607, -107.468121) " x="74.5604669" y="106.450319" width="9.70428016" height="2.03560284"/>
 +
          <rect id="Rectangle-path" fill="#FFFFFF" transform="translate(79.410350, 111.111489) rotate(-180.000000) translate(-79.410350, -111.111489) " x="75.0073152" y="110.093688" width="8.80607004" height="2.03560284"/>
 +
          <rect id="Rectangle-path" fill="#FFFFFF" transform="translate(78.958988, 114.331525) rotate(-180.000000) translate(-78.958988, -114.331525) " x="74.9215564" y="113.354255" width="8.07486381" height="1.95453901"/>
 +
          <path d="M57.1198444,93.5341489 L58.1805447,107.688794 L65.9755642,107.612234 C65.9755642,107.612234 67.2529183,84.5856028 61.8365759,83.9956383 C56.4202335,83.4056738 57.1198444,93.5341489 57.1198444,93.5341489 Z" id="Shape" fill="#828278"/>
 +
          <path d="M66.4178988,106.941206 L57.6795331,106.941206 L60.3877043,123.090922 C60.3877043,123.090922 56.6414008,122.84773 55.5039689,123.698901 L55.7522179,124.207801 C57.1063035,124.541064 55.8966537,126.00922 57.1063035,126.328972 C57.4628794,125.711986 56.8354864,123.379149 58.4603891,124.207801 C58.4242802,124.797766 58.153463,125.950674 58.6815564,126.459574 L59.1780545,126.346986 C59.3315175,125.554362 58.9343191,124.766241 59.3224903,124.054681 C59.7423099,123.89172 60.2166881,123.956419 60.5772763,124.225816 L60.4328405,126.28844 L61.2814008,126.500106 L61.2814008,124.653652 C61.7553307,124.608617 61.9268482,124.090709 62.4549416,124.203298 C62.5000778,124.95539 62.1435019,126.56766 63.3576654,126.16234 C63.4073152,125.518333 63.0146304,124.811277 63.5607782,124.194291 L64.4183658,124.194291 C64.6891829,124.491525 64.5041245,126.040745 64.5041245,126.238901 L64.9961089,126.603688 L65.4474708,126.337979 C65.5016342,125.549858 66.1109728,109.773936 66.4178988,106.941206 Z" id="Shape" fill="#000000"/>
 +
          <rect id="Rectangle-path" fill="#FFFFFF" x="57.124358" y="106.450319" width="9.70428016" height="2.03560284"/>
 +
          <rect id="Rectangle-path" fill="#FFFFFF" x="57.5757198" y="110.093688" width="8.80607004" height="2.03560284"/>
 +
          <rect id="Rectangle-path" fill="#FFFFFF" x="58.3926848" y="113.354255" width="8.07486381" height="1.95453901"/>
 +
          <path d="M115.832996,68.7376241 C114.072685,56.7446809 105.573541,42.3333333 92.077821,43.7969858 C91.3255512,43.881052 90.5732815,43.996643 89.8210117,44.1437589 C93.0437354,38.834078 96.564358,33.655 99.4621012,28.3002837 C102.003268,23.6075887 109.157354,11.9298936 109.157354,11.9298936 L104.427082,0.671028369 L98.7850584,4.30989362 C98.7850584,4.30989362 77.6342412,37.7892553 71.4957198,47.8501773 C66.6074708,55.8439716 61.9223346,63.4189362 60.7623346,73.0385106 C59.7964202,81.032305 61.9900389,88.4226241 68.6431128,93.3044681 C71.9967315,95.7679078 75.5354086,96.3533688 79.5435019,97.3576596 C86.4493385,99.0870213 93.6034241,100.343511 99.9405447,97.3576596 C112.059611,91.6606738 116,80.6900355 115.832996,68.7376241 Z" id="Shape" fill="#000000"/>
 +
          <polygon id="Shape" fill="#000000" points="43.7821012 42.9548227 36.6957198 57.8480496 64.6982101 59.0279787 71.5273152 43.2070213"/>
 +
          <path d="M60.4192996,57.2265603 C59.9679377,61.4779078 56.4202335,63.9818794 52.0059144,63.6756383 C49.0088716,63.4684752 46.2420233,61.1446454 46.1607782,57.9561348 C46.0840467,54.8892199 49.3925292,52.3086879 52.141323,51.682695 C55.2105837,50.9891489 59.9002335,51.9574113 60.4192996,57.2265603 Z" id="Shape" fill="#A0640A"/>
 +
          <polygon id="Shape" fill="#828278" points="70.2409339 47.8456738 45.7951751 47.8321631 41.2680156 58.2758865 36.1540856 57.7084397 42.8568093 41.9505319 73.08 41.0453191"/>
 +
          <path d="M67.5237354,1.35106383 C63.6420233,7.20567376 57.52607,16.4289362 53.7120623,22.3646099 C52.9131518,23.5985816 43.1140856,37.4244681 38.871284,45.6614539 C32.100856,58.8118085 30.065214,68.9718085 30.4217899,75.8352128 C30.5256031,77.7987589 31.6720623,86.4455674 35.1926848,90.4762411 C40.5819455,96.6460993 49.1171984,98.3439362 49.1171984,98.3439362 L88.101323,98.9519149 C88.101323,98.9519149 73.0709728,95.2049645 68.8236576,88.6432979 C66.2018685,84.4073518 64.6972498,79.5782183 64.4499611,74.6057447 C64.2017121,65.5356028 68.9364981,56.7401773 73.2379767,49.0886525 C77.7515953,41.0318085 101.141167,4.41347518 104.142724,1.27450355 L67.5237354,1.35106383 Z M65.0367315,55.6007801 L39.9410117,55.6503191 C39.9410117,55.6503191 43.2359533,47.7420922 44.2605447,46.156844 L69.9881712,46.1838652 L65.0367315,55.6007801 Z" id="Shape" fill="#3C3C32"/>
 +
          <path d="M105.009339,0.117092199 C104.106615,0.193652482 67.1761868,0.238687943 66.2554086,0.342269504 C65.672684,0.359634518 65.118068,0.5961072 64.7027237,1.00429078 L64.4905837,1.5537234 L64.5718288,2.13468085 C65.014002,2.5829418 65.6380033,2.80376036 66.2644358,2.73365248 C67.1671595,2.61656028 101.976187,2.61656028 102.896965,2.6570922 L105.009339,0.117092199 Z" id="Shape" fill="#000000"/>
 +
          <path d="M102.910506,2.6570922 L108.173385,13.7042908 C108.173385,13.7042908 109.477821,14.0870922 110.014942,13.2809574 C110.34062,12.7791842 110.514557,12.1944338 110.515953,11.5966312 L105.009339,0.117092199 L102.910506,2.6570922 Z" id="Shape" fill="#000000"/>
 +
          <path d="M105.167315,75.9928369 C104.068165,79.4225865 101.910062,82.4176413 99.0017121,84.5495745 C95.6345525,86.9634752 91.5136187,87.8416667 87.6499611,86.5806738 C84.5612698,85.5315713 82.0211635,83.2938719 80.5951751,80.3657801 C78.672589,76.4029647 78.3999749,71.8420125 79.8368872,67.6792908 C81.0448963,63.8592698 83.5761203,60.5929443 86.9774319,58.4650355 C90.136965,56.5465248 93.4228794,55.6278014 96.907393,56.7717021 C103.92607,59.0775177 107.875486,67.845922 105.167315,75.9928369 Z" id="Shape" fill="#3C3C32"/>
 +
          <path d="M100.780078,74.5156738 C100.062753,76.7595417 98.6517667,78.7191637 96.7494163,80.1135816 C94.6357747,81.7216131 91.8749024,82.2145437 89.3335409,81.4376241 C87.3171255,80.7538434 85.658046,79.2946471 84.7251362,77.3844326 C83.4700684,74.7956638 83.2931858,71.8164184 84.2331518,69.0979078 C85.0227025,66.6014455 86.6771553,64.4669513 88.9002335,63.0766667 C90.9719844,61.8246809 93.1114397,61.2212057 95.3953307,61.9687943 C99.9585992,63.4639716 102.526848,69.1924823 100.780078,74.5156738 Z" id="Shape" fill="#828278"/>
 +
          <rect id="Rectangle-path" fill="#000000" transform="translate(22.574701, 50.436036) rotate(9.030000) translate(-22.574701, -50.436036) " x="19.0743893" y="50.0712488" width="7.00062257" height="1"/>
 +
          <rect id="Rectangle-path" fill="#000000" transform="translate(25.566952, 55.703345) rotate(-23.700000) translate(-25.566952, -55.703345) " x="22.0666405" y="55.3385577" width="7.00062257" height="1"/>
 +
          <rect id="Rectangle-path" fill="#000000" transform="translate(26.232042, 45.087498) rotate(43.630000) translate(-26.232042, -45.087498) " x="22.7317304" y="44.7227106" width="7.00062257" height="1"/>
 +
          <path d="M93.5537743,112.376986 C93.5537743,112.376986 92.420856,116.880532 92.3982879,117.718191 C92.3757198,118.555851 92.7593774,118.555851 93.0798444,117.650638 C93.385599,116.943603 93.7981149,116.287481 94.303035,115.705106 L93.5537743,112.376986 Z" id="Shape" fill="#3C3C32"/>
 +
          <path d="M96.5508171,72.9574468 C96.5508171,72.9574468 97.3993774,68.4539007 92.6916732,68.4539007 C87.9839689,68.4539007 88.6294163,73.2051418 88.6294163,73.2051418 C89.0311284,77.8798227 93.7929961,120.159113 94.2217899,120.09156 C94.6505837,120.024007 94.6054475,116.939078 95.1245136,116.939078 C95.6435798,116.939078 95.7835019,120.469858 96.3025681,120.514894 C96.8216342,120.559929 96.5733852,116.939078 97.0518288,116.849007 C97.5302724,116.758936 97.7198444,119.776312 97.9545525,119.767305 C98.5232685,119.708759 96.5508171,72.9574468 96.5508171,72.9574468 Z" id="Shape" fill="#828278"/>
 +
          <path d="M98.5142412,112.048227 L98.5142412,110.638617 C97.6792218,110.557553 95.2915175,110.535035 94.4519844,110.449468 C94.4113619,110.647624 94.5557977,111.841064 94.5242023,112.079752 C94.6415564,112.057234 96.9750973,112.057234 98.5142412,112.048227 Z" id="Shape" fill="#F01446"/>
 +
          <path d="M96.2484047,109.301064 C96.9435019,110.773723 97.3136187,112.584149 95.7970428,113.597447 C95.3115436,113.950113 94.7051922,114.095166 94.1122017,114.000499 C93.5192112,113.905832 92.9884896,113.579253 92.6375097,113.09305 C91.486537,111.525816 91.734786,109.864007 93.0301946,109.192979 C94.0726029,108.788352 95.2356258,108.827413 96.2484047,109.301064 Z" id="Shape" fill="#000000"/>
 +
          <path d="M95.368249,110.314362 C95.7383658,111.097979 95.936965,112.066241 95.12,112.606667 C94.8615554,112.800302 94.5353656,112.880884 94.2162281,112.829936 C93.8970905,112.778988 93.6123838,112.60088 93.427393,112.336454 C92.8135409,111.498794 92.9489494,110.616099 93.6350195,110.255816 C94.1960185,110.035345 94.8234783,110.05654 95.368249,110.314362 Z" id="Shape" fill="#3C3C32"/>
 +
        </g>
 +
      </g>
 +
    </g>
 +
  </g>
 +
</svg></syntaxhighlight>
 +
{{collapse bottom}}
 +
{{Webサイト}}{{デフォルトソート:Scratch API (2.0)}}
 +
[[en:Scratch API (2.0)]]
 +
[[カテゴリ:Scratchウェブサイト]]
 +
[[カテゴリ:Scratch 2.0]]

2020年4月1日 (水) 07:04時点における最新版

Archive.png この項目またはセクションには、Scratch 3.0の現行バージョンに含まれていない機能が記載されています。これは歴史的な観点からのみ有用です。
Document stub.png この項目は、書きかけの項目です。この項目を加筆・訂正などしてくださる協力者を求めています。

このきじは ひらがなのページがありません。ごめんなさい。

Scratch APIを使うと、Scratchに関するさまざまなデータが取得できる。

各項目の「リクエスト例」のURLへアクセスすることで実際に試す事ができる。

目次

パラメーター

  • 一覧を返すJSON APIにおいて、?limit=数字にて、個数制限ができる。
  • 一部のAPIは、?offset=数字にて、範囲指定ができる。
Warning メモ: 実際に帰ってくるコードはインデントなどの成型はされていない。

api.scratch.mit.edu

api.scratch.mit.eduは、最新のScratch APIである。このAPIのURLは次の通り:

https://api.scratch.mit.edu

GET /

リクエスト例

GET https://api.scratch.mit.edu

応答例 {"website":"scratch.mit.edu","api":"api.scratch.mit.edu","help":"help@scratch.mit.edu"}

サーバーの状態

GET /health

Scratchのサーバーの状態を返す。

リクエスト例

GET https://api.scratch.mit.edu/health

応答例

ニュース

GET /news

トップページScratchニュースの情報を返す。

リクエスト例

GET https://api.scratch.mit.edu/news

応答例

GET /projects/count/all

共有されているプロジェクトの総数を返す。

リクエスト例

GET https://api.scratch.mit.edu/projects/count/all

応答例 {"count":22850560}

プロキシ

GET /proxy/featured

トップページに表示されているプロジェクトの情報を返す。

リクエスト例

GET https://api.scratch.mit.edu/proxy/featured

応答例

GET /proxy/users/<username>/activity

プロフィールページの「私が行ったこと」セクションの内容を返す。

リクエスト例

GET https://api.scratch.mit.edu/proxy/users/abee/activity

応答例

GET /proxy/users/<username>/activity/count (廃止)

未読メッセージの個数を返す。

リクエスト例

GET https://api.scratch.mit.edu/proxy/users/Paddle2See/activity/count

応答例

{
  "msg_count": 14
}

ユーザー

GET /users/<username>

ユーザーのアカウント情報を返す。

リクエスト例

GET https://api.scratch.mit.edu/users/apple502j

応答例

GET /users/<username>/favorites

お気に入り」を押したプロジェクトの詳細を配列で返す。

リクエスト例

GET https://api.scratch.mit.edu/users/ScratchCat/favorites

応答例

GET /users/<username>/followers

ユーザーの最新のフォロワーの配列を返す。

リクエスト例

GET https://api.scratch.mit.edu/users/thisandagain/followers

応答例

GET /users/<username>/following

ユーザーがフォローしているユーザーのうち、直近5件を配列で返す。

リクエスト例

GET https://api.scratch.mit.edu/users/Paddle2See/following

応答例

GET /users/<username>/messages/count

ユーザーの未読メッセージ数を返す。

リクエスト例

GET https://api.scratch.mit.edu/users/Paddle2See/messages/count

応答例

{
  "count": 14
}

GET /users/<username>/studios/curate/

ユーザーがキュレーションしているスタジオの情報を返す。

リクエスト例

GET https://api.scratch.mit.edu/users/ScratchCat/studios/curate/

応答例

GET /users/<username>/projects

ユーザーが共有したプロジェクトの情報を返す。

リクエスト例

GET https://api.scratch.mit.edu/users/ScratchCat/projects

応答例

プロジェクトの統計

GET /projects/<project_id>/

リクエスト例

GET https://api.scratch.mit.edu/projects/103530008

応答例: 上記に同じ。

GET /projects/<project_id>/remixes/

リクエスト例

GET https://api.scratch.mit.edu/projects/103530008/remixes/

応答例

GET /projects/<project-id>/studios/

リクエスト例

GET https://api.scratch.mit.edu/projects/103530008/studios/

応答例

コメントAPI

GET /projects/<project-id>/comments/

リクエスト例

GET https://api.scratch.mit.edu/projects/103530008/comments/

応答例

GET /project/<project-id>/comments/<parent-id>/replies/

リクエスト例

GET https://api.scratch.mit.edu/projects/203791193/comments/98229863/replies/

応答例

-->

教師用アカウントAPI

GET /classrooms/<classroom-id>/

リクエスト例

GET https://api.scratch.mit.edu/comments/project/203791193/98229863/

応答例

検索

qパラメータがない場合、人気のものが返るので注意。

GET /search/projects/?q=<word>

検索条件に当てはまるプロジェクトの情報を配列で返す。

リクエスト例

GET https://api.scratch.mit.edu/search/projects?q=Japan

応答例

GET /search/studios?q=<word>

検索条件に当てはまるスタジオの情報を配列で返す。

リクエスト例

GET https://api.scratch.mit.edu/search/studios?q=Wiki

応答例

ユーザー名API

GET /accounts/check_username/<word>

「username exists」(すでに存在)「bad username」(検閲)「invalid username」(無効)「valid username」(使用可能)を返す。

リクエスト例

GET https://scratch.mit.edu/accounts/check_username/UnavailableUser/

応答例

リクエストのエラー

存在しないリソースへアクセスすると、以下のような連想配列が返される。

{
  "code":"NotFound",
  "message":""
}


scratch.mit.edu/site-api

GET /comments/gallery/<studio_id>/

コメントを取得する。

リクエスト例

GET https://scratch.mit.edu/site-api/comments/gallery/5342/

GET /comments/project/<project_id>/

コメントを取得する。

リクエスト例

GET https://scratch.mit.edu/site-api/comments/project/103345354/

GET /comments/user/<username>/

コメントを取得する。

リクエスト例

GET https://scratch.mit.edu/site-api/comments/user/thisandagain/

PUT /users/followers/<username>/add/

フォローする。

リクエスト例

PUT https://scratch.mit.edu/site-api/users/followers/abee/add/

PUT /users/lovers/<project_id>/add/

「好き」を入れる。

リクエスト例

PUT https://scratch.mit.edu/site-api/users/lovers/154080544/add/

PUT /users/favoriters/<project_id>/add/

「お気に入り」にする。

リクエスト例

PUT https://scratch.mit.edu/site-api/users/favoriters/154080544/add/

PUT /users/all/<username>

「私について」「私が取り組んでいること」の変更。

リクエスト例

PUT https://scratch.mit.edu/site-api/users/all/apple502j

必要なヘッダー

X-CSRFTokenというヘッダーに、トークンを設定する。トークンはCookieの「scratchcsrftoken」を参照すればいい。また、X-Requested-WithにはXMLHttpRequestを指定する。

Cookieは、scratchcsrftokenとscratchsessionsidが必要だ。

varserver api (廃止)

クラウド変数のAPI。

GET /<project_id>

クラウド変数の情報を返す。

リクエスト例

GET https://scratch.mit.edu/varserver/16805451

応答例

{
  "variables": [
    {
      "name": "☁ たたかれた回数",
      "value": "2546"
    }
  ],
  "lists": []
}

api/v1 API (使用不可)

GET /

リクエスト例

GET https://scratch.mit.edu/api/v1/

応答例

{
  "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/"
  }
}

GET /project/<project_id>/

リクエスト例

GET https://scratch.mit.edu/api/v1/project/178040314

応答例

GET /project/set/<project_ids>/

リクエスト例

GET https://scratch.mit.edu/api/v1/project/set/169147225;178040314/

応答例

GET /user/<username>/

リクエスト例

GET https://scratch.mit.edu/api/v1/user/mres/

応答例

GET /user/set/<usernames>/

現在使用できない。

リクエスト例

GET https://scratch.mit.edu/api/v1/user/set/ScratchCat;thisandagain/

応答例

{
  "objects": [
    {
      "username": "ScratchCat",
      "userprofile": ""
    },
    {
      "username": "thisandagain",
      "userprofile": ""
    }
  ]
}

プロジェクト素材のAPI

プロジェクトのJSON

ブロックのハッキングに使うJSONと同じものが返る。

リクエスト例

GET https://projects.scratch.mit.edu/internalapi/project/102747129/get/

応答例

素材

リクエスト例

GET https://cdn.assets.scratch.mit.edu/internalapi/asset/5e037aca5446a7e57093e45fe6f18c9e.svg/get/

応答例