Google Sheets has been increasing becoming more popular especially in the field of finance and tracking data like home expenses. But the real beauty of it comes when you can use that as a data source to build beautiul UI’s around it. So, lets get started as to how to go about this.

Lets create a sample sheet with around 4 columns and 4 rows.

One of the most important thing to be taken care of is to have the header fields defined so that we can easily access these attributes in our code. The way to assign header fields in Google sheets is to freeze the header row. The header field will be used as the key to access data for a particular column. Go to View --> Freeze --> 1 row . You would see some kind of a line under that row indicating that the row is frozen.

Click on “Share” and get the link. Make sure you select the option that anyone with link can view . Keep a note of the shareable link.

Grab the Sheet ID from the link.

You need to publish this file to web so as to be accessible on the internet. Goto File --> Publish to the web. Select the type as webpage .

The URL to fetch the JSON data from the sheet is in the below format. Paste the SheetID in the below URL. https://spreadsheets.google.com/feeds/list/<SHEET_ID>/od6/public/values?alt=json In my case the sheet ID is 1wqdPvjqPoJNhBWrcj_v8PuBkTh7Fxw4fOUz7TLo1jxw , so my API URL becomes :- https://spreadsheets.google.com/feeds/list/1wqdPvjqPoJNhBWrcj_v8PuBkTh7Fxw4fOUz7TLo1jxw/od6/public/values?alt=json