PHPackages                             sheetdb/sheetdb-php - 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. [API Development](/categories/api)
4. /
5. sheetdb/sheetdb-php

ActiveLibrary[API Development](/categories/api)

sheetdb/sheetdb-php
===================

PHP Library for accessing google spreadsheet content via SheetDB. https://sheetdb.io

1.0.3(6y ago)2056.8k—5.3%[1 issues](https://github.com/sheetdb/sheetdb-php/issues)1MITPHPPHP &gt;=5.5

Since Oct 6Pushed 6y agoCompare

[ Source](https://github.com/sheetdb/sheetdb-php)[ Packagist](https://packagist.org/packages/sheetdb/sheetdb-php)[ RSS](/packages/sheetdb-sheetdb-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (5)Used By (1)

PHP SheetDB Class
=================

[](#php-sheetdb-class)

### Installation

[](#installation)

The SheetDB PHP Library is available through [Composer](https://getcomposer.org/)

```
composer require sheetdb/sheetdb-php

```

### Test spreadsheet

[](#test-spreadsheet)

At any time you can play with our test API here:

You can also go to Google Sheets and play with it: [https://docs.google.com/spreadsheets/u/2/d/1mrsgBk4IAdSs8Ask5H1z3bWYDlPTKplDIU\_FzyktrGk/edit](https://docs.google.com/spreadsheets/u/2/d/1mrsgBk4IAdSs8Ask5H1z3bWYDlPTKplDIU_FzyktrGk/edit) **The spreadsheet resets every hour.**

### Basic usage

[](#basic-usage)

In order to instantiate SheetDB connection you need to give an api id. You can find it in [SheetDB Dashboard](https://sheetdb.io).

```
require('vendor/autoload.php');
use SheetDB\SheetDB;

$sheetdb = new SheetDB('58f61be4dda40');
$response = $sheetdb->get(); // returns all spreadsheets data
$response = $sheetdb->keys(); // returns all spreadsheets key names
$response = $sheetdb->name(); // returns name of a spreadsheet document
```

### Searching

[](#searching)

You can use search method to find only specific rows. You have 2 options. Search rows that meets all of the conditions or search rows that meets at least one of the conditions.

You can use second parameter if you want the search to be case sensitive (it is boolean). By default it is not case sensitive.

```
$response = $sheetdb->search(['name'=>'Steve','age'=>'22']); // returns when name="Steve" AND age=22
$response = $sheetdb->searchOr(['name'=>'Steve','age'=>'19']); // returns when name="Steve" OR age=19

$response = $sheetdb->search(['name'=>'Steve'], true); // returns when name="Steve", this query is case sensitive
```

### Creating a row(s)

[](#creating-a-rows)

If you want to create a new row you'll need to pass an array with key\_name =&gt; value. If you want to create multiple rows that should be an array of arrays.

```
$sheetdb->create(['name'=>'Mark','age'=>'35']);
$sheetdb->create([
	['name'=>'Chris','age'=>'34'],
	['name'=>'Amanda','age'=>'29'],
]);
```

### Updating a row(s)

[](#updating-a-rows)

First two parameters are key and value that need to match, third argument is array similar to the create one.

Fourth parameter is optional. If it's true not specified values will be emptied.

```
$sheetdb->update('name','Chris',['age'=>'33']); // it will change only age
$sheetdb->update('name','Chris',['age'=>'33'],true); // it will update age to 33 but all other values will be emptied, in this case a name
```

### Update the batch of rows in the spreadsheet

[](#update-the-batch-of-rows-in-the-spreadsheet)

Update for various queries. First argument is data itself. Each object in it should have a query key with the actual query (for example, "id=5"), and the remaining keys will be updated, as in a regular PATCH / PUT request.

Second parameter is optional. If it's true not specified values will be emptied.

```
$sheetdb->batchUpdate([
    [
        'query' => 'id=1',
        'age' => '33',
    ],
    [
        'query' => 'id=2',
        'age' => '52',
    ]
]);
```

### Delete a row(s)

[](#delete-a-rows)

Just like in update first two parameters are key and value. Every row that will match query will be deleted.

```
$sheetdb->delete('name','Chris'); // will delete all rows with name = "Chris"
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~306 days

Total

4

Last Release

2228d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/13364087241e1c78473a7360fb0d3167f6c7d8fcfe9b2a3370b6e20a45c2818d?d=identicon)[sheetdb](/maintainers/sheetdb)

---

Top Contributors

[![swist666](https://avatars.githubusercontent.com/u/4541261?v=4)](https://github.com/swist666 "swist666 (13 commits)")

### Embed Badge

![Health badge](/badges/sheetdb-sheetdb-php/health.svg)

```
[![Health](https://phpackages.com/badges/sheetdb-sheetdb-php/health.svg)](https://phpackages.com/packages/sheetdb-sheetdb-php)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
