PHPackages                             gabrielkaputa/bitly - 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. gabrielkaputa/bitly

ActiveLibrary[API Development](/categories/api)

gabrielkaputa/bitly
===================

PHP library to consume bit.ly API

1.0.2(9y ago)373.0k↓28.8%1[1 issues](https://github.com/gabrielkaputa/bitly/issues)1GPL-3.0PHP

Since Apr 12Pushed 9y ago1 watchersCompare

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

READMEChangelogDependencies (2)Versions (6)Used By (1)

bitly
=====

[](#bitly)

[![Build Status](https://camo.githubusercontent.com/4666803dd6145265c0a27c1b5a53b9f5e548b02760de1f07584b755d60ebf2b2/68747470733a2f2f7472617669732d63692e6f72672f6761627269656c6b61707574612f6269746c792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/gabrielkaputa/bitly)[![Latest Stable Version](https://camo.githubusercontent.com/dee292a5743e8a7ad7d2b5ee532d9e317c179bdd54723304eb093b7129082060/68747470733a2f2f706f7365722e707567782e6f72672f6761627269656c6b61707574612f6269746c792f762f737461626c65)](https://packagist.org/packages/gabrielkaputa/bitly)

PHP library to consume bit.ly API

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

[](#installation)

The recommended way to install this library is through [Composer](http://getcomposer.org/doc/00-intro.md).

```
composer require gabrielkaputa/bitly
```

Usage
-----

[](#usage)

First of all, [create a bit.ly account](https://bitly.com/) if you don't have one already.

If all you need to do is to create shortlinks on behalf of a single user or site, all you need is to [get your generic access token](https://bitly.com/a/oauth_apps). When done, you can create shortlinks like this:

```
require_once("vendor/autoload.php");

$bitly = \GabrielKaputa\Bitly::withGenericAccessToken(GENERIC_ACCESS_TOKEN);
$short_url = $bitly->shortenUrl($long_url);
```

Another option is when you are working with multiple end-users or to pull any information on a user level for your own account. In this case you will need to [register your application](http://dev.bitly.com/my_apps.html)to get your `CLIENT_ID` and `CLIENT_SECRET`. When done, you can create shortlinks like this:

```
require_once("vendor/autoload.php");

$bitly = \GabrielKaputa\Bitly::withCredentials(CLIENT_ID, CLIENT_SECRET, USERNAME, PASSWORD);
$short_url = $bitly->shortenUrl($long_url);
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 96.2% 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 ~96 days

Total

4

Last Release

3400d ago

Major Versions

0.1.0 → 1.0.02016-04-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/142fe96b538e720922d6eefef0ff410f398cc74458fb60dedb1fe30c6b9a82a0?d=identicon)[gabriel.kaputa](/maintainers/gabriel.kaputa)

---

Top Contributors

[![gabrielkaputa](https://avatars.githubusercontent.com/u/7780548?v=4)](https://github.com/gabrielkaputa "gabrielkaputa (25 commits)")[![maddhatter](https://avatars.githubusercontent.com/u/4449339?v=4)](https://github.com/maddhatter "maddhatter (1 commits)")

---

Tags

phpapibitlygabrielkaputa

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gabrielkaputa-bitly/health.svg)

```
[![Health](https://phpackages.com/badges/gabrielkaputa-bitly/health.svg)](https://phpackages.com/packages/gabrielkaputa-bitly)
```

###  Alternatives

[phplicengine/bitly

Bitly API v4

22277.3k](/packages/phplicengine-bitly)[jstolpe/instagram-graph-api-php-sdk

Instagram Graph API PHP SDK

13998.4k2](/packages/jstolpe-instagram-graph-api-php-sdk)

PHPackages © 2026

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