googlesheet_csv_url: Build a Google Sheets CSV export URL

View source: R/google_sheets.R

googlesheet_csv_urlR Documentation

Build a Google Sheets CSV export URL

Description

Turns a link-shared Google Sheets URL (or a bare spreadsheet ID) into its CSV export endpoint, which works for any sheet shared as "Anyone with the link can view" – no OAuth, no credential storage.

Usage

googlesheet_csv_url(url, gid = NULL)

Arguments

url

The pasted Google Sheets link (several shapes accepted, e.g. ⁠.../spreadsheets/d/<ID>/edit#gid=123⁠), or a bare spreadsheet ID.

gid

Optional worksheet gid. If NULL and url carries one, that one is reused; otherwise the default worksheet is used.

Value

A character scalar, the CSV export URL.

Examples

googlesheet_csv_url("https://docs.google.com/spreadsheets/d/abc123/edit#gid=456")

forecastsuite documentation built on Oct. 18, 2026, 5:08 p.m.