TL;DR

curl -fsSL “https://docs.google.com/spreadsheets/d/${my_key}/export?format=csv&usp=sharing"

This is a real, working example.

If you click Share on a spreadsheet in Google Drive, you’ll get a link that you can convert into a CSV download link. It looks like this:

cURL

The quick, working example:

curl -fsSL "https://docs.google.com/spreadsheets/d/1KdNsc63pk0QRerWDPcIL9cMnGQlG-9Ue9Jlf0PAAA34/export?format=csv&usp=sharing"

Download CSV from share link:

# The link, as copied from Google Sheets
my_shared_link='https://docs.google.com/spreadsheets/d/1KdNsc63pk0QRerWDPcIL9cMnGQlG-9Ue9Jlf0PAAA34/edit?usp=sharing'

# The key, extracted from the link: 1KdNsc63pk0QRerWDPcIL9cMnGQlG-9Ue9Jlf0PAAA34 
my_key="$(echo "${my_shared_link}" | cut -d'/' -f6)"

# The curl command, translatable into ANY programming language
# curl -fsSL "https://docs.google.com/spreadsheet/ccc?key=${my_key}&usp=sharing&output=csv" -o test.csv

# New version
curl -fsSL "https://docs.google.com/spreadsheets/d/${my_key}/export?format=csv&usp=sharing"

# The proof it still works in 2021
cat test.csv

Node.js

The quick, working example:

"use strict";

let resp = await require("@root/request")({
  url: "https://docs.google.com/spreadsheets/d/1KdNsc63pk0QRerWDPcIL9cMnGQlG-9Ue9Jlf0PAAA34/export?format=csv&usp=sharing",
});
console.log(resp.body);

Download CSV from share link:

"use strict";

let request = require("@root/request");

let shareLink =
  process.argv[2] ||
  "https://docs.google.com/spreadsheets/d/1KdNsc63pk0QRerWDPcIL9cMnGQlG-9Ue9Jlf0PAAA34/edit?usp=sharing";

let out = process.argv[3] || "./test.csv";

// 1KdNsc63pk0QRerWDPcIL9cMnGQlG-9Ue9Jlf0PAAA34
let key = new URL(shareLink).pathname.split("/")[3];

async function main() {
  let resp = await request({
    url: `https://docs.google.com/spreadsheets/d/${key}/export?format=csv&usp=sharing`,
    stream: out,
  });

  await resp.stream;

  console.info(`Wrote ${out}`);
}

main();

References

See also: https://gist.github.com/dhlavaty/6121814#gistcomment-3930810