SQL functions in Google Sheets to fetch data from Datasette
AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.
Why it matters
Anyone can now pipe live query results from a Datasette-hosted database straight into Google Sheets without writing an app, cutting manual copy-paste reporting workflows.
Simon Willison has published notes and an example sheet showing three ways to pull data from Datasette, a free tool that hosts databases you can query online, into Google Sheets. The simplest uses a built-in spreadsheet function that imports table data automatically. If the API requires a secret access token, a small custom script is needed instead. Data analysts who currently export and paste data by hand can now have live results refresh into their spreadsheets.
Willison documents three integration patterns for pulling live data from a Datasette instance into Google Sheets, with a working example sheet. The trade-off matters: the built-in importdata() function cannot send API tokens, so authenticated APIs require a Google Apps Script. Teams doing internal reporting or dashboards save effort; there is no product to buy, just patterns to copy. It is a low-cost workflow improvement for spreadsheet-centric teams.
Willison describes three approaches: calling importdata() against a Datasette JSON or CSV endpoint, wrapping it in a named function for reuse, and using Google Apps Script with UrlFetchApp when the endpoint requires an API token in an HTTP header, a capability importdata() lacks. A demonstration Google Sheet covering all three methods is linked. No performance figures, authentication details beyond the token limitation, or pagination handling are given.
Read the original
This summary exists to save you time, not to replace the source.
Key terms
Was this summary useful?
One click, anonymous. It tells us which summaries to re-run.
Related reading
Code-driven AI illustrations are more useful than images from dedicated image models
Code-driven AI illustrations let designers edit assets directly in code, saving time on iteration and ensuring consistency, which is a game-changer for teams that need rapid, reusable visual content.
A hierarchical note-taking app for building large personal knowledge bases
Trilium lets users build and navigate massive personal knowledge bases without duplicating content, saving time on organization and retrieval.
Desktop apps in Go with native UI or web frontend
Go developers can now ship cross-platform desktop and mobile apps in a single small binary without cgo or heavy runtimes, cutting build complexity and deployment size.
OpenBitFun: an agent workspace with four harness modes and phone remote control
OpenBitFun lets agents run on any machine and be controlled from a phone, eliminating the need to choose between local power and remote access, saving developers time switching contexts.
Intel One Mono: a monospaced font designed with low-vision developers
Developers with low vision or eye fatigue can read code more clearly, reducing errors and improving productivity.