Documentation
Getting started
Recommended
- Create a service account
- Share a Google Sheet with the Service Account email address.
- Log in here with Google.
- Go to Settings and add your Google Service Account JSON.
- Go to this app’s Sheets section and click New. Add the Google Sheet ID and save.
- Visit the newly created API endpoint. You should see your Google Sheet in JSON format.
Alternate 1
- Share your Google Sheet with sheets-api-service-account@sheets-api-402810.iam.gserviceaccount.com .
- Go to this app’s Sheets section and click New. Add the Google Sheet ID and save.
- Visit the newly created API endpoint. You should see your Google Sheet in JSON format.
Alternate 2
- Share your Google Sheet with anybody with the link.
- Go to this app’s Sheets section and click New. Add the Google Sheet ID and save.
- 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.
Search
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",
}]
}