Giter Club home page Giter Club logo

twitch-api-php's Introduction

twitch-api-php

A Twitch API client for PHP.

Build Status

Supported APIs

This library aims to support v3, v4 and v5 of the Twitch API until each one becomes deprecated. If an API version is not specified, v5 will be used as the default.

Features Completed

Main API Endpoints:

  • Authentication
  • Channel Feed
  • Channels
  • Chat
  • Clips
  • Communities
  • Games
  • Ingests
  • Search
  • Streams
  • Teams
  • Users
  • Videos

Any endpoints missing? Open an issue here.

Other Features:

  • IRC Client
  • Pub/Sub (ie. Bits & Whispers)
  • Video Upload

Additional Integrations:

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 directory for more common use cases.

Requirements

PHP 5.6 or higher is required.

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

All unit tests can be run with the following command:

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

Documentation

The Twitch API docs can be found here.

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 code.

License

Distributed under the MIT license.

twitch-api-php's People

Contributors

nicklaw5 avatar rickynotaro avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.