PHPackages                             knplabs/github-api - 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. knplabs/github-api

ActiveLibrary[API Development](/categories/api)

knplabs/github-api
==================

GitHub API v3 client

v3.16.0(1y ago)2.2k15.8M—2.3%590[40 issues](https://github.com/KnpLabs/php-github-api/issues)[13 PRs](https://github.com/KnpLabs/php-github-api/pulls)20MITPHPPHP ^7.2.5 || ^8.0CI passing

Since Jul 12Pushed 2mo ago71 watchersCompare

[ Source](https://github.com/KnpLabs/php-github-api)[ Packagist](https://packagist.org/packages/knplabs/github-api)[ Docs](https://github.com/KnpLabs/php-github-api)[ GitHub Sponsors](https://github.com/acrobat)[ RSS](/packages/knplabs-github-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (21)Versions (96)Used By (20)

PHP GitHub API
==============

[](#php-github-api)

[![Build Status](https://github.com/KnpLabs/php-github-api/actions/workflows/ci.yml/badge.svg)](https://github.com/KnpLabs/php-github-api/actions/workflows/ci.yml/badge.svg)[![StyleCI](https://camo.githubusercontent.com/d22b2743b0defd9b8e47bcb315acfbaf380baf34826bc495a5aae787b317c8fc/68747470733a2f2f7374796c6563692e696f2f7265706f732f333934383530312f736869656c643f7374796c653d666c6174)](https://styleci.io/repos/3948501)[![Latest Stable Version](https://camo.githubusercontent.com/131ebb31637b06670ba7610717e2e3d74018c99dd1809419f85084f2b753b44f/68747470733a2f2f706f7365722e707567782e6f72672f6b6e706c6162732f6769746875622d6170692f762f737461626c65)](https://packagist.org/packages/knplabs/github-api)[![Total Downloads](https://camo.githubusercontent.com/83fcd5b554040644310750dbb454571703c08bcdd34a7ddbeaee6e2a8d624d47/68747470733a2f2f706f7365722e707567782e6f72672f6b6e706c6162732f6769746875622d6170692f646f776e6c6f616473)](https://packagist.org/packages/knplabs/github-api)[![Monthly Downloads](https://camo.githubusercontent.com/08b4eedb9652c803b8b8b5c505fb051aa8e94fd9ee94fe5780e8d8f63356a4af/68747470733a2f2f706f7365722e707567782e6f72672f6b6e706c6162732f6769746875622d6170692f642f6d6f6e74686c79)](https://packagist.org/packages/knplabs/github-api)[![Daily Downloads](https://camo.githubusercontent.com/068ddd69415d4de39046fb21426952a2cf2afa5a251f5e836cadfa46f8debc02/68747470733a2f2f706f7365722e707567782e6f72672f6b6e706c6162732f6769746875622d6170692f642f6461696c79)](https://packagist.org/packages/knplabs/github-api)

A simple Object Oriented wrapper for GitHub API, written with PHP.

Uses [GitHub API v3](http://developer.github.com/v3/) &amp; supports [GitHub API v4](http://developer.github.com/v4). The object API (v3) is very similar to the RESTful API.

Features
--------

[](#features)

- Light and fast thanks to lazy loading of API classes
- Extensively tested and documented

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

[](#requirements)

- PHP &gt;= 7.2
- A [PSR-17 implementation](https://packagist.org/providers/psr/http-factory-implementation)
- A [PSR-18 implementation](https://packagist.org/providers/psr/http-client-implementation)

Quick install
-------------

[](#quick-install)

Via [Composer](https://getcomposer.org).

This command will get you up and running quickly with a Guzzle HTTP client.

```
composer require knplabs/github-api:^3.0 guzzlehttp/guzzle:^7.0.1 http-interop/http-factory-guzzle:^1.0
```

Advanced install
----------------

[](#advanced-install)

We are decoupled from any HTTP messaging client with help by [HTTPlug](https://httplug.io).

### Using a different http client

[](#using-a-different-http-client)

```
composer require knplabs/github-api:^3.0 symfony/http-client nyholm/psr7
```

To set up the Github client with this HTTP client

```
use Github\Client;
use Symfony\Component\HttpClient\HttplugClient;

$client = Client::createWithHttpClient(new HttplugClient());
```

Read more about [using different clients in our docs](doc/customize.md).

Framework integrations
----------------------

[](#framework-integrations)

### Laravel

[](#laravel)

To integrate this library in laravel [Graham Campbell](https://github.com/GrahamCampbell) created [graham-campbell/github](https://github.com/GrahamCampbell/Laravel-GitHub). See the [installation instructions](https://github.com/GrahamCampbell/Laravel-GitHub#installation) to get started in laravel.

Basic usage of `php-github-api` client
--------------------------------------

[](#basic-usage-of-php-github-api-client)

```
