If you’ve ever used the Google Sheets API for a tiny project, you know it’s overkill.
Here’s the fast path: publish your sheet to CSV and turn it into JSON with filters & sorting—no Apps Script, no backend.
What we’ll build
- A live JSON endpoint from a Google Sheet
- Filtering (e.g.
status:active,price<20) and sorting (-price:num) - A quick fetch example in JS & Python
Step 1 — Publish your Google Sheet to CSV
1) Open your Sheet → File → Share → Publish to web
2) Pick the sheet/tab, choose CSV, press Publish
3) Copy the link (it must contain /pub and output=csv)
Step 2 — Paste it into SheetsJSON
Go here: https://sheetsjson.onrender.com/
Paste the CSV link and click Fetch JSON.
(There’s a free tier; you can also try the prefilled Examples: https://sheetsjson.onrender.com/examples)
Step 3 — Use it from your app
cURL
bash
curl -H "x-api-key: YOUR_KEY" \
"https://sheetsjson.onrender.com/v1/fetch?csv_url=YOUR_PUBLISHED_CSV_URL&filter=status:active&order=price:num&limit=10"
-----------------------------------------------------------------
const url = new URL("https://sheetsjson.onrender.com/v1/fetch");
url.searchParams.set("csv_url", "YOUR_PUBLISHED_CSV_URL");
url.searchParams.append("filter", "status:active");
url.searchParams.set("order", "price:num");
url.searchParams.set("limit", "10");
const res = await fetch(url, { headers: { "x-api-key": "YOUR_KEY" } });
const data = await res.json();
console.log(data);
------------------------------------------------------------------
import requests
params = {
"csv_url": "YOUR_PUBLISHED_CSV_URL",
"filter": "status:active",
"order": "price:num",
"limit": 10
}
r = requests.get("https://sheetsjson.onrender.com/v1/fetch",
params=params,
headers={"x-api-key": "YOUR_KEY"})
print(r.json())
--------------------------------------------------------------------
Filters & sorting cheatsheet
Strings: col:value, col!=v, col~v (contains), col^v (starts), col$v (ends)
Numbers: col>n, col>=n, col<n, col<=n
Sort: order=price:num (asc), order=-price:num (desc)
Select columns: select=name,email
Pagination: limit=50, offset=0
Docs & pricing: https://sheetsjson.onrender.com/pricing
Examples: https://sheetsjson.onrender.com/examples
Top comments (0)