An open API to save your forms data to a Google Spreadsheet.
Make a POST
request to https://sheetforms.co/api
like this:
async function handleSubmit() {
await fetch("https://sheetforms.co/api", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
spreadsheetId: "YOUR_SPREADSHEET_ID",
values: ["ADD", "SOME", "DATA", "HERE"],
}),
});
}
And remember to set sheetforms.co as Editor
in your spreadsheet sharing options.
# sheetforms.co client email
sheetforms@sheetforms.iam.gserviceaccount.com
🥳 That's it.
Visit sheetforms.co for a live example.
The API takes a POST
request with the following body
:
spreadsheetId
: The ID of the spreadsheet to save the data to.values
: An array of values to save to the spreadsheet.range
: (optional) The range to save the data to.
This repository contains a Gatsby site and a serverless function (to communicate with the Google Sheets API), both hosted on Vercel.
Use the button below to easily deploy a copy to Vercel, and configure with your own GOOGLE_CLIENT_EMAIL
, GOOGLE_PRIVATE_KEY
and an optional SPREADSHEET_ID
environment variables.