Menu

How to read a public Google Sheet as JSON without OAuth or an API key (2026)
📰

How to read a public Google Sheet as JSON without OAuth or an API key (2026)

DEV Community: api·feveroliang·11 days ago
#OH8LJSSM
#devtoapi#devto#dev#gid#sheet
Reading 0:00
15s threshold

Short answer: for a sheet shared as "Anyone with the link can view", call https://docs.google.com/spreadsheets/d/SHEET_ID/gviz/tq?tqx=out:json&headers=1 . It answers without a login or a key. The response is JSON wrapped in a JavaScript call, so strip the wrapper first. Below is working code, four traps we measured on 8 November 2026 (Bangkok time; the image shows the same run in UTC), and a ready-made Actor if you would rather not handle them yourself.

The rows in this post come from Google's own Sheets API sample sheet . Its names are fictional.

Do it yourself in 10 lines

const id = ' 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms ' ; const url = `https://docs.google.com/spreadsheets/d/ ${ id } /gviz/tq?tqx=out:json&headers=1` ;

const text = await ( await fetch ( url )). text (); // The body is /*O_o*/ google.visualization.Query.setResponse({...}); const { table } = JSON . parse ( text . slice ( text . indexOf ( ' { ' ), text . lastIndexOf ( ' } ' ) + 1 ));

const cols = table . cols . map (( c ) => c .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.