PHP
google
JSON
Spreadsheets

Google スプレッドシート

More than 1 year has passed since last update.

[key]がスプレッドシート自体のID

https://docs.google.com/spreadsheets/d/[key]/edit#gid=0

各シートのID確認方法

https://spreadsheets.google.com/feeds/worksheets/[key]/public/basic

[worksheetId]が各シートのID

https://spreadsheets.google.com/feeds/list/[key]/[worksheetId]/public/basic

XML形式で取得

https://spreadsheets.google.com/feeds/cells/[key]/[worksheetId]/public/values

JSONで取得

https://spreadsheets.google.com/feeds/cells/[key]/[worksheetId]/public/values?alt=json

php記述例

$url = "https://spreadsheets.google.com/feeds/cells/[key]/[worksheetId]/public/values?alt=json";
$json = file_get_contents($url);
$json_decode = json_decode($json);
$posts = $json_decode->feed->entry;