# \[SOLVED\] Cannot get cvs google spreadsheet because CORS

**URL:** <https://forum.playcanvas.com/t/solved-cannot-get-cvs-google-spreadsheet-because-cors/13867>\
**Category:** Help & Support\
**Created:** [July 1, 2020, 7:21am UTC](https://forum.playcanvas.com/t/solved-cannot-get-cvs-google-spreadsheet-because-cors/13867 "2020-07-01T07:21:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikita\_osyak](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/nikita_osyak/32/5338_2.png) [@nikita\_osyak](https://forum.playcanvas.com/u/nikita_osyak)\
**Post date:** [July 1, 2020, 7:21am UTC](https://forum.playcanvas.com/t/solved-cannot-get-cvs-google-spreadsheet-because-cors/13867/1 "2020-07-01T07:21:28Z")

</div>

Hello.

So I’m having a simple spreadsheet for my game for progression and stuff. A couple of month before it worked as a charm, I wrote a simple script that downloads and parses CVS exported google spreadsheet, like so:

```javascript
        var oReq = new XMLHttpRequest();
        oReq.addEventListener("load", function() {
            var grid = oReq.responseText.split('\n')
            grid = grid.map(function(r) { return r.split(',') })
            
            var row, cell
            
            // ... then i'll do parsing stuff
            
            self.ready = true
            onComplete()
        });
        // real URL, you can copy it and get CVS exported sheet
        oReq.open("GET", 'https://docs.google.com/spreadsheets/d/1w0Q6K4jO4Fko0-i7LTwQdxcOnbJ7U-ZvQkK_TeF_sxg/export?format=csv&gid=0');
        oReq.send();

```

Current situation is that I try to do that, but instead of CVS I got:

```javascript
Access to XMLHttpRequest at 'https://doc-0c-00-sheets.googleusercontent.com/export/l5l039s6ni5uumqbsj9o11lmdc/g0ghobgnhfsotqf25ftut96ndg/1593587610000/113439309879225344852/*/1w0Q6K4jO4Fko0-i7LTwQdxcOnbJ7U-ZvQkK_TeF_sxg?format=csv&gid=0' 
(redirected from 'https://docs.google.com/spreadsheets/d/1w0Q6K4jO4Fko0-i7LTwQdxcOnbJ7U-ZvQkK_TeF_sxg/export?format=csv&gid=0') 
from origin 'https://launch.playcanvas.com' has been blocked by CORS policy: 
No 'Access-Control-Allow-Origin' header is present on the requested resource.

Sheet.js:103 GET https://doc-0c-00-sheets.googleusercontent.com/export/l5l039s6ni5uumqbsj9o11lmdc/g0ghobgnhfsotqf25ftut96ndg/1593587610000/113439309879225344852/*/1w0Q6K4jO4Fko0-i7LTwQdxcOnbJ7U-ZvQkK_TeF_sxg?format=csv&gid=0 net::ERR_FAILED

```

Am I not able to download CVS from playcanvas anymore? It was totally working some time ago (month or two)

Thanks!

---

<div class="post-metadata">

**Author:** ![yaustar](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yaustar/32/2268_2.png) [@yaustar](https://forum.playcanvas.com/u/yaustar)\
**Post date:** [July 1, 2020, 8:09am UTC](https://forum.playcanvas.com/t/solved-cannot-get-cvs-google-spreadsheet-because-cors/13867/2 "2020-07-01T08:09:27Z")

</div>

Looks like Google may have blocked it? CORS is setup be the server that the resource is on, not the caller (ie PlayCanvas).

See [https://stackoverflow.com/questions/62587802/fetching-a-google-sheet-csv-file-yields-cors-error](https://stackoverflow.com/questions/62587802/fetching-a-google-sheet-csv-file-yields-cors-error)

---

<div class="post-metadata">

**Author:** ![yaustar](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yaustar/32/2268_2.png) [@yaustar](https://forum.playcanvas.com/u/yaustar)\
**Post date:** [July 1, 2020, 8:14am UTC](https://forum.playcanvas.com/t/solved-cannot-get-cvs-google-spreadsheet-because-cors/13867/3 "2020-07-01T08:14:27Z")

</div>

There’s a CORs checker here too [https://www.test-cors.org/#](https://www.test-cors.org/#)

---

<div class="post-metadata">

**Author:** ![nikita\_osyak](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/nikita_osyak/32/5338_2.png) [@nikita\_osyak](https://forum.playcanvas.com/u/nikita_osyak)\
**Post date:** [July 1, 2020, 10:26am UTC](https://forum.playcanvas.com/t/solved-cannot-get-cvs-google-spreadsheet-because-cors/13867/4 "2020-07-01T10:26:07Z")

</div>

Seems like you’re right, @yaustar, that’s definitely google’s fault.

So frustrated. Google sheets is one of the best game design tools. At least this approach still works locally.

---

<div class="post-metadata">

**Author:** ![yaustar](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yaustar/32/2268_2.png) [@yaustar](https://forum.playcanvas.com/u/yaustar)\
**Post date:** [July 1, 2020, 10:29am UTC](https://forum.playcanvas.com/t/solved-cannot-get-cvs-google-spreadsheet-because-cors/13867/5 "2020-07-01T10:29:08Z")

</div>

Yeah, I was actually thinking about using it as a CMS for site. Guess that’s out of the window now ☹

---

<div class="post-metadata">

**Author:** ![nikita\_osyak](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/nikita_osyak/32/5338_2.png) [@nikita\_osyak](https://forum.playcanvas.com/u/nikita_osyak)\
**Post date:** [July 1, 2020, 10:52am UTC](https://forum.playcanvas.com/t/solved-cannot-get-cvs-google-spreadsheet-because-cors/13867/6 "2020-07-01T10:52:40Z")

</div>

Well now you can have cors free reverse proxy for google sheets and other stuff and charge a dollar to use it, perhaps.
