New Google Sheets: publishing a single worksheet to the web as CSV

With the switch to the new version of Google Sheets, the option to publish a specific worksheet and then access that as a CSV file has disappeared (hopefully just temporarily).

In the new Google Sheets, I managed to publish a worksheet as a CSV by piecing together answers from here and here.

This is how to do it:

  1. Share the Google Doc so anyone with the link can view (sadly this loses the granularity of only sharing specific sheets that used to exist in the old version).
  2. Publish the document (File > Publish to the Web) and look for the document ID in the URL
  3. Add that document ID into this URL in place of KEY:
    • https://docs.google.com/spreadsheets/d/<KEY>/export?format=csv&id=<KEY>
  4. While editing your Google Doc, open the worksheet you want to export and look in the URL for the GID parameter
  5. Copy this GID parameter and append it to your URL:
    • https://docs.google.com/spreadsheets/d/<KEY>/export?format=csv&id=<KEY>&gid=<GID>

Done

9 thoughts on “New Google Sheets: publishing a single worksheet to the web as CSV”

    1. The GID will target a particular worksheet in the spreadsheet (rather than just the first one), so it’s useful if you have a number of worksheets.

  1. I was so happy to find this, I am trying to put a Google Sheet onto a Weebly custom page without the header.

    Do I just need to insert the URL with the KEY and GID inserted, into ” x ” below?

    1. I haven’t tested it, but you could try playing with the “format=csv” part of the URL to see if “xml” or “rss” works in place of “csv”. Let me know how you get on with it.

      1. Hi Adam,

        Many thanks for your solution, it works fine with
        format=”csv”
        format=”pdf”
        format=”ods”
        format=”xlsx”
        format=”tsv”

        but it doesn’t work with
        format=”rss”
        format=”json”
        format=”xml”

        Any idea to export to this format?
        I can’t understand why this fomat has been abandoned.

        Many thanks
        jcv

  2. Is it possible to export all sheets under one CSV? I have tried setting GID to 0 but that would only export the first sheet.

    Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>