- This GIST is outdated. I recommend a different approach here: https://gist.github.com/dhlavaty/9cb9f50aed62320329636e805e654eae
- Your Google SpreadSheet (Google Drive, Google Docs) document must be set to "Anyone with the link" can view it
- To get URL press SHARE (top right corner) on Google SpreeadSheet and copy "Link to share".
- Now add
&output=csv
parameter to this link - Your link will look like:
https://docs.google.com/spreadsheet/ccc?key=1234abcd1234abcd1234abcd1234abcd1234abcd1234&usp=sharing&output=csv
I was trying to download the file as CSV and with this I found that I would get an HTML file instead. However, following the steps on a post in reddit I could get a URL that downloads me the CSV file.
Instead of using the URL that this post suggest I obtained mine doing the following thing: In your Google Spread, go to: File > Publish to the Web > Link > CSV.
With this new link I did the WWW request using "byte[] dt = wc.DownloadData(url);" instead of the suggested "var outputCSVdata = wc.DownloadString(url);" and saved all the returning bytes into a file using "File.WriteAllBytes("path", dt);"