PHPackages                             andrearufo/gsx2json4php - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. andrearufo/gsx2json4php

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

andrearufo/gsx2json4php
=======================

A PHP class to parse a Google Spreadsheet to JSON

v0.1(7y ago)342[1 PRs](https://github.com/andrearufo/gsx2json4php/pulls)MITPHPPHP &gt;=5.3.0

Since Jan 2Pushed 5y ago2 watchersCompare

[ Source](https://github.com/andrearufo/gsx2json4php)[ Packagist](https://packagist.org/packages/andrearufo/gsx2json4php)[ RSS](/packages/andrearufo-gsx2json4php/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

gsx2json4php
============

[](#gsx2json4php)

The **gsx2json4php** is a simple PHP class to parse a Google Spreadsheet into a JSON.

This is inspired by :

> One useful feature of Google Spreadsheets is the ability to access the data as JSON by using a particular feed URL. However, this is a bit fiddly to do, and the resulting JSON is pretty unreadable, with usable data buried deep inside objects.
>
> This API connects to your spreadsheet and santizes the data, providing simple, readable JSON for you to use in your app.

Installing gsx2json4php
-----------------------

[](#installing-gsx2json4php)

The recommended way to install gsx2json4php is through Composer.

```
curl -sS https://getcomposer.org/installer | php

```

Next, run the Composer command to install the latest stable version of gsx2json4php:

```
php composer.phar require andrearufo/gsx2json4php

```

or

```
composer require andrearufo/gsx2json4php

```

After installing, you need to require Composer's autoloader:

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

```

You can then later update gsx2json4php using composer:

```
php composer.phar update

```

How to use
----------

[](#how-to-use)

First, you must publish your spreadsheet to the web, using *File -&gt; Publish To Web* in your Google Spreadsheet.

Copy your Spreadsheet ID to use into the script:

```
