Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I access Google Sheet spreadsheets only with Javascript?

I want to access Google Spreadsheets using JavaScript only (no .NET, C#, Java, etc.)

I came here and was shocked to know that there is NO API for JavaScript to access Google Sheets.

Please tell me how to access (CREATE/EDIT/DELETE) Google Sheets using JavaScript or any of its frameworks like jQuery.

like image 690
Pratik Avatar asked Nov 10 '10 11:11

Pratik


People also ask

How do I connect Google Sheets with JavaScript?

The basic premise is that you need to do the following: Set up a Google Sheet for public access (there's a guide on the GitHub project's readme file) Add the npm package to your repository. Call the reader function and pass in a set of options and a callback function to handle the results.

How do I view Google Sheets only?

Click “Share” at the top. Then, click “Change” in the Get Link section of the pop-up window. On the right side, click the Editor drop-down arrow and choose “Viewer.” Click “Done” to save your changes.

How do I retrieve data from Google Sheets?

On your computer, go to docs.google.com/spreadsheets/. Open or create a sheet. Select a cell. Type = followed by the sheet name, an exclamation point, and the cell being copied.


1 Answers

I have created a simple javascript library that retrieves google spreadsheet data (if they are published) via the JSON api:

https://github.com/mikeymckay/google-spreadsheet-javascript

You can see it in action here:

http://mikeymckay.github.com/google-spreadsheet-javascript/sample.html

like image 145
Mike McKay Avatar answered Oct 18 '22 02:10

Mike McKay