PHPackages                             ondram/simple-google-reader - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. ondram/simple-google-reader

ActiveLibrary[File &amp; Storage](/categories/file-storage)

ondram/simple-google-reader
===========================

Super simple Google Spreadsheets and Google Docs reader

1.0.3(2mo ago)280[1 issues](https://github.com/OndraM/simple-google-reader/issues)MITPHPPHP ^8.2CI passing

Since Jan 29Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/OndraM/simple-google-reader)[ Packagist](https://packagist.org/packages/ondram/simple-google-reader)[ RSS](/packages/ondram-simple-google-reader/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (14)Versions (11)Used By (0)

Simple Google Spreadsheets and Docs Reader
==========================================

[](#simple-google-spreadsheets-and-docs-reader)

[![Latest Stable Version](https://camo.githubusercontent.com/677cbb3b0e50fffbfc1fa2664130e0cb5d583bc25b788a3a3645fac4fc72559c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f6e6472616d2f73696d706c652d676f6f676c652d7265616465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ondram/simple-google-reader)[![Coverage Status](https://camo.githubusercontent.com/984bac22195f80652060f909b454c306d27e3b5435959cb2eb0df8a324b9d572/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f4f6e6472614d2f73696d706c652d676f6f676c652d7265616465722f6d61696e2e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/r/OndraM/simple-google-reader)[![GitHub Actions Build Status](https://camo.githubusercontent.com/85681aa3a705110320bf026eb008ee40e1a57664eede11474f0e51de1c6a4f71/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4f6e6472614d2f73696d706c652d676f6f676c652d7265616465722f74657374732e79616d6c3f7374796c653d666c61742d737175617265266c6162656c3d476974487562253230416374696f6e732532306275696c64)](https://github.com/OndraM/simple-google-reader/actions)

PHP library providing a simple way to load data from Google Spreadsheets and Google Docs.

The aim is to provide universal low-level access to the data, without any additional features like data manipulation or formatting. It means you can implement any domain object mapping or data processing in your application.

This library is a wrapper for [google/apiclient](https://github.com/googleapis/google-api-php-client), with minimal additional dependency footprint. It is intended to be easily integrated to any framework or pure PHP.

Installation
------------

[](#installation)

Install using [Composer](https://getcomposer.org/):

```
$ composer require ondram/simple-google-reader
```

Usage
-----

[](#usage)

1. [Obtain service account credentials](https://github.com/googleapis/google-api-php-client#authentication-with-service-accounts) for your project
2. In service account details in IAM admin console open Keys settings and add JSON keys. Download generated JSON file with credentials (save for example as `google_client.json`).
3. Optional: You can setup domain-wide delegation access for the service account. This is done in Google Workspace Admin. In that case the service account can impersonate any domain user.
4. Enable required APIs in [Google Cloud Console](https://console.cloud.google.com/apis/dashboard) for your project:
    - [Google Sheets API](https://console.cloud.google.com/apis/library/sheets.googleapis.com) if you plan reading Spreadsheets
    - [Google Docs API](https://console.cloud.google.com/apis/library/docs.googleapis.com) to read Docs
    - [Google Drive API](https://console.cloud.google.com/apis/library/drive.googleapis.com) if you need to read Docs as HTML
5. Share the intended document with your service account (or if you use domain-wide delegation, then with some user account), copy document ID (from the URL)
6. Make sure to install any package [implementing PSR-6 caching](https://packagist.org/providers/psr/simple-cache-implementation)
7. Prepare cache and initialize Google Client:

```
