1

I've been having problems with Highcharts when requesting from a google sheet, few days ago it was all good, but suddenly it was throwing an error 404, and I don't know what to do. Higcharts only ask you to put the google spreadsheet key, and the number of the tab, and nothing else. I want to change the URL that Higcharts makes the request but I don't know how. Error:

data.src.js:124 GET https://spreadsheets.google.com/feeds/cells/1YtSfF3-9kzx1G6zwllLX9GhkVgufSUjQyKVI3Ken-AA/2/public/values?alt=json 404

3 Answers 3

2

It seems like a google issue: https://support.google.com/docs/thread/121088347/retrieving-data-from-sheets-results-in-404-error-50-of-the-time

Sign up to request clarification or add additional context in comments.

Comments

2

feeds is the older version of Sheets API and it's shut down. See Google's announcement here https://cloud.google.com/blog/products/g-suite/migrate-your-apps-use-latest-sheets-api

Comments

1

Try tu use this function to get values as json

function getJson(id,gid){
  var txt = UrlFetchApp.fetch(`https://docs.google.com/spreadsheets/d/${id}/gviz/tq?tqx=out:json&tq&gid=${gid}`).getContentText();
  var jsonString = txt.match(/(?<="table":).*(?=}\);)/g)[0]
  var json = JSON.parse(jsonString)
  return(json)
}
  • with id of the spreadsheet and gid of your sheet (may be 0)
  • note that first row is dedicated to labels, then rows[0] corresponds to row#2 and c[0] corresponds to column A
  • if you want to retrieve B1 (column 2 row 1) : json.cols[1].label
  • if you want to retrieve B2 (column 2 row 2) : json.rows[0].c[1].v

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.