It would probably be much easier to write a simple google apps script web app to get the data back from the spreadsheet than doing it your way....
or if a private sheet
or make something up from here: