How do I access the Google Spreadsheets API in PHP?

前端 未结 3 467
囚心锁ツ
囚心锁ツ 2020-12-06 04:40

Starting with the Google Developer documentation on the Google Spreadsheets API, I found that \"A number of client libraries are provided in various languages.\", but Google

3条回答
  •  庸人自扰
    2020-12-06 05:13

    Thanks for the hints and links on this page, I wanted to share what I ended up doing to read a google spreadsheet in php. You can access the spreadsheet in json format, and don't need to use api or zend framework or gdata library. PhP can handle json very easily and it was the most neat solution I could reach to because it has no dependency to any third party libraries.

    Here is a sample link for getting a spreadsheet in json format.

    https://spreadsheets.google.com/feeds/list/key/1/public/full?alt=json
    

    Please note if spreadsheet is private you still need to follow the authentication steps to get token to access to the page. In my case the spreadsheet was public.

    Also you can access the spreadsheet via feed list or cell based (replace the list in the url with cell)

    You can try the link in a browser and see the json result.

提交回复
热议问题