v1.2.0 — MIT License

Google Sheets
made simple in PHP

Stop wrestling with the verbose Google Sheets API. Read, write, and manage spreadsheets in just a few lines of code.

Copied! $ composer require reandimo/google-sheets-helper

Everything you need

A complete toolkit for Google Sheets operations, from simple reads to full worksheet management.

Read Data

Fetch ranges, single cells, or search for values across your entire spreadsheet.

get() getSingleCellValue() findCellByValue()

Write Data

Append rows, update single cells, or batch-update entire ranges with ease.

appendSingleRow() append() updateSingleCell() update()

Worksheet Management

Create, duplicate, rename, and delete worksheets. Full lifecycle control.

addWorksheet() duplicateWorksheet() renameWorksheet() deleteWorksheet()

Styling & Utilities

Color cell backgrounds, clear ranges, create new spreadsheets, and more.

colorRange() clearRange() create()

Beautiful CLI experience

Our interactive wizard guides you through authentication in seconds — not minutes reading docs.

php vendor/reandimo/google-sheets-helper/firstauth

Simple, intuitive API

Clean, readable code that does exactly what you'd expect.

read-example.php
use reandimo\GoogleSheetsApi\Helper;

$sheet = new Helper('credentials.json', 'token.json');
$sheet->setSpreadsheetId('your-spreadsheet-id');
$sheet->setWorksheetName('Sheet1');

// Get a range of values
$sheet->setSpreadsheetRange('A1:D10');
$data = $sheet->get();

// Get a single cell
$email = $sheet->getSingleCellValue('B2');

// Search for a value
$result = $sheet->findCellByValue('john@example.com');
echo "Found at: {$result['cell']}";
write-example.php
use reandimo\GoogleSheetsApi\Helper;

$sheet = new Helper('credentials.json', 'token.json');
$sheet->setSpreadsheetId('your-spreadsheet-id');
$sheet->setWorksheetName('Sheet1');

// Append a single row
$sheet->setSpreadsheetRange('A1:C1');
$sheet->appendSingleRow(['Alice', 'alice@mail.com', 'Admin']);

// Append multiple rows at once
$sheet->append([
    ['Bob',   'bob@mail.com',   'Editor'],
    ['Carol', 'carol@mail.com', 'Viewer'],
]);

// Update a single cell
$sheet->updateSingleCell('B5', 'updated@mail.com');
manage-example.php
use reandimo\GoogleSheetsApi\Helper;

$sheet = new Helper('credentials.json', 'token.json');
$sheet->setSpreadsheetId('your-spreadsheet-id');

// Create a brand new spreadsheet
$newId = $sheet->create('Q1 Sales Report');

// Add a worksheet with 100 rows, 10 columns
$sheet->addWorksheet('Summary', 100, 10);

// Duplicate an existing worksheet
$sheet->setWorksheetName('Sheet1');
$sheet->duplicateWorksheet('Sheet1 - Backup');

// Color a range purple
$sheet->setSpreadsheetRange('A1:F1');
$sheet->colorRange([142, 68, 173]);