Lesson summary

Convert Google Sheets into a REST API

Learn Google Sheets & Excel Spreadsheets

Watch the video

What this is

A walkthrough of turning a private Google Sheet into a REST API with Google Apps Script. External web forms and services can read and write data without making the sheet public or granting third parties direct sheet access.

Who it is for

Spreadsheet creators, developers, and no-code builders who want to use Google Sheets as a backend database or API endpoint.

What you will be able to do

Build a WORKOUTS log plus a SUMMARY total, implement doPost and doGet, deploy the script as a web app, test writes and reads, pull the live total into another sheet, and submit entries from a simple online form.

Takeaways

  1. You do not have to share the sheet or set it to “Anyone with the link.” The web app talks to the sheet while the file stays private.
  2. doPost(e) is for data entry. Read URL parameters such as count and type from e.parameter, insert a new top row, and write the values.
  3. doGet(e) is for reading. Fetch a cell (here, SUMMARY!B1) with getValue() and return it as HTTP text with ContentService.createTextOutput().
  4. Successful writes can return an explicit HTTP 200 via ContentService.createTextOutput(200).
  5. Deploy as a Web App: Execute as “Me,” Who has access “Anyone.” Authorize once.
  6. After you change the script, create a new deployment so you get a working URL. The video hits a method-name typo (insertRowsBefore vs insertRowBefore) and shows this re-deploy step.
  7. No-code tools such as Carrd can POST to the same URL if field IDs match the script parameters (count, type).
  8. A second Google account can pull the live total with =IMPORTDATA() pointed at the GET URL.

In the video