How to Create a CSV or Excel Direct Download Link in Google Sheets

As a Google Sheets user, you've probably already used the option to download the entire spreadsheet into an Excel file or a specific sheet/tab as a CSV/TSV file (under File > Download).

Did you know that you can actually create a URL that will do this for you automatically?  This way, you can share this direct download URL with others or just create a shortcut on your browser that you can click so you can auto-export the data to CSV/TSV or Excel without having to go through the menu options. 

This is particularly useful for sharing a product feed with other platforms as many platforms typically require a direct download link of a CSV file.

Doing so is fairly straightforward, you basically just need to remove the part starting from /edit and replace it with /export with some additional text.

Examples

A Google Sheets URL might look something like tihs:

https://docs.google.com/spreadsheets/d/1Gztm9o8JEPibPWEDwH54qBG5kwj51ILDOk_dxK6uTSY/edit#gid=1330027783

URL to download the entire spreadsheet to Excel:

https://docs.google.com/spreadsheets/d/1Gztm9o8JEPibPWEDwH54qBG5kwj51ILDOk_dxK6uTSY/export?format=xlsx

URL to download just a specific sheet/tab to Excel:

https://docs.google.com/spreadsheets/d/1Gztm9o8JEPibPWEDwH54qBG5kwj51ILDOk_dxK6uTSY/export?format=xlsx&gid=1330027783

Notice that the difference is we included &gid=1330027783 to the URL.  This is basically the "Sheet ID" and as you switch sheets/tabs in Google Sheets, you'll notice this value changes and you can basicaly just copy that ID and append it to the URL if you want that specific sheet exported.

URL to export a specific sheet/tab to CSV:

https://docs.google.com/spreadsheets/d/1Gztm9o8JEPibPWEDwH54qBG5kwj51ILDOk_dxK6uTSY/export?format=csv&gid=1330027783

URL to export a specific sheet/tab to TSV:

https://docs.google.com/spreadsheets/d/1Gztm9o8JEPibPWEDwH54qBG5kwj51ILDOk_dxK6uTSY/export?format=tsv&gid=1330027783

As you can see, there's a consistent pattern here.  You just need to replace the value assigned to format with your desired format.


Related Posts:


Tags: howto, data export, google sheets, product feed, google sheets tips