Quick Free Simple Logging Tool via API: How to Log Anything via a Google Apps Script and Google Sheets at No Cost

Do you ever just want to log something in an app you're building? Like someone fills out a form, or you get an SMS, or whatever?

I always wished there was a free way of logging things, just a free simple log with an API or entry form, so I made one myself, and now I'm sharing it. You can deploy this in 10 minutes or less.

Step 1: Copy and configure the app

Just copy this sheet. Go to Tools → Script editor, deploy the webapp, and give it permission to run as you.

Go to Tools → Script editor

Now update the code for ‘id’ with the id of your workbook, straight from the URL.

See the code in the URL? 1TQ0I etc. Copy that, all the way to the next ‘/’.

Now take that and paste it in here:

// id for your google sheet. You need to update this!
var id = '1TQ0I7YTUeSCdHYMKwff-byJamIYihHPTzkSa8z0H1kI';

Step 2: Publish the app

You need to deploy the app, and make sure anyone can access it.

Click on Deploy as web app
Publish it with the right permissions (execute as you; anyone can publish to it)

Step 3: Use the app

It’s now ready to use as a logger from your project (in Python, JS or whatever). You can test it this API call:

curl --header "Content-Type: application/json" --request POST --data '{"log":"This is not a test"}' https://script.google.com/macros/s/YOURSHEETCODE/exec -L

Where YOURSHEETCODE is whatever the code is for the google sheet you copied.

Data will end up magically in the Google Sheet.

I may expand on this later, but I reckon this is a pretty good start!