13

I've read through the Google Spreadsheets API PHP documentation. All examples are using Zend, which I cannot use. See this page: http://code.google.com/apis/spreadsheets/docs/1.0/developers_guide_php.html

Does anybody know a simple example of the following:

How can I use PHP w/ curl (or whatever) and the Google Spreadsheets API to get the data from a Google Spreadsheets Doc?

It's my understanding that the data will be delivered in XML format. From there, I'll use PHP to manipulate it.

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
edt
  • 22,010
  • 30
  • 83
  • 118
  • See also http://stackoverflow.com/questions/14780804/how-do-i-read-a-google-drive-spreadsheet-in-php – Yarin Apr 29 '15 at 15:07

4 Answers4

10

Google is your friend! ;)

Alix Axel
  • 151,645
  • 95
  • 393
  • 500
  • 1
    Thanks Eyze. This example is exactly what I was looking for: http://sim.plified.com/2008/09/14/accessing-google-spreadsheet-with-php/ – edt Aug 31 '09 at 15:40
  • I keep getting the "Error establishing a database connection", every time I try to view the site. – Mike Warren Oct 31 '14 at 11:03
  • @MikeWarren That's exactly the problem with link-only answers... The links are broken, and the doc on the first link is deprecated. This answer has now become obsolete barely after 12 years. Well... – ThunderBird Nov 18 '21 at 01:15
0

From what I can see and how most of the other Google API work, the Spreadsheet API is centered around URLs. You formulate a URL and an xml response is returned. It seams that for this particular product however, most the support is for the Zend framewok implementation. You could always download the Zend component and reverse engineer it to work.

Robert DeBoer
  • 1,715
  • 2
  • 16
  • 26
  • 2
    I'm trying to avoid reverse engineering. I'm searching for a bare-bones example of how it could work without any PHP framework. For example, how to make it work with curl. – edt Aug 21 '09 at 22:21
  • You could reverse engineer to find out the URLs needed and then you would know what you need to create and send to Google – Robert DeBoer Aug 21 '09 at 22:42
0

The Google Spreadsheets Data API is documented here.

http://code.google.com/apis/spreadsheets/docs/1.0/developers_guide_protocol.html

It's a REST API so you just need appropriately formatted GETS and POSTS as described in the docs.

Phil Bogle
  • 109
  • 1
  • Yes, thank you. I'm looking for a bare-bones type of example that does what you are saying. – edt Aug 24 '09 at 22:18
0

The Zend Gdata implementation is the official PHP library for Google APIs. Not much of an answer I guess but I have to ask, why wouldn't you just use it? (It seems like you're reinventing the wheel... :-)

Carlton Gibson
  • 7,278
  • 2
  • 36
  • 46