PHPackages                             titeya/google-people-api - 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. titeya/google-people-api

ActiveLibrary[API Development](/categories/api)

titeya/google-people-api
========================

This package provides a user friendly way of interacting with Google Contacts via the Google People API.

1.2(4y ago)0103LGPL-3.0-onlyPHP

Since Nov 25Pushed 4y ago1 watchersCompare

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

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

👥 PHP Google People API
=======================

[](#-php-google-people-api)

This package provides a user friendly way of interacting with Google Contacts via the Google People API.

[![](assets/images/google-people-api.png)](assets/images/google-people-api.png)

Installation
------------

[](#installation)

PHP Google People API can be easily installed using Composer. Just run the following command from the root of your project.

```
composer require titeya/google-people-api

```

If you have never used the Composer dependency manager before, head to the [Composer website](https://getcomposer.org/) for more information on how to get started.

Setup
-----

[](#setup)

To use this package, you need to authenticate with Google via OAuth 2. Thankfully, this is made easy by the PHP Google OAuth 2 Handler package.

You can run its guided setup script with the following command.

```
php vendor/titeya/google-oauth-2-handler/src/setup.php

```

This will guide you through the process of setting up a project, and logging into to the Google account that you wish to manage contacts for. When asked which scopes you require access to, enter the following.

```
https://www.googleapis.com/auth/userinfo.profile
https://www.googleapis.com/auth/contacts
https://www.googleapis.com/auth/contacts.readonly

```

When complete, you will have to code you need to create a `GoogleOAuth2Handler` object for this Google account.

You can then create a `GooglePeople` object, as follows.

```
$people = new GooglePeople($googleOAuth2Handler);
```

Usage
-----

[](#usage)

### Retrieve all groups

[](#retrieve-all-groups)

```
// Retrieval all contacts
foreach($people->groupAll() as $group) {
    echo $group->resourceName.' - ';
    echo $group->name;
    echo PHP_EOL;
}
```

### Retrieve a single group

[](#retrieve-a-single-group)

```
// Retrieve single contact (by resource name)
$group = $people->groupGet('contactGroups/c805502054287');
```

### Create a new group

[](#create-a-new-group)

```
// Create new group
$group = new \stdClass();
$group->name="new group";
$people->groupSave($group);
```

### Delete a group

[](#delete-a-group)

```
// Delete group
$people->groupDelete("contactGroups/c805502054287");
```

### Retrieve all contacts

[](#retrieve-all-contacts)

```
// Retrieval all contacts
foreach($people->contactall() as $contact) {
    echo $contact->resourceName.' - ';
    if ($contact->names) {
        echo $contact->names[0]->displayName;
    }
    echo PHP_EOL;
}
```

### Retrieve a single contact

[](#retrieve-a-single-contact)

```
// Retrieve single contact (by resource name)
$contact = $people->contactGet('people/c8055020007701654287');
```

### Create a new contact

[](#create-a-new-contact)

```
// Create new contact
$contact = new Contact($people);
$contact->names[0] = new stdClass;
$contact->names[0]->givenName = 'Testy';
$contact->names[0]->familyName = 'McTest Test';
$contact->save();
```

### Update a contact

[](#update-a-contact)

```
// Update contact
$contact->names[0]->familyName = 'McTest';
$contact->save();
```

### Delete a contact

[](#delete-a-contact)

```
// Delete contact
$contact->delete();
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Every ~12 days

Total

3

Last Release

1610d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9270d4fdb2de7526741d62a4e08a95008810ee755da3e46ae9e3e2b94586c567?d=identicon)[titeya](/maintainers/titeya)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/titeya-google-people-api/health.svg)

```
[![Health](https://phpackages.com/badges/titeya-google-people-api/health.svg)](https://phpackages.com/packages/titeya-google-people-api)
```

###  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)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

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

PHP wrapper for the Meilisearch API

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

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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