PHPackages                             laahudra/twitch-api-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. laahudra/twitch-api-php

ActiveLibrary[API Development](/categories/api)

laahudra/twitch-api-php
=======================

A Twitch API client for PHP.

v0.1.7(8y ago)017MITPHPPHP &gt;=5.6.0

Since Feb 21Pushed 8y ago1 watchersCompare

[ Source](https://github.com/LaaHudra/twitch-api-php)[ Packagist](https://packagist.org/packages/laahudra/twitch-api-php)[ Docs](http://github.com/laahudra/twitch-api-php)[ RSS](/packages/laahudra-twitch-api-php/feed)WikiDiscussions master Synced 3d ago

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

twitch-api-php
==============

[](#twitch-api-php)

A Twitch API client for PHP.

[![Build Status](https://camo.githubusercontent.com/31f0013fbe2b4933ae5502d8a429a702b76eca980b8038be1518c44b9cc94e23/68747470733a2f2f7472617669732d63692e6f72672f6e69636b6c6177352f7477697463682d6170692d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/nicklaw5/twitch-api-php)

Supported APIs
--------------

[](#supported-apis)

This library aims to support `v3`, `v4` and `v5` of the Twitch API until each one becomes [deprecated](https://dev.twitch.tv/docs#which-api-version-can-you-use). If an API version is not specified, `v5` will be used as the default.

Features Completed
------------------

[](#features-completed)

**Main API Endpoints:**

- Authentication
- Bits
- Channel Feed
- Channels
- Chat
- Clips
- Collections
- Communities
- Games
- Ingests
- Search
- Streams
- Teams
- Users
- Videos

Any endpoints missing? Open an [issue here](https://github.com/nicklaw5/twitch-api-php/issues).

**Other Features:**

- IRC Client
- Pub/Sub (ie. Bits &amp; Whispers)
- Video Upload

**Additional Integrations:**

- [StreamsLabs:](https://twitchalerts.readme.io/docs/getting-started)
    - Alerts
    - Authentication
    - Donations
    - Users

Basic Example
-------------

[](#basic-example)

```
$options = [
    'client_id' => 'YOUR-CLIENT-ID',
];

$twitchApi = new \TwitchApi\TwitchApi($options);
$user = $twitchApi->getUser(26490481);

// By default API responses are returned as an array, but if you want the raw JSON instead:
$twitchApi->setReturnJson(true);
$user = $twitchApi->getUser(26490481);

// If you want to switch between API versions on the fly:
$twitchApi->setApiVersion(3);
$user = $twitchApi->getUser('summit1g');
```

See the [examples](examples) directory for more common use cases.

Requirements
------------

[](#requirements)

PHP 5.6 or higher is required.

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

[](#installation)

Either pull in the library via composer:

```
$ composer require nicklaw5/twitch-api-php
```

or add the following dependency to your `composer.json` file and run `composer install`:

```
"nicklaw5/twitch-api-php": "0.1.*"
```

Tests
-----

[](#tests)

All unit tests can be run with the following command:

```
$ vendor/bin/phpunit # or simply "phpunit" if you have it installed globally
```

Documentation
-------------

[](#documentation)

The Twitch API docs can be found [here](https://dev.twitch.tv/docs).

As for the documentation of this library, that is still on the to-do list. In the meantime, most modern IDEs by default, or through the use of plugins, will provide class property and method auto-completion. Or you can simple look through the [source](src) code.

License
-------

[](#license)

Distributed under the [MIT](LICENSE) license.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.7% 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 ~26 days

Recently: every ~36 days

Total

8

Last Release

3183d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ecf3719611c60da4b0b1b3a37ac47df5d7bea3a973e4c521793ebfc22e06559?d=identicon)[LaaHudra](/maintainers/LaaHudra)

---

Top Contributors

[![nicklaw5](https://avatars.githubusercontent.com/u/7908386?v=4)](https://github.com/nicklaw5 "nicklaw5 (112 commits)")[![LaaHudra](https://avatars.githubusercontent.com/u/4501275?v=4)](https://github.com/LaaHudra "LaaHudra (3 commits)")[![RickyNotaro](https://avatars.githubusercontent.com/u/6414422?v=4)](https://github.com/RickyNotaro "RickyNotaro (2 commits)")

---

Tags

apitwitchtwitch.tvtwitch-tvtwitch-api

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/laahudra-twitch-api-php/health.svg)

```
[![Health](https://phpackages.com/badges/laahudra-twitch-api-php/health.svg)](https://phpackages.com/packages/laahudra-twitch-api-php)
```

###  Alternatives

[nicklaw5/twitch-api-php

A Twitch API client for PHP.

116233.0k2](/packages/nicklaw5-twitch-api-php)[m165437/laravel-blueprint-docs

API Blueprint Renderer for Laravel

22779.0k](/packages/m165437-laravel-blueprint-docs)

PHPackages © 2026

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