Turn a public Google Sheet into JSON
A Sheety API recebe a URL (ou o ID) de uma planilha pública do Google e devolve os dados em JSON. Sem API do Google, sem OAuth, sem chave — basta que a planilha esteja compartilhada publicamente.
The Sheety API takes the URL (or ID) of a public Google Sheet and returns the data as JSON. No Google API, no OAuth, no key — the sheet just has to be shared publicly.
Base: https://sheety.api.insyde.one — aberta, sem autenticação / open, no auth.
No Google Sheets: Compartilhar → Acesso geral → Qualquer pessoa com o link → Leitor. Sem isso a API não consegue ler (planilhas privadas exigem credenciais do Google).
In Google Sheets: Share → General access → Anyone with the link → Viewer. Without this the API can't read it (private sheets require Google credentials).
Cole a URL da planilha (do navegador) no parâmetro url:
Paste the spreadsheet URL (from your browser) into the url parameter:
https://sheety.api.insyde.one/?url=https://docs.google.com/spreadsheets/d/SHEET_ID/edit%23gid=0
Ou passe o id e a aba diretamente / Or pass the id and tab directly:
https://sheety.api.insyde.one/?id=SHEET_ID&gid=0
| Param | Descrição / Description |
|---|---|
url |
URL completa da planilha. O id e o gid são extraídos dela. / Full sheet URL; id and gid are extracted from it. |
id |
ID da planilha (alternativa à url). / Spreadsheet ID (alternative to url). |
gid |
ID da aba (o número em #gid= na URL). Padrão: 0 (primeira aba). / Tab id (the #gid= number). Default: 0 (first tab). |
sheet |
Nome da aba (alternativa ao gid). / Tab name (alternative to gid). |
format |
objects (padrão) ou matrix. / objects (default) or matrix. |
É obrigatório informar url ou id. / Either url or id is required.
format=objects (padrão / default) — a primeira linha vira as chaves; valores mantêm o tipo (números, datas):
// GET /?id=SHEET_ID&gid=0&format=objects
[
{ "Student Name": "Alexandra", "Major": "English" },
{ "Student Name": "Andrew", "Major": "Math" }
]
format=matrix — array de arrays, com o cabeçalho na primeira linha:
// GET /?id=SHEET_ID&gid=0&format=matrix
[
["Student Name", "Major"],
["Alexandra", "English"],
["Andrew", "Math"]
]
YYYY-MM-DD (ou YYYY-MM-DD HH:mm:ss).
YYYY-MM-DD (or YYYY-MM-DD HH:mm:ss).
curl:
curl "https://sheety.api.insyde.one/?id=SHEET_ID&gid=0"
JavaScript (fetch):
const BASE = 'https://sheety.api.insyde.one';
async function sheetToJson(sheetUrl, format = 'objects') {
const qs = new URLSearchParams({ url: sheetUrl, format });
const res = await fetch(`${BASE}/?${qs}`);
if (!res.ok) throw new Error((await res.json()).error);
return res.json();
}
const rows = await sheetToJson('https://docs.google.com/spreadsheets/d/SHEET_ID/edit#gid=0');
Python (requests):
import requests
resp = requests.get("https://sheety.api.insyde.one/", params={
"id": "SHEET_ID",
"sheet": "Vendas", # by tab name, instead of gid
"format": "objects",
})
resp.raise_for_status()
rows = resp.json()
Erros sempre retornam { "error": "..." }. / Errors always return { "error": "..." }.
| HTTP Code | Significado / Meaning | O que fazer / What to do |
|---|---|---|
400 |
Falta url/id, ou format inválido / Missing url/id, or invalid format |
Inclua url ou id; use objects ou matrix / Provide url or id; use objects or matrix |
404 |
Planilha privada, inexistente, ou aba/gid não encontrado / Sheet private, not found, or unknown gid/tab | Confira o compartilhamento público e o gid/sheet / Check public sharing and the gid/sheet |
502 |
Falha ao buscar no Google / Upstream fetch to Google failed | Tente novamente / Retry |