Public
Like1
sheet-exporter
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v128View latest version
A lightweight HTTP API that converts public Google Sheets into JSON or raw CSV.
GET /json/:sheetId
GET /json/:sheetId?gid=123456789
Returns a JSON object with link (a link back to the source sheet) and data
(an array of objects keyed by column headers).
curl https://sheet-json.val.run/json/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms
{ "link": "https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms/edit?gid=0", "data": [ { "name": "Alice", "age": "30" }, { "name": "Bob", "age": "25" } ] }
GET /csv/:sheetId
GET /csv/:sheetId?gid=123456789
Returns the raw CSV text exported from Google Sheets.
curl https://sheet-json.val.run/csv/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms
:sheetId— The Google Sheet ID from the URL (e.g.,1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms)gid(optional) — The tab/sheet ID. Defaults to0(first tab). Find this in the sheet URL after#gid=.
- The Google Sheet must be publicly accessible ("Anyone with the link" sharing).
- Private sheets will return an error.
| Route | Description |
|---|---|
GET / | Health check — returns { "ok": true } |
GET /json/:sheetId | Fetch sheet as parsed JSON |
GET /csv/:sheetId | Fetch sheet as raw CSV text |
GET /source | Redirect to val source code |
Rendering mermaid diagram...