Planilha do Google → JSON

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.

1. Deixe a planilha pública / Make the sheet public

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).

2. Formato da chamada / Request format

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

3. Parâmetros / Parameters

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.

4. Formatos de saída / Output formats

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"]
]
Limpeza automática: colunas e linhas em branco do grid são descartadas, e datas voltam como YYYY-MM-DD (ou YYYY-MM-DD HH:mm:ss).
Auto-cleanup: blank grid columns and rows are dropped, and dates come back as YYYY-MM-DD (or YYYY-MM-DD HH:mm:ss).

5. Exemplos por linguagem / Examples by language

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()

6. Códigos de erro / Error codes

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

7. Limitações / Limitations

Dica: a resposta é cacheada por ~1 min. Edições na planilha podem levar até um minuto para aparecer.
Tip: responses are cached for ~1 min. Edits to the sheet can take up to a minute to show up.

Back to Insyde APIs