[Google Sheets](https://www.google.com/sheets/about/) is a spreadsheet application offered by Google and run in the browser. The primary advantages of Google Sheets over Microsoft Excel is the ability to link sheets using the [[IMPORTRANGE function]]. Google Sheets can be extended with [[base/Google Apps Script/Google Apps Script|Google Apps Script]] to create alerts, dialogs, sidebars, and custom functions. Google Sheets can be used as a lightweight back-end for data-driven applications. ### Create a download link Create a direct download link to serve data to connected applications or quickly download data for any other purpose. The link will only work for those with access to the spreadsheet unless the spreadsheet is shared to "anyone with the link". To easily create this link 1. navigate to the spreadsheet in your browser, 2. open the desired tab, and 3. in the URL bar, replace `edit#` with `export?format=csv&`. The general form of a direct download to CSV link is below. Use `format=tsv` for tab-separated values. ``` https://docs.google.com/spreadsheets/d/<spreadsheet_id>/export?format=csv&gid=<sheet_id> ``` You can also download the entire spreadsheet as an Excel workbook. ``` https://docs.google.com/spreadsheets/d/<spreadsheet_id>/export?format=xlsx ``` Or specify a range by appending the `range` parameter and specifying a range in A1 notation. ``` &range=A1:Z99 ``` ### Publish to web [Publishing a spreadsheet to the web](https://support.google.com/docs/answer/183965?hl=en) creates a URL to access raw data in CSV format, similar to a [[GitHub raw link]]. Use this option for more control over the download link or to embed a Sheet in another application. The instructions below will publish a link to a specific sheet as CSV. 1. In your browser, navigate to the Google Sheet. 2. Open the **File** menu and select **Share > Publish**. 3. In the "Link" tab, click the right-hand drop-down and choose Comma-separated values (.csv). 4. From the left-hand drop-down, choose the tab you want to share as CSV. 5. Click on "Publish content & settings" to access additional options, such as restricting access to specific groups. 6. Click **Publish**. To stop publishing to the web, click **Stop Publishing**. #rough