PHPackages                             holoolaz/sheets2api - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. holoolaz/sheets2api

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

holoolaz/sheets2api
===================

Turn Google Sheets into JSON API and excel files

v1.0(4y ago)18MITPHPPHP &gt;=7.1.0

Since Jan 20Pushed 4y ago1 watchersCompare

[ Source](https://github.com/halocedark/sheets2api)[ Packagist](https://packagist.org/packages/holoolaz/sheets2api)[ Docs](https://github.com/holoolaz/sheets2api)[ RSS](/packages/holoolaz-sheets2api/feed)WikiDiscussions main Synced today

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

sheets2api Library
==================

[](#sheets2api-library)

Turn Google Sheets to JSON API and excel files

Fast Links
----------

[](#fast-links)

- [Introduction](#Introduction)
- [Installation](#Installation)
- [Usage](#Usage)

### Introduction

[](#introduction)

sheets2api Library has been made by [Holoola-z](https://holoola-z.com/) Company, please do not edit or abuse the usage of this Library.

sheets2api Library is mainly used to convert Google Sheets to JSON API so that it can be used in CMS, wordpress, custom websites and more..., You can simply display a Google Spreadsheet in a webpage as json file.

### Installation

[](#installation)

The best way to install this Library is through composer:

`composer require holoolaz/sheets2api`

### Usage

[](#usage)

In your file inlude the `vendor/autoload.php` file and use the namespace of the main class like this:

```
require_once 'vendor/autoload.php';

use GoogleSheets2API\Sheets2API\Sheets2API;

$sheets2api = new Sheets2API('YOUR_API_ID_HERE');

```

Let's use our api id '617989cb51352':

`$sheets2api = new Sheets2API('617989cb51352');`

#### Get All Spreadsheet Data

[](#get-all-spreadsheet-data)

***Important:*** Each time you use this api when calling **Spreadsheet()** then you're actually selecting the first sheet like the example below:

`$response = $sheets2api->Spreadsheet()->get();   // Here you're getting all data from first spreadsheet`

***Important:*** Now let's select a specific **Sheet** to get data from:

`$response = $sheets2api->Sheet('Sheet1')->get();   // Here you're getting all data from first spreadsheet`

***Optional Parameters***

```
$params = [
	'limit' => 2,
	'orderBy' => 'Id',
	'order' => 'DESC'
];

$response = $sheets2api->Sheet('Sheet1')->get($params);
print_r($response);

```

Or

```
$params = [
	'limit' => 2,
	'orderBy' => 'Id',
	'order' => 'DESC'
];

$response = $sheets2api->Spreadsheet()->get($params);
print_r($response);

```

***Note:*** Same thing goes to all other api call class methods.

#### Get Spreadsheet Cells

[](#get-spreadsheet-cells)

```
$response = $sheets2api->Spreadsheet()->cells('A1,B1');

$response = $sheets2api->Sheet('Sheet1')->cells('A1,B1');

```

#### Get Spreadsheet Rows Count

[](#get-spreadsheet-rows-count)

```
$response = $sheets2api->Spreadsheet()->count();

$response = $sheets2api->Sheet('Sheet1')->count();

```

#### Get Spreadsheet Column Names (Keys)

[](#get-spreadsheet-column-names-keys)

```
$response = $sheets2api->Spreadsheet()->keys();

$response = $sheets2api->Sheet('Sheet1')->keys();

```

#### Search Entire Spreadsheet by Values

[](#search-entire-spreadsheet-by-values)

```
$query = ['ranger', 'brad'];
$params = [
	'limit' => 3,
	'orderBy' => 'Id',
	'order' => 'DESC',
	'caseSensitive' => 'true'
];

$response = $sheets2api->Spreadsheet()->search($query);

$response = $sheets2api->Sheet('Sheet1')->search($query);

```

***Note***

This method can take additional parameters:

- limit
- offset
- orderBy
- order
- caseSensitive // This parameter is of type string so be sure to use quotation like: caseSensitive =&gt; 'true' // can take (true/false)
- and more...

#### Search Entire Spreadsheet by Condition

[](#search-entire-spreadsheet-by-condition)

```
$query = ['Name' => 'brad']

$response = $sheets2api->Spreadsheet()->searchBy($query);

$response = $sheets2api->Sheet('Sheet1')->searchBy($query);

```

***Note***

This method can take additional parameters:

- limit
- offset
- orderBy
- order
- caseSensitive
- and more...

#### List Spreadsheet Sheets (Tabs)

[](#list-spreadsheet-sheets-tabs)

```
$response = $sheets2api->Spreadsheet()->sheets();

```

#### Get Spreadsheet Name

[](#get-spreadsheet-name)

```
$response = $sheets2api->Spreadsheet()->name();

```

#### List All Spreadsheets

[](#list-all-spreadsheets)

```
$response = $sheets2api->Spreadsheet()->list();

```

#### Clear Spreadsheet Sheet (Tab)

[](#clear-spreadsheet-sheet-tab)

```
$response = $sheets2api->Sheet('Sheet3')->clear();

```

#### Clear Spreadsheet Sheet (Tab)

[](#clear-spreadsheet-sheet-tab-1)

```
$response = $sheets2api->Sheet('Sheet3')->copy('SPREADSHEET_ID_TO_COPY_DATA_TO');
$response = $sheets2api->Sheet('Sheet3')->copy('1t59SEiPQtySWFwwBEzP5jcgmX18Ywc5ytYiitJYxbY8');

```

Here we're copying `Sheet3` data to this `1t59SEiPQtySWFwwBEzP5jcgmX18Ywc5ytYiitJYxbY8` Spreadsheet id.

#### Delete Spreadsheet Row

[](#delete-spreadsheet-row)

```
$response = $sheets2api->Sheet('Sheet3')->deleteRow('Id=3');

```

Here we removed the row that has column name **Id** and value of **3**.

***Note:*** Calling this method can delete multiple rows at once, make sure that column name and value are unique.

***Important:*** Do not use spaces in the condition parameter like `Id = 3` this won't work.

#### Update Spreadsheet Row

[](#update-spreadsheet-row)

```
$data = ['6', 'john', 'john@yahoo.com', 'Slovakia'];
$response = $sheets2api->Spreadsheet()->addRow($data);
$response = $sheets2api->Sheet('Sheet3')->addRow($data);

```

#### Update Spreadsheet Multiple Rows

[](#update-spreadsheet-multiple-rows)

```
$data = [
	array('6', 'john', 'john@yahoo.com', 'Slovakia'),
	array('7', 'jack', 'jack@gmail.com', 'Brazil')
];
$response = $sheets2api->Spreadsheet()->addRows($data);
$response = $sheets2api->Sheet('Sheet3')->addRows($data);

```

#### Create Spreadsheet Sheet (Tab)

[](#create-spreadsheet-sheet-tab)

```
$response = $sheets2api->SpreadSheet()->create('NEW_SHEET');

```

**Note**: Here we created a new **Sheet** called **NEW\_SHEET**.

#### Delete Spreadsheet Sheets (Tabs)

[](#delete-spreadsheet-sheets-tabs)

```
$sheets = ['Sheet23'];
$response = $sheets2api->SpreadSheet()->deleteSheets($sheets);

```

**Note**: Here we're deleting only **Sheet23**, but what if we wanted to delete 3 more sheets.

```
$sheets = ['Sheet23', 'Sheet24', 'Sheet25'];
$response = $sheets2api->SpreadSheet()->deleteSheets($sheets);

```

That's it, we deleted 3 **Sheets** instead of 1.

#### Import HTML Table into Sheet (TAB)

[](#import-html-table-into-sheet-tab)

```
$url = 'URL_TO_IMPORT_FROM';
$index = 1;

$response = $sheets2api->Sheet('Sheet26')->importTable($url, $index);

```

#### Import HTML List into Sheet (TAB)

[](#import-html-list-into-sheet-tab)

```
$url = 'URL_TO_IMPORT_FROM';
$index = 1;

$response = $sheets2api->Sheet('Sheet26')->importList($url, $index);

```

**Important:** You can always use [Our API Documentation](https://sheets2api.com/docs) for more step by step guide.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1626d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1e7d09ff39186e845201db62ed41e8ab5654ae55141459c8b04ad3dea674638e?d=identicon)[halocdz](/maintainers/halocdz)

---

Top Contributors

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

---

Tags

jsonexcelgoogle-sheetssheets to jsonexcel files

### Embed Badge

![Health badge](/badges/holoolaz-sheets2api/health.svg)

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

###  Alternatives

[phpoffice/phpspreadsheet

PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine

14.3k318.2M1.5k](/packages/phpoffice-phpspreadsheet)[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.9k157.3M896](/packages/maatwebsite-excel)[rap2hpoutre/fast-excel

Fast Excel import/export for Laravel

2.3k27.0M52](/packages/rap2hpoutre-fast-excel)[openspout/openspout

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.2k70.2M244](/packages/openspout-openspout)[mk-j/php_xlsxwriter

PHP Library to write XLSX files

1.9k8.7M31](/packages/mk-j-php-xlsxwriter)[shuchkin/simplexlsx

Parse and retrieve data from Excel XLSx files. MS Excel 2007 workbooks PHP reader.

1.8k4.2M31](/packages/shuchkin-simplexlsx)

PHPackages © 2026

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