title: Accessing CSV from a Google Docs Spreadsheet
body: <p>I try to access a Google Docs Spreadsheet, so I can use it in a D3.js visualization.
  Both</p>
  
  <ul>
  <li><a href="https://docs.google.com/spreadsheets/d/1s04t-0r5dtY4c31czCGCaxRS_nbAMDmoUJ5O75leGPE/export?format=csv&amp;id" rel="nofollow noreferrer">https://docs.google.com/spreadsheets/d/1s04t-0r5dtY4c31czCGCaxRS_nbAMDmoUJ5O75leGPE/export?format=csv&amp;id</a> (as in <a href="https://stackoverflow.com/questions/22819484/accessing-google-docs-spreadsheet-revisited-in-2014">Accessing google docs spreadsheet revisited in 2014</a>)</li>
  <li><a href="http://docs.google.com/feeds/download/spreadsheets/Export?key=1s04t-0r5dtY4c31czCGCaxRS_nbAMDmoUJ5O75leGPE&amp;exportFormat=csv&amp;gid=0" rel="nofollow noreferrer">http://docs.google.com/feeds/download/spreadsheets/Export?key=1s04t-0r5dtY4c31czCGCaxRS_nbAMDmoUJ5O75leGPE&amp;exportFormat=csv&amp;gid=0</a> (as in <a href="https://stackoverflow.com/questions/11619805/using-the-google-drive-api-to-download-a-spreadsheet-in-csv-format">Using the google drive API to download a spreadsheet in csv format</a>)</li>
  </ul>
  
  <p>do work for downloading the data, but not for using them for other websites, as I am getting an error <code>No 'Access-Control-Allow-Origin' header is present on the requested resource.</code></p>
  
  <p>However, an approach that should work (<a href="https://stackoverflow.com/questions/10730712/download-unpublished-google-spreadsheet-as-csv">Download unpublished Google spreadsheet as CSV</a>, see also <a href="https://groups.google.com/forum/#!topic/d3-js/MN81FgPPU18as" rel="nofollow noreferrer">this post</a>):</p>
  
  <ul>
  <li><a href="https://docs.google.com/spreadsheet/ccc?key=1s04t-0r5dtY4c31czCGCaxRS_nbAMDmoUJ5O75leGPE&amp;output=csv&amp;gid=0" rel="nofollow noreferrer">https://docs.google.com/spreadsheet/ccc?key=1s04t-0r5dtY4c31czCGCaxRS_nbAMDmoUJ5O75leGPE&amp;output=csv&amp;gid=0</a></li>
  </ul>
  
  <p>does not work at all (redirect to typical edit view).</p>
  
  <p>For another variant, used by <a href="http://christopheviau.com/d3list/gallery.html" rel="nofollow noreferrer">http://christopheviau.com/d3list/gallery.html</a>:</p>
  
  <ul>
  <li><a href="https://docs.google.com/spreadsheet/pub?key=0AqMEGBUNwXeHdHpQNlVuY29SUE5BSXVtS3JueGlNYVE&amp;single=true&amp;gid=0&amp;output=csv" rel="nofollow noreferrer">https://docs.google.com/spreadsheet/pub?key=0AqMEGBUNwXeHdHpQNlVuY29SUE5BSXVtS3JueGlNYVE&amp;single=true&amp;gid=0&amp;output=csv</a></li>
  </ul>
  
  <p>I cannot do the same with my code (changing keys results in an error: <code>Sorry, the file you have requested does not exist.</code>).</p>
  
  <p>What I am doing wrong?</p>