Instantly turn any Google Sheet into RESTful API.

Just share it then consume API ✨🦄.

Features

Launch your API in seconds

Don't waste time configuring a server. Use common service like Google Sheet for extremely fast setup.

Private data, public API

Turn private sheet into working API. Avoid unwanted access from public sharing.

Focus on your business (err.. code)

Time spending on servers is now available for app experience and business development.

Quick Start Guide

1. Share spreasheet

2. Getting spreadsheetId & sheetName

3. Access the API

https://api.sheetson.com/v1/sheets/:sheetName?spreadsheetId=:spreadsheetId

https://api.sheetson.com/v1/sheets/LivingQuality?spreadsheetId=1h-Eet6qTsPrdL5IVwiAvPXH47wjEludJVpwrpdCWEuM

Documentation

Basics

Sheetson REST API operates on this base path: https://api.sheetson.com/v1/sheets

Every request must include spreadsheetId query or header X-Sheetson-Spreadsheet-Id, otherwise, Sheetson can't tell which Spreadsheet to work on.

All POST and PUT requests must include Content-Type: application/json in their header.

Each sheet in a spreadsheet document should be treated as a database table. In Sheetson API, the table-level operations operate on a resource based on just the sheet name. For example, if the sheet name is Game, the request URL should be:

https://api.sheetson.com/v1/sheets/Game

The operations specific to a single row are available as a nested URL. For example, operations specific to the Game table with the rowIndex equal to 999 would use the object URL:

https://api.sheetson.com/v1/sheets/Game/999

Creating A Row

To create a new row, send a POST request to the sheet URL containing the contents of the object. For example, to create a new row with gameScored = 23 and playerName = Neymar, try below example:

cURL
curl -X POST \ 
  -H "X-Sheetson-Spreadsheet-Id: mySpreadsheetId" \ 
  -H "Content-Type: application/json" \ 
  -d '{"playerName": "Neymar", "gameScored": 23}' \ 
  https://api.sheetson.com/v1/sheets/Game

In case of success, HTTP response is a 201 Created with below body containing a rowIndex and requested data:

{
  "rowIndex": "123",
  "playerName": "Neymar",
  "gameScored": "23"
}
Attention
You need to share edit access to our service account email below so that we can append a new row. [email protected]

Retrieving A Row

You can retrieve a single row by its rowIndex by calling request to a sub resource of the sheet. For example, to retrieve row we created above:

curl -X GET \ 
  -H "X-Sheetson-Spreadsheet-Id: mySpreadsheetId" \ 
  -H "Content-Type: application/json" \ 
  -d "Content-Type: application/json" \ 
  https://api.sheetson.com/v1/sheets/Game/123

The returned body contains data in the sheet and a rowIndex field

{
  "rowIndex": "123",
  "playerName": "Neymar",
  "gameScored": "23"
}

Updating A Row

To change data of a single row that already exists, send a PUT request to the rowIndex URL. Only fields included in the request are updated. Remaining data is left untouched. For example, to change a gameScored field of above row:

curl -X PUT \ 
  -H "X-Sheetson-Spreadsheet-Id: mySpreadsheetId" \ 
  -d '{"gameScored": 34}' \ 
  https://api.sheetson.com/v1/sheets/Game/123

Deleting A Row

To delete a row from the sheet, send a DELETE request to the row resource.

curl -X DELETE \ 
  -H "X-Sheetson-Spreadsheet-Id: mySpreadsheetId" \ 
  https://api.sheetson.com/v1/sheets/Game/123
Attention
Once a row is deleted, the rowIndex for later records is decreased by 1. Be careful if you rely upon this field for operation.

Retrieving Rows

To retrieve a collection of rows, send a GET request to the sheet endpoints

cURL
curl -X GET \ 
  -H "X-Sheetson-Spreadsheet-Id: mySpreadsheetId" \ 
  https://api.sheetson.com/v1/sheets/Game
The success response is an object with results field containing a JSON array of the Game rows.
{
  "results": [
    {
      "playerName": "Ronaldo",
      "gameScored": "38"
    },
    {
      "playerName": "Messi",
      "gameScored": "12"
    }
  ]
}
Request parameters

There are several parameters you can include in request URL in order to configure results returned.

ParameterDescription
limitLimit the number of rows returned by the query. Default is 24 if not specified. Maximum is 100.
pageUse with limit to paginate through results. First page is 0
keysRestrict what fields should be returned. Separated by comma.

FAQs

What is Sheetson?

Sheetson is a tool to turn literally any Google sheet into JSON API with little or without any configuration.

What is the story of Sheetson?

Sometimes, when you want to prototype your ideas but afraid of going through setting up backend servers. It is overkill for early stage projects. That's why Sheetson came out of life to make your life easier. Sheetson was first developed with simple CRUD API, but it is now evolving with more capability.

Is there any limitation?

There is none for now, but please don't try to abuse the system.

Can I use this for my production projects?

I am using this for my simple production projects as well, but use it at your own risks.

Made with ❤️ by @ralphilius