Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

262
Views
How do I fetch Google Spreadsheet data from Javascript in Sheets v4 API as JSON?

Below is how I attempted to fetch data from Google Sheets. However, this method seems to be deprecated in Sheets V4 API. It was no longer working. There might be other ways to get the data from Google Sheet.

var url = "https://spreadsheets.google.com/feeds/cells/1hA4LKZn9yKoqnSzaI6_73GQSj_ZVpB3O0kC93QM98Vs/od6/public/basic?alt=json";
$.ajax({
    url:url,
    dataType:"jsonp",
    success:function(data) {
        // data.feed.entry is an array of objects that represent each cell
    },
});

How do I fetch Google Spreadsheet data from Javascript in Sheets v4 API as JSON?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

feeds is deprecated in V4. See this post 404 while trying to fetch sheet data 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
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!