PHPackages                             nattaponra/google-short-url-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. nattaponra/google-short-url-php

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

nattaponra/google-short-url-php
===============================

PHP Library for easy convert long url to short url.

1.1.0(8y ago)22522proprietaryPHP

Since Oct 10Pushed 8y ago1 watchersCompare

[ Source](https://github.com/nattaponra/google-short-url-php)[ Packagist](https://packagist.org/packages/nattaponra/google-short-url-php)[ RSS](/packages/nattaponra-google-short-url-php/feed)WikiDiscussions master Synced today

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

google-short-url-php
====================

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

PHP Library for easy convert long url to short url.

Install library with composer.
------------------------------

[](#install-library-with-composer)

```
composer require nattaponra/google-short-url-php dev-master

```

Inherent class and setting api key.
-----------------------------------

[](#inherent-class-and-setting-api-key)

```
// If your don't has api key please read this document > https://developers.google.com/identity/protocols/OAuth2
$apiKey = "XxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxX";
$goo = new Googl($apiKey);
```

Create short of
------------------------------------

[](#create-short-of-httpsgithubcom)

```
$shortUrl = "https://github.com";
$resultOfShortening = $goo->shorten($shortUrl);
print_r($resultOfShortening);
// Result utl : https://goo.gl/un5E
```

Result:

```
{
 "kind": "urlshortener#url",
 "id": "https://goo.gl/un5E",
 "longUrl": "https://github.com/"
}
```

Try to expand short url to long url.
------------------------------------

[](#try-to-expand-short-url-to-long-url)

```
$longUrl = "https://goo.gl/un5E";
$resultOfExpansion = $goo->expand($longUrl);
print_r($resultOfExpansion);
// Result utl : https://github.com
```

Result:

```
{
 "kind": "urlshortener#url",
 "id": "https://goo.gl/un5E",
 "longUrl": "https://github.com/",
 "status": "OK"
}
```

Get stat of short url.
----------------------

[](#get-stat-of-short-url)

```
$result = $goo->lookUpAnalytics("https://goo.gl/un5E");
print_r($result);
```

Result:

```
{
 "kind": "urlshortener#url",
 "id": "https://goo.gl/un5E",
 "longUrl": "https://github.com/",
 "status": "OK",
 "created": "2009-12-18T02:20:15.000+00:00",
 "analytics": {
  "allTime": {
   "shortUrlClicks": "2390",
   "longUrlClicks": "4822",
   "referrers": [
    {
     "count": "764",
     "id": "unknown"
    },
    {
     "count": "645",
     "id": "talaroid.com"
    },
    {
     "count": "526",
     "id": "www.chatlogix.com"
    },
    {
     "count": "163",
     "id": "tysgo.com.gt"
    },
    {
     "count": "142",
     "id": "jalebiyat.com"
    },
    {
     "count": "19",
     "id": "by3.eu"
    },
    {
     "count": "18",
     "id": "phraseapp.com"
    },
    {
     "count": "12",
     "id": "web-your-enthusiasm.surge.sh"
    },
    {
     "count": "9",
     "id": "umass-cs-326.github.io"
    },
    {
     "count": "7",
     "id": "ubuntuforums.org"
    }
   ],
   "countries": [
    {
     "count": "892",
     "id": "US"
    },
    {
     "count": "863",
     "id": "IR"
    },
    {
     "count": "54",
     "id": "JP"
    },
    {
     "count": "51",
     "id": "GB"
    },
    {
     "count": "43",
     "id": "DE"
    },
    {
     "count": "39",
     "id": "BR"
    },
    {
     "count": "39",
     "id": "CN"
    },
    {
     "count": "34",
     "id": "IN"
    },
    {
     "count": "20",
     "id": "FR"
    },
    {
     "count": "18",
     "id": "BY"
    }
   ],
   "browsers": [
    {
     "count": "1563",
     "id": "Chrome"
    },
    {
     "count": "310",
     "id": "Firefox"
    },
    {
     "count": "213",
     "id": "MSIE"
    },
    {
     "count": "158",
     "id": "SamsungBrowser"
    },
    {
     "count": "67",
     "id": "Safari"
    },
    {
     "count": "32",
     "id": "Mobile Safari"
    },
    {
     "count": "18",
     "id": "CriOS"
    },
    {
     "count": "8",
     "id": "Mobile"
    },
    {
     "count": "5",
     "id": "UCBrowser"
    },
    {
     "count": "4",
     "id": "Dalvik"
    }
   ],
   "platforms": [
    {
     "count": "964",
     "id": "Windows"
    },
    {
     "count": "668",
     "id": "Macintosh"
    },
    {
     "count": "565",
     "id": "Android"
    },
    {
     "count": "87",
     "id": "X11"
    },
    {
     "count": "53",
     "id": "iPhone"
    },
    {
     "count": "10",
     "id": "iPad"
    },
    {
     "count": "8",
     "id": "Android 6.0.1"
    },
    {
     "count": "6",
     "id": "Android 4.4.2"
    },
    {
     "count": "6",
     "id": "Android 5.0.1"
    },
    {
     "count": "3",
     "id": "Android 5.1"
    }
   ]
  },
  "month": {
   "shortUrlClicks": "66",
   "longUrlClicks": "104",
   "referrers": [
    {
     "count": "29",
     "id": "unknown"
    },
    {
     "count": "17",
     "id": "jalebiyat.com"
    },
    {
     "count": "12",
     "id": "web-your-enthusiasm.surge.sh"
    },
    {
     "count": "5",
     "id": "talaroid.com"
    },
    {
     "count": "3",
     "id": "virtual.universidadean.edu.co"
    }
   ],
   "countries": [
    {
     "count": "25",
     "id": "IR"
    },
    {
     "count": "12",
     "id": "US"
    },
    {
     "count": "5",
     "id": "CO"
    },
    {
     "count": "3",
     "id": "GB"
    },
    {
     "count": "2",
     "id": "AT"
    },
    {
     "count": "2",
     "id": "AU"
    },
    {
     "count": "2",
     "id": "IN"
    },
    {
     "count": "2",
     "id": "IQ"
    },
    {
     "count": "2",
     "id": "MA"
    },
    {
     "count": "1",
     "id": "FR"
    }
   ],
   "browsers": [
    {
     "count": "42",
     "id": "Chrome"
    },
    {
     "count": "17",
     "id": "Firefox"
    },
    {
     "count": "3",
     "id": "Mobile Safari"
    },
    {
     "count": "3",
     "id": "SamsungBrowser"
    },
    {
     "count": "1",
     "id": "CriOS"
    }
   ],
   "platforms": [
    {
     "count": "28",
     "id": "Windows"
    },
    {
     "count": "17",
     "id": "Android"
    },
    {
     "count": "8",
     "id": "X11"
    },
    {
     "count": "3",
     "id": "Macintosh"
    },
    {
     "count": "1",
     "id": "Android 5.0.1"
    },
    {
     "count": "1",
     "id": "Android 5.1"
    },
    {
     "count": "1",
     "id": "iPhone"
    }
   ]
  },
  "week": {
   "shortUrlClicks": "12",
   "longUrlClicks": "17",
   "referrers": [
    {
     "count": "10",
     "id": "unknown"
    },
    {
     "count": "1",
     "id": "jalebiyat.com"
    },
    {
     "count": "1",
     "id": "virtual.universidadean.edu.co"
    }
   ],
   "countries": [
    {
     "count": "3",
     "id": "IR"
    },
    {
     "count": "2",
     "id": "GB"
    },
    {
     "count": "2",
     "id": "IQ"
    },
    {
     "count": "2",
     "id": "US"
    },
    {
     "count": "1",
     "id": "AU"
    },
    {
     "count": "1",
     "id": "FR"
    },
    {
     "count": "1",
     "id": "YE"
    }
   ],
   "browsers": [
    {
     "count": "5",
     "id": "Chrome"
    },
    {
     "count": "4",
     "id": "Firefox"
    },
    {
     "count": "2",
     "id": "SamsungBrowser"
    },
    {
     "count": "1",
     "id": "Mobile Safari"
    }
   ],
   "platforms": [
    {
     "count": "6",
     "id": "Android"
    },
    {
     "count": "2",
     "id": "Windows"
    },
    {
     "count": "2",
     "id": "X11"
    },
    {
     "count": "1",
     "id": "Android 5.0.1"
    },
    {
     "count": "1",
     "id": "Android 5.1"
    }
   ]
  },
  "day": {
   "shortUrlClicks": "2",
   "longUrlClicks": "3",
   "referrers": [
    {
     "count": "2",
     "id": "unknown"
    }
   ],
   "countries": [
    {
     "count": "2",
     "id": "IQ"
    }
   ],
   "browsers": [
    {
     "count": "2",
     "id": "Chrome"
    }
   ],
   "platforms": [
    {
     "count": "2",
     "id": "Android"
    }
   ]
  },
  "twoHours": {
   "shortUrlClicks": "0",
   "longUrlClicks": "0"
  }
 }
}
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

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

Total

2

Last Release

3136d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/976bb3a04634779e37b68cdeb952d35fa01f7f1963d2ee679e865a503bef3413?d=identicon)[nattaponra](/maintainers/nattaponra)

---

Top Contributors

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

---

Tags

shorturl

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nattaponra-google-short-url-php/health.svg)

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

PHPackages © 2026

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