mirror of
https://github.com/scratchfoundation/scratch-rest-api.git
synced 2024-12-04 21:21:10 -05:00
Move stuff to the wiki
and leave just a `README` here
This commit is contained in:
parent
0c80214235
commit
5da7e1eff0
8 changed files with 10 additions and 207 deletions
20
-.md
20
-.md
|
@ -1,20 +0,0 @@
|
||||||
### GET `/`
|
|
||||||
|
|
||||||
Provides basic information about the API and related support materials. It is intended as a "catch all" for individuals who are exploring or testing the API for the first time.
|
|
||||||
|
|
||||||
#### Request URL
|
|
||||||
`https://api.scratch.mit.edu/`
|
|
||||||
|
|
||||||
#### Example Request
|
|
||||||
```bash
|
|
||||||
curl -X GET "https://api.scratch.mit.edu/"
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Example Response
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"api": "api.scratch.mit.edu",
|
|
||||||
"help": "help@scratch.mit.edu",
|
|
||||||
"website": "scratch.mit.edu"
|
|
||||||
}
|
|
||||||
```
|
|
47
Following.md
47
Following.md
|
@ -1,47 +0,0 @@
|
||||||
### GET `/users/:id/following`
|
|
||||||
|
|
||||||
Returns an array of users that the specified user is following.
|
|
||||||
|
|
||||||
#### Request URL
|
|
||||||
`https://api.scratch.mit.edu/users/:id/following`
|
|
||||||
|
|
||||||
#### Request Parameters
|
|
||||||
* **:id** – the username of the user for whom to get the following list
|
|
||||||
|
|
||||||
#### Example Request
|
|
||||||
```bash
|
|
||||||
curl -X GET "https://api.scratch.mit.edu/users/mres/following"
|
|
||||||
curl -X GET "https://api.scratch.mit.edu/users/mres/following?limit=2"
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Example Response
|
|
||||||
```json
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"id":4373272,
|
|
||||||
"username":"FunKitten2006",
|
|
||||||
"history":{
|
|
||||||
"joined":"2014-06-22T22:52:19.000Z",
|
|
||||||
"login":"2015-12-04T15:50:56.000Z"
|
|
||||||
},
|
|
||||||
"profile":{
|
|
||||||
"id":4373272,
|
|
||||||
"avatar":"437/3272.png",
|
|
||||||
"status":"I am working on making Scratch videos to help Scratchers. I now have a new studio called \nTutor Help Studio. I hope this will help a lot of kids on Scratch. Thank you Scratch Team and thanks too you.","bio":"I love creating stuff on Scratch."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id":11756170,
|
|
||||||
"username":"cartoonnetwork",
|
|
||||||
"history":{
|
|
||||||
"joined":"2015-09-09T18:30:33.000Z",
|
|
||||||
"login":"2015-12-04T15:27:05.000Z"
|
|
||||||
},
|
|
||||||
"profile":{
|
|
||||||
"id":11756170,
|
|
||||||
"avatar":"1175/6170.png",
|
|
||||||
"status":"We’re working on our We Bare Bears projects: playing hide and seek with the bears, showing off our sweet b-ball moves, and creating interactive #bearstack stories! Have fun remixing our projects!","bio":"We’re home to a bunch of creative and fun programs like Adventure Time and We Bare Bears, that not only encourage kids to think outside the box, but way outside of their own world."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
```
|
|
28
Health.md
28
Health.md
|
@ -1,28 +0,0 @@
|
||||||
### GET `/health`
|
|
||||||
|
|
||||||
Used by the load balancer and related monitoring systems to return the status of a given API node.
|
|
||||||
|
|
||||||
#### Request URL
|
|
||||||
`https://api.scratch.mit.edu/health`
|
|
||||||
|
|
||||||
#### Example Request
|
|
||||||
```bash
|
|
||||||
curl -X GET "https://api.scratch.mit.edu/health"
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Example Response
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"uptime":3083522,
|
|
||||||
"load":[
|
|
||||||
0.0537109375,
|
|
||||||
0.0458984375,
|
|
||||||
0.0478515625
|
|
||||||
],
|
|
||||||
"sql":{
|
|
||||||
"started":"2015-11-24T17:26:38.842Z",
|
|
||||||
"min":0,
|
|
||||||
"max":20
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
17
Home.md
17
Home.md
|
@ -1,17 +0,0 @@
|
||||||
Welcome to the Scratch REST API! Here you can find information on how to read and write data from and to [Scratch](https://scratch.mit.edu) programmatically. To get started, here's some general information on how our API works, and its current status.
|
|
||||||
|
|
||||||
## Getting Started
|
|
||||||
The Scratch REST API is interactable through HTTPS requests. Though some of our endpoints require that you are an authenticated Scratch user to access, you can easily get started and see how the API works with some of our public enpoints. For example:
|
|
||||||
|
|
||||||
`curl -X GET https://api.scratch.mit.edu/users/mres/following`
|
|
||||||
|
|
||||||
will return a JSON object containing the list of people user `mres` is following. All API endpoints will fall under the `api.scratch.mit.edu` domain.
|
|
||||||
|
|
||||||
## Query Parameters
|
|
||||||
The API provides two optional query parameters that can be used to limit and/or paginate routes that return an array. `limit` defaults to `20` items which is the maximum number of items that the API will return at any one time. `offset` defaults to `0` but can be any number up to `9007199254740991` (the maximum 64-bit floating point value).
|
|
||||||
|
|
||||||
## Rate Limits
|
|
||||||
coming soon!
|
|
||||||
|
|
||||||
## Authentication
|
|
||||||
coming soon!
|
|
41
News.md
41
News.md
|
@ -1,41 +0,0 @@
|
||||||
### GET `/news`
|
|
||||||
|
|
||||||
Returns the latest news items from the Scratch's [Tumblr](blogscratch.tumblr.com) account. This route parses each Tumblr post and returns an array of objects suitable for rendering on the Scratch splash page.
|
|
||||||
|
|
||||||
#### Request URL
|
|
||||||
`https://api.scratch.mit.edu/news`
|
|
||||||
|
|
||||||
#### Example Request
|
|
||||||
```bash
|
|
||||||
curl -X GET "https://api.scratch.mit.edu/news"
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Example Response
|
|
||||||
```json
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"copy": "Create a project to celebrate the 150th Anniversary of Alice in Wonderland for the new Scratch Design Studio!",
|
|
||||||
"headline": "New Scratch Design Studio!",
|
|
||||||
"id": 133670008323,
|
|
||||||
"image": "https://40.media.tumblr.com/1c34c83f9dcaee31422e88bd88de4f00/tumblr_inline_nwuaehA1SR1szpavb_540.png",
|
|
||||||
"stamp": "2015-11-21T18:46:35.000Z",
|
|
||||||
"url": "https://scratch.mit.edu/studios/1672164/"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"copy": "We\u2019re launching the first of many upgrades to the Scratch website! Learn more\u2026",
|
|
||||||
"headline": "Updates to Scratch Homepage!",
|
|
||||||
"id": 131962619508,
|
|
||||||
"image": "https://36.media.tumblr.com/b8e8bc37f38a135a0f873a6fe7788701/tumblr_inline_nwuak8hOun1szpavb_540.png",
|
|
||||||
"stamp": "2015-09-26T18:12:32.000Z",
|
|
||||||
"url": "https://scratch.mit.edu/discuss/topic/163894/"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"copy": "Want to know what\u2019s happening on Scratch? Check out the latest video update!",
|
|
||||||
"headline": "Scratch Video Update: Episode 11",
|
|
||||||
"id": 130146748093,
|
|
||||||
"image": "https://40.media.tumblr.com/b563e9425dfca8ac53396d997db312ba/tumblr_inline_nwua1f4Chy1szpavb_540.png",
|
|
||||||
"stamp": "2015-09-29T18:55:34.000Z",
|
|
||||||
"url": "https://scratch.mit.edu/discuss/topic/154790/"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
```
|
|
12
README.md
12
README.md
|
@ -1,2 +1,10 @@
|
||||||
# scratch-rest-api
|
# Scratch REST API
|
||||||
Documentation for how to interact with the Scratch REST API
|
Welcome to the Scratch REST API! Here you can find information on how to read and write data from and to [Scratch](https://scratch.mit.edu) programmatically.
|
||||||
|
|
||||||
|
### This API is in development
|
||||||
|
Right now, we're in the process of building the next version of Scratch. Part of that includes building this REST API to allow people to access the site's data directly. It might take some time to complete the entire thing, but we will continue to update this repo with new documentation as we build new parts of the API.
|
||||||
|
|
||||||
|
### To Get Started
|
||||||
|
Head over to the [wiki](https://github.com/LLK/scratch-rest-api/wiki) to find out more information about how to use this API, and what features are currently available.
|
||||||
|
|
||||||
|
Also make sure to check out Scratch's [open source web client](https://github.com/LLK/scratch-www) too!
|
||||||
|
|
20
Root.md
20
Root.md
|
@ -1,20 +0,0 @@
|
||||||
### GET `/`
|
|
||||||
|
|
||||||
Provides basic information about the API and related support materials. It is intended as a "catch all" for individuals who are exploring or testing the API for the first time.
|
|
||||||
|
|
||||||
#### Request URL
|
|
||||||
`https://api.scratch.mit.edu/`
|
|
||||||
|
|
||||||
#### Example Request
|
|
||||||
```bash
|
|
||||||
curl -X GET "https://api.scratch.mit.edu/"
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Example Response
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"api": "api.scratch.mit.edu",
|
|
||||||
"help": "help@scratch.mit.edu",
|
|
||||||
"website": "scratch.mit.edu"
|
|
||||||
}
|
|
||||||
```
|
|
32
Users.md
32
Users.md
|
@ -1,32 +0,0 @@
|
||||||
### GET `/users/:id`
|
|
||||||
|
|
||||||
Returns basic information about the specified user based on the provided username.
|
|
||||||
|
|
||||||
#### Request URL
|
|
||||||
`https://api.scratch.mit.edu/users/:id`
|
|
||||||
|
|
||||||
#### Request Parameters
|
|
||||||
* **:id** – the username of the user for whom to get information
|
|
||||||
|
|
||||||
#### Example Request
|
|
||||||
```bash
|
|
||||||
curl -X GET "https://api.scratch.mit.edu/users/mres"
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Example Response
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"history": {
|
|
||||||
"joined": "2007-03-07T03:50:14.000Z",
|
|
||||||
"login": "2015-11-25T06:16:12.000Z"
|
|
||||||
},
|
|
||||||
"id": 167,
|
|
||||||
"profile": {
|
|
||||||
"avatar": "0/0167.png",
|
|
||||||
"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",
|
|
||||||
"id": 29,
|
|
||||||
"status": "I'm working on new technologies and activities to support the four P's of creative learning: Projects, Peers, Passion, and Play"
|
|
||||||
},
|
|
||||||
"username": "mres"
|
|
||||||
}
|
|
||||||
```
|
|
Loading…
Reference in a new issue