{"id":17865773,"url":"https://github.com/ttskch/google-sheets-api-php-client","last_synced_at":"2025-03-21T04:32:45.171Z","repository":{"id":57073385,"uuid":"101169855","full_name":"ttskch/google-sheets-api-php-client","owner":"ttskch","description":"PHP client library for Google Sheets API.","archived":false,"fork":false,"pushed_at":"2018-11-09T08:14:15.000Z","size":15,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-08T13:21:53.253Z","etag":null,"topics":["api-client","google-sheets","spreadsheets"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ttskch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-23T10:52:13.000Z","updated_at":"2024-04-24T00:07:53.000Z","dependencies_parsed_at":"2022-08-24T14:54:40.879Z","dependency_job_id":null,"html_url":"https://github.com/ttskch/google-sheets-api-php-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttskch%2Fgoogle-sheets-api-php-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttskch%2Fgoogle-sheets-api-php-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttskch%2Fgoogle-sheets-api-php-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttskch%2Fgoogle-sheets-api-php-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ttskch","download_url":"https://codeload.github.com/ttskch/google-sheets-api-php-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221811464,"owners_count":16884335,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","google-sheets","spreadsheets"],"created_at":"2024-10-28T09:24:54.802Z","updated_at":"2024-10-28T09:24:55.360Z","avatar_url":"https://github.com/ttskch.png","language":"PHP","readme":"# google-sheets-api-php-client\n\n[![Latest Stable Version](https://poser.pugx.org/ttskch/google-sheets-api-php-client/v/stable)](https://packagist.org/packages/ttskch/google-sheets-api-php-client)\n[![Total Downloads](https://poser.pugx.org/ttskch/google-sheets-api-php-client/downloads)](https://packagist.org/packages/ttskch/google-sheets-api-php-client)\n\nPHP client library for Google Sheets API.\n\n## Requirements\n\n- PHP 5.6+\n\n## Installations\n\n```bash\n$ composer require ttskch/google-sheets-api-php-client:@dev\n```\n\n## Usage\n\n### Initializing API client\n\n#### With OAuth2\n\n```php\n// create \\Google_Client instance with your OAuth2 client ID.\n$googleClient = \\Ttskch\\GoogleSheetsApi\\Factory\\GoogleClientFactory::createOAuthClient(\n    'client_id',\n    'client_secret',\n    'redirect_uri',\n    'javascript_origin'\n);\n\n// authenticate and be athorized.\n$authenticator = new \\Ttskch\\GoogleSheetsApi\\Authenticator($googleClient);\nif (isset($_GET['code'])) {\n    $authenticator-\u003eauthenticate($_GET['code']);\n} else {\n    $authenticator-\u003eauthorize();\n}\n```\n\n#### With Service Account\n\n```php\n// create \\Google_Client instance with your Service Account credentials json file.\n$googleClient = \\Ttskch\\GoogleSheetsApi\\Factory\\GoogleClientFactory::createServiceAccountClient('/path/to/service-account-credentials.json');\n```\n\n### Using API\n\n```php\n// create API client with authorized \\Google_Client.\n$api = \\Ttskch\\GoogleSheetsApi\\Factory\\ApiClientFactory::create($googleClient);\n\n$service = $api-\u003egetGoogleService();\n\n// now you can call all apis via $service.\n// see \\Google_Service_Sheets class to learn more about details.\n$service-\u003espreadsheets-\u003e...;\n$service-\u003espreadsheets_sheets-\u003e...;\n$service-\u003espreadsheets_values-\u003e...;\n```\n\nSee also [demo](demo).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttskch%2Fgoogle-sheets-api-php-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttskch%2Fgoogle-sheets-api-php-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttskch%2Fgoogle-sheets-api-php-client/lists"}