How can I retrieve cell values from a public Google spreadsheet?
GET https://sheets.googleapis.com/v4/spreadsheets/1vW01Y46DcpCC7aKLIUwV_W4RXLbeukVwF-G9AA7P7R0/values/A1A4?key=abcdef
The above request returns a 403 error.
I also included the Referrer in Postman :
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36
{
"error": {
"code": 403,
"message": "Requests from referer Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36 are blocked.",
"status": "PERMISSION_DENIED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "API_KEY_HTTP_REFERRER_BLOCKED",
"domain": "googleapis.com",
"metadata": {
"consumer": "projects/666",
"service": "sheets.googleapis.com"
}
}
]
}
}
I am attempting to access data directly from a public sheet using client-side JavaScript.
No need for server round-trips. I vaguely remember this being possible around 10 years ago but I can't find the documentation now.