PHPackages                             wikisource/google-cloud-vision-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. wikisource/google-cloud-vision-php

Abandoned → [google/cloud-vision](/?search=google%2Fcloud-vision)Library[API Development](/categories/api)

wikisource/google-cloud-vision-php
==================================

A PHP interface to Google's Cloud Vision API.

1.2.0(8y ago)71.5k[1 issues](https://github.com/wikisource/google-cloud-vision-php/issues)GPL-3.0+PHP

Since Mar 19Pushed 8y ago6 watchersCompare

[ Source](https://github.com/wikisource/google-cloud-vision-php)[ Packagist](https://packagist.org/packages/wikisource/google-cloud-vision-php)[ Docs](https://github.com/wikisource/google-cloud-vision-php)[ RSS](/packages/wikisource-google-cloud-vision-php/feed)WikiDiscussions master Synced 4w ago

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

Google Cloud Vision PHP
=======================

[](#google-cloud-vision-php)

This is a simple PHP interface to the [Google Cloud Vision API](https://cloud.google.com/vision/).

[![Build Status](https://camo.githubusercontent.com/a2f9c58e474a70ecb7cbf2344251a0dceb67a9d099be2c3bd32600a545b5f4f5/68747470733a2f2f7472617669732d63692e6f72672f77696b69736f757263652f676f6f676c652d636c6f75642d766973696f6e2d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/wikisource/google-cloud-vision-php)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a3605ee3bc5e7f85f274dc58f98fc983b7b069d98cb973b2cc2514b51fc9df0e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f77696b69736f757263652f676f6f676c652d636c6f75642d766973696f6e2d7068702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/wikisource/google-cloud-vision-php/?branch=master)

Features:

- Supports almost all features of the Cloud Vision API (version 1).
- Loads images from files, URLs, raw data, or Google Cloud Storage.

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

[](#installation)

Requirements:

- PHP ≥ 5.6
- API key (see Google's [Getting Started](https://cloud.google.com/vision/docs/getting-started) documentation)

To install, first add this to your `composer.json`:

```
    "require": {
        "wikisource/google-cloud-vision-php": "^1.2"
    }
```

...and run `composer update`.

Usage
-----

[](#usage)

```
use GoogleCloudVisionPHP\GoogleCloudVision;

$gcv = new GoogleCloudVision();

// Get your API key from the Google Cloud Platform site.
$gcv->setKey("[Key from Google]");

// An image can be set from either a filename or URL (the default), raw data, or a Google Cloud Storage item:
$gcv->setImage("local/filesystem/file.png");
$gcv->setImage("https://example.org/url/to/file.png");
$gcv->setImage(file_get_contents('local/file.png'), GoogleCloudVision::IMAGE_TYPE_RAW);
$gcv->setImage("gs://bucket_name/object_name", GoogleCloudVision::IMAGE_TYPE_GCS);

// Set which features you want to retrieve:
$gcv->addFeatureUnspecified(1);
$gcv->addFeatureFaceDetection(1);
$gcv->addFeatureLandmarkDetection(1);
$gcv->addFeatureLogoDetection(1);
$gcv->addFeatureLabelDetection(1);
$gcv->addFeatureTextDetection(1);
$gcv->addFeatureDocumentTextDetection(1);
$gcv->addFeatureSafeSeachDetection(1);
$gcv->addFeatureImageProperty(1);

// Optional. The API will try to guess the language if you don't set this.
$gcv->setImageContext(['languageHints' => ['th']]);

$response = $gcv->request();
```

Kudos
-----

[](#kudos)

This is a fork of [thangman22's original library](https://github.com/thangman22/google-cloud-vision-php), and all credit goes to them.

Test images are from:

1. `Munich_subway_station_Hasenbergl_2.JPG` by Martin Falbisoner [CC BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0)via [Wikimedia Commons](https://commons.wikimedia.org/wiki/File%3AMunich_subway_station_Hasenbergl_2.JPG)

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 91.3% 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 ~46 days

Recently: every ~94 days

Total

13

Last Release

3209d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a0281a00958518a98244b8a6052f91e86d1599aebf9b7bb6c55bca30d98774e7?d=identicon)[samwilson](/maintainers/samwilson)

---

Top Contributors

[![samwilson](https://avatars.githubusercontent.com/u/213655?v=4)](https://github.com/samwilson "samwilson (21 commits)")[![amenk](https://avatars.githubusercontent.com/u/1087128?v=4)](https://github.com/amenk "amenk (1 commits)")[![klefix](https://avatars.githubusercontent.com/u/2960411?v=4)](https://github.com/klefix "klefix (1 commits)")

---

Tags

apigooglegoogle-cloud-visionocrwikisourcegoogleimagesOCRvisionapistranscribing

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/wikisource-google-cloud-vision-php/health.svg)

```
[![Health](https://phpackages.com/badges/wikisource-google-cloud-vision-php/health.svg)](https://phpackages.com/packages/wikisource-google-cloud-vision-php)
```

###  Alternatives

[google/apiclient

Client library for Google APIs

9.8k205.9M1.1k](/packages/google-apiclient)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[google/cloud

Google Cloud Client Library

1.2k16.7M57](/packages/google-cloud)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.5M7](/packages/avalara-avataxclient)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)

PHPackages © 2026

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