Parsing public and shared Google Sheets as JSON with PHP
// Parsing this spreadsheet: https://spreadsheets.google.com/pub?key=0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc&hl=en&output=html $url = 'http://spreadsheets.google.com/feeds/list/0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc/od6/public/values?alt=json'; $file= file_get_contents($url); $json = json_decode($file); $rows = $json->{'feed'}->{'entry'}; foreach($rows as $row) { $title = $row->{'gsx$title'}->{'$t'}; $author = $row->{'gsx$author'}->{'$t'}; $review = $row->{'gsx$review'}->{'$t'}; echo $title . ' by ' . $author . ' ' . $review;
echo '
'; } // See this here: http://imagine-it.org/google/spreadsheets/showspreadsheet.php
Getting data from other Google Sheets URLs
For sheet 2 https://spreadsheets.google.com/feeds/list/1ppywkX1g_0ynTIs6qQvCMzsandxLqMUHFDR0SQyjvtA/2/public/values?alt=json For sheet 3 https://spreadsheets.google.com/feeds/list/1ppywkX1g_0ynTIs6qQvCMzsandxLqMUHFDR0SQyjvtA/3/public/values?alt=json [ Original Spreadsheet https://docs.google.com/spreadsheets/d/1ppywkX1g_0ynTIs6qQvCMzsandxLqMUHFDR0SQyjvtA/edit#gid=1 ]