gregory
gregory

Reputation: 79

Download CSV feed for a sheet using the new Google Spreadsheet format

With the change to the new Spreadsheet URL format, getting a CSV feed for a Google Spreadsheet feels like a moving target. I have a CSV feed working with this URL format:

https://docs.google.com/spreadsheets/d/<key>/export?id=<gid>&format=csv

However, it seems that Google is always returning the first sheet for this doc. Anyone know of changes to the URL scheme or something I am missing to obtain the CSV feed for the specified GID?

Thanks

Upvotes: 1

Views: 1895

Answers (1)

RandomPasserby
RandomPasserby

Reputation: 56

You are 99% there - the actual URL is:

https://docs.google.com/spreadsheets/d/<key>/export?gid=<gid>&format=csv

In other words, you put "?id=" instead of "?gid=". With the proper URL, then you can download any sheet in the doc, not just the first.

Upvotes: 4

Related Questions