PHPackages                             yuseferi/google-shortly-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. yuseferi/google-shortly-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

yuseferi/google-shortly-php
===========================

A PHP library to generate shortened URL through The Google Shortener API

v1.0(6y ago)04MITPHPPHP &gt;=5.3.0CI failing

Since Mar 13Pushed 6y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (1)Versions (5)Used By (0)

Php Google Shortner Url
=======================

[](#php-google-shortner-url)

A PHP5 library to generate shortened URL through The Google URL Shortener API.

Usage
-----

[](#usage)

Using an Google API key is highly recommended. To acquire an API key follow [the instructions](https://developers.google.com/url-shortener/v1/getting_started#APIKey).

### Shorten URL

[](#shorten-url)

Shorten a long URL using The Google URL Shortener API

```
try {
    $googShort = new \yuseferi\GoogShortly('YOUR_GOOGLE_API');
    echo $googShort->shorten('http://yuseferi.com');
} catch (\yuseferi\GoogShortlyException $e) {
    printf('Error (%d): %s', $e->getCode(), $e->getMessage());
}
```

### Expand URL

[](#expand-url)

Expand a short URL using The Google URL Shortener API

```
try {
    $googShort = new \yuseferi\GoogShortly('YOUR_GOOGLE_API');
    echo $googShort->expand('http://goo.gl/KkZ8');
} catch (\yuseferi\GoogShortlyException $e) {
    printf('Error (%d): %s', $e->getCode(), $e->getMessage());
}
```

Install
-------

[](#install)

### Via composer:

[](#via-composer)

```
$ composer require yuseferi/google-shortly-php
```

### Without composer

[](#without-composer)

Clone the project using `git clone https://github.com/yuseferi/google-shortly-php/`and include the source file with `require_once("google-shortly-php/src/GoogShortly.php");`

Test
----

[](#test)

First install the dependencies, and after you can run:

```
GOOGLE_API=YOUR_GOOGLE_API vendor/bin/phpunit
```

License
-------

[](#license)

Licensed under the MIT license:

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~349 days

Total

4

Last Release

2305d ago

Major Versions

0.1.2 → v1.02020-01-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/7b14bd531ff132808fda9211617694b92711f10796730c92a23691fe525ba203?d=identicon)[yuseferi](/maintainers/yuseferi)

---

Top Contributors

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

---

Tags

short urlphp-shortenergoogle-short-url-phpshortener-php

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yuseferi-google-shortly-php/health.svg)

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

###  Alternatives

[yourls/yourls

Your Own URL Shortener

11.9k27.7k1](/packages/yourls-yourls)[soluble/japha

Soluble PHP Java bridge integration

7343.5k3](/packages/soluble-japha)

PHPackages © 2026

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