Free Sheets API

Documentation

Getting started

  1. Create a service account
  2. Share a Google Sheet with the Service Account email address.
  3. Log in here with Google.
  4. Go to Settings and add your Google Service Account JSON.
  5. Go to this app’s Sheets section and click New. Add the Google Sheet ID and save.
  6. Visit the newly created API endpoint. You should see your Google Sheet in JSON format.

Alternate 1

  1. Share your Google Sheet with sheets-api-service-account@sheets-api-402810.iam.gserviceaccount.com .
  2. Go to this app’s Sheets section and click New. Add the Google Sheet ID and save.
  3. Visit the newly created API endpoint. You should see your Google Sheet in JSON format.

Alternate 2

  1. Share your Google Sheet with anybody with the link.
  2. Go to this app’s Sheets section and click New. Add the Google Sheet ID and save.
  3. Visit the newly created API endpoint. You should see your Google Sheet in JSON format.

Advanced

Authentication

If you've assigned an API key, place it into the x-api-key header. Alternately, you can put it in the _x-api-key search parameter. Note the underscore.

GET /api/sheet/{sheetuid}/search?search1=param1&searchN=paramN

Examples

Find rows with id > 5 and c = 9: GET /api/sheet/{sheetuid}/search?id=>5&c=9

Find rows with id >= 3 and id < 6: GET /api/sheet/{sheetuid}/search?id=>=3&id=<6

Update

PATCH /api/sheet/{sheetuid}

Example

Update rows with id >= 3 and id < 6

Body:

{
  "query": {
    "logic": "and", // "and" is the default logic
    "rules": {
      "id": [">=3","<6"]
    }
  },
  "update": {
    "column_b": "value_b",
    "column_c": "value_c",
  }
}
    

Delete

DELETE /api/sheet/{sheetuid}

Example

Update rows with id >= 3 and id < 6

Body:

{
  "query": {
    "logic": "and", // "and" is the default logic
    "rules": {
      "id": [">=3","<6"]
    }
  }
}
    

Insert

PUT /api/sheet/{sheetuid}

Example

Body:

{
  "insert": [{
     "column_a": "value_a",
     "column_b": "value_b",
  },{
     "column_a": "value_a",
     "column_b": "value_b",
  }]
}