Turn a Google Spreadsheet
into a JSON API
Connect Google sheets to CRM, API, Website, WordPress, any application or tool.
Create Free API Use Cases Documentation[
{
"id": "1",
"name": "Tom",
"age": "15",
"comment": ""
},
{
"id": "2",
"name": "Alex",
"age": "24",
"comment": ""
}
]
Easy to use and implement
SheetDB will turn your sheets into a JSON API, easy to integrate with other tools and all programming languages. We have prepared many libraries working with common tools, other APIs and programming languages.
If you want to use a different API, e.g. in your CRM, you can use our API to turn the spreadsheet into JSON API.
Use Cases and ExamplesGoogle Sheets JSON API
You can read and edit your spreadsheet with GET, POST, PUT and DELETE requests with just a few lines of code.
DocumentationUse Google Sheets as a database
A spreadsheet is the simplest database for landing pages, prototypes, small CRMs, product catalogs and any content that non-developers need to edit. The sheet is your admin panel, and SheetDB gives your website or app a JSON REST API to query, insert, update and delete rows.
No OAuth, no Google Cloud project, no server to maintain. Our guide explains how to structure the sheet, which limits to expect and when you should reach for a real database instead.
How to use Google Sheets as a databaseImport JSON to Google Sheets
Google Sheets cannot open a JSON file on its own. Paste your JSON or a JSON URL into SheetDB and get a ready spreadsheet in your Drive, with the object keys as columns and a REST API for the sheet at the same time.
The guide also shows the Apps Script alternative and how to go the other way: read any Google Sheet as JSON and keep both in sync.
How to import JSON into Google SheetsExamples and code samples
Pick your language, copy the snippet and read live data from the demo sheet. Every example calls the same endpoint.
No coding skills? Use the HTML snippet
Paste a small HTML snippet with our Handlebars library and the rows of your sheet show up on the page. Works in WordPress and any site builder.
Give your clients a CMS they already know
Build the site, hand over a Google Sheet. Your clients edit rows and the website updates. No admin panel to build or train anyone on.
Developers first, in any language
Plain JSON over HTTPS with search, sorting, pagination and batch writes. We handle Google tokens and permissions, you focus on the product.
<!-- More details here: https://docs.sheetdb.io/handlebars -->
<table>
<thead>
<tr>
<td>ID</td>
<td>Name</td>
<td>Age</td>
<td>Comment</td>
</tr>
</thead>
<tbody data-sheetdb-url="https://sheetdb.io/api/v1/58f61be4dda40"
data-sheetdb-sort-by="age"
data-sheetdb-sort-order="desc">
<tr>
<td>{{id}}</td>
<td>{{name}}</td>
<td>{{age}}</td>
<td>{{comment}}</td>
</tr>
</tbody>
</table>
<script src="https://sheetdb.io/handlebars.js"></script>
fetch('https://sheetdb.io/api/v1/58f61be4dda40')
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(error => {
console.error(error);
});
$.ajax({
url: "https://sheetdb.io/api/v1/58f61be4dda40",
success: function(data) {
console.log(data);
}
});
// Get all data
axios.get('https://sheetdb.io/api/v1/58f61be4dda40')
.then(response => {
console.log(response.data);
});
// Get 10 results starting from 20
axios.get('https://sheetdb.io/api/v1/58f61be4dda40?limit=10&offset=20')
.then(response => {
console.log(response.data);
});
// Get all data sorted by name in ascending order
axios.get('https://sheetdb.io/api/v1/58f61be4dda40?sort_by=name&sort_order=asc')
.then(response => {
console.log(response.data);
});
new Vue({
el: "#app",
data() {
return {
content: []
}
},
template: `<table>
<thead>
<tr>
<td>ID</td>
<td>Name</td>
<td>Age</td>
<td>Comment</td>
</tr>
</thead>
<tbody>
<tr v-for="person in content">
<td v-text="person.id"></td>
<td v-text="person.name"></td>
<td v-text="person.age"></td>
<td v-text="person.comment"></td>
</tr>
</tbody>
</table>`,
created() {
fetch('https://sheetdb.io/api/v1/58f61be4dda40')
.then(response => response.json())
.then(data => this.content = data)
}
});
const sheetdb = require("sheetdb-node");
const client = sheetdb({ address: '58f61be4dda40' });
// Read whole spreadsheet
client.read().then(function(data) {
console.log(data);
}, function(error){
console.log(error);
});
// Read first two rows from sheet "Sheet2"
client.read({ limit: 2, sheet: "Sheet2" }).then(function(data) {
console.log(data);
}, function(err){
console.log(err);
});
<?php
$options = [
'http' => [
'method' => 'GET'
]
];
$response = json_decode(
file_get_contents('https://sheetdb.io/api/v1/58f61be4dda40', false, stream_context_create($options))
);
<?php
// Install SheetDB package: composer require sheetdb/sheetdb-php
// More details here: https://github.com/sheetdb/sheetdb-php
require('vendor/autoload.php');
use SheetDB\SheetDB;
$sheetdb = new SheetDB('58f61be4dda40');
$content = $sheetdb->get(); // returns all spreadsheets data
$keys = $sheetdb->keys(); // returns all spreadsheets key names
$name = $sheetdb->name(); // returns name of a spreadsheet document
import requests
import json
response = json.loads(
requests.get('https://sheetdb.io/api/v1/58f61be4dda40').content
)
require 'net/http'
require 'json'
response = JSON.parse(
Net::HTTP.get(
URI('https://sheetdb.io/api/v1/58f61be4dda40')
)
)
import Foundation
// Read whole spreadsheet
let url = String(format: "https://sheetdb.io/api/v1/58f61be4dda40")
let serviceUrl = URL(string: url)
var request = URLRequest(url: serviceUrl!)
request.httpMethod = "GET"
request.setValue("Application/json", forHTTPHeaderField: "Content-Type")
let session = URLSession.shared
session.dataTask(with: request) { (data, response, error) in
if let data = data {
do {
let json = try JSONSerialization.jsonObject(with: data, options: [])
print(json)
} catch {
print(error)
}
}
}.resume()
<!-- More details here: https://wordpress.org/plugins/sheetdb/ -->
[sheetdb url="https://sheetdb.io/api/v1/58f61be4dda40" element="ul" limit=3 search="id=*" sort-by="id" sort-order="desc"]
{{id}} – {{name}}
[/sheetdb]
Friendly, personal support
Write to us via email or chat in bottom right corner.
We are developers, we can assist with your integrations!
Loved by developers and the people they build for
From agencies and universities to travel companies, teams use SheetDB to ship faster. Here is what they say.
Google Sheets combined with SheetDB has offered a great alternative approach over more conventional CMS that we found lacked the transparency and connectivity to manage vast amounts of data for our websites. SheetDB, with its reliability, scalability and professional support, is now central to our plans moving forward.
I needed a solution to dynamically generate a webpage from. I found SheetDB. When I discovered the Query Strings component only permitted a single parameter, I went on live chat to inquire about how to use multiple parameters. Chris informed me that my request had been added to the development queue, and then to my disbelief - the request was completed The same day! Cannot say enough good things about SheetDB!
SheetDB simply makes my work easier and faster. Things that used to take a developer and a few days now take me a few minutes in a spreadsheet. It is reliable, the setup is trivial and the support is quick and human. Highly recommended.
As I struggled with an application, I reached out and within a day, a human emailed me back. His first reply had the exact help I needed allowing me to complete my work on time. The documentation was even updated to reflect the question I had. Best customer service experience I have ever had, I wish my bank or cell service provider would take note.
We had been looking for a solution to connect to Google Sheets to our website as a search function. When we found SheetDB the integration and usability was simple and worked perfect. The team even went as far as to add extra features to help us achieve the perfect final result. Highly recommended
I build client websites with no-code tools. SheetDB is how my clients edit their content: they change a row in a Google Sheet and the site updates. It really speeds up my work.