itchy-api docs


This is the official documentation for the itchy-api project, which is an incomplete wrapper for the Scratch API that runs on Vercel's Serverless Functions. You can view the project on GitHub here. We're open for contributions, so feel free to fork the repository and make a pull request! Many thanks to towerofnix/scratch-api-unofficial-docs for some object definitions.


GET /api/explore

Returns an array of project objects.

Query params:




GET /api/frontpage

Returns an array of project objects.

Query params:




GET /api/project

Returns a single project object OR a standard comment object, depending on the value of the comments parameter.

Query params:




GET /api/user

Returns a single user object OR a non-standard comment object, depending on the value of the comments parameter.

Query params:




Returns a single Qwant search object.

Query params:




GET /api/csrf

Returns a single csrf token from the API.




GET /api/image

Returns an object containing a data value (the base64 data of an image) and a requested value (the original requested URL).

Query params:




POST /api/auth

Returns a session object. This requires the body header to be set (for security reasons) instead of easier query parameters.

Example body header:

  {
    "username": "mycoolusername",
    "password": "$uper_secr3t-password"
  }




Non-standard comment object

The non-standard comment object was created because user and studio comments still run on the depreciated site-api interface that returns comments as HTML. The itchy-api wrapper compiles that HTML into custom JSON objects and returns that instead. A non-standard comment object looks like this:

  {
    "id": "12345678",
    "author": {
      "username": "griffpatch",
      "image": "//scratch.mit.edu/griffpatch.png",
  }
    "content": "hello",
    "timestamp": "2020-12-20t22:17:06z",
    "replies": [
        {
            "id": "12345679",
            "author": {
                "username": "will_wam",
                "image": "//scratch.mit.edu/will_wam.png"
            "content": "@griffpatch what is up",
            "timestamp": "2020-12-20t22:37:38z"
        }
    ]
  }
      




To-do

While itchy-api is largely functional for now, there is still much to work on: