• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
nbbaier

nbbaier

sheet-exporter

Exports public Google Sheets to CSV or JSON
Public
Like
1
sheet-exporter
Home
Code
3
README.md
H
main.ts
H
new-file-9638.ts
Connections
1
Environment variables
Branches
1
Pull requests
Remixes
History
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.
Sign up now
Code
/
README.md
Code
/
README.md
Search
…
Viewing readonly version of main branch: v135
View latest version
README.md

sheet-to-json

A lightweight HTTP API that converts public Google Sheets into JSON or raw CSV.

Usage

Get JSON

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 raw CSV

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

Parameters

  • :sheetId — The Google Sheet ID from the URL (e.g., 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms)
  • gid (optional) — The tab/sheet ID. Defaults to 0 (first tab). Find this in the sheet URL after #gid=.

Requirements

  • The Google Sheet must be publicly accessible ("Anyone with the link" sharing).
  • Private sheets will return an error.

Endpoints

RouteDescription
GET /Health check — returns { "ok": true }
GET /json/:sheetIdFetch sheet as parsed JSON
GET /csv/:sheetIdFetch sheet as raw CSV text
GET /sourceRedirect to val source code

Architecture

Rendering mermaid diagram...
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
AboutAlternativesPricingBlogNewsletterCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.