1

I used to use this method: https://stackoverflow.com/a/12507856/3772221

Where I would send a fetch to a URL in this form, replacing ${gid} and ${id} with the id and and gid of the sheet.

https://docs.google.com/spreadsheets/d/${id}/export?format=csv&gid=${gid}

but as of today it's no longer working for me. After I went looking online for the reason, I saw that google updated their spreadsheet API yesterday.

The only thing that I've found now on downloading a specific worksheet from a spreadsheet is this: https://developers.google.com/sheets/reference/rest/v4/spreadsheets.values/get#http-request, but this page is pretty unhelpful considering that I don't want a value range. I just want want to download the file as a csv as if I clicked the download link.

Does anyone know a method similar to what I was using before? I don't want to use this new API, but rather download the file itself as I was doing before.

Community
  • 1
  • 1
m0meni
  • 16,006
  • 16
  • 82
  • 141

1 Answers1

1

The new URL that worked for me is in the form:

https://docs.google.com/spreadsheets/u/1/d/${id}/export?format=csv&id=${id}&gid=${gid}
m0meni
  • 16,006
  • 16
  • 82
  • 141