# TwitchApi

<!--- [![ Downloads](]( -->

This library provides an Elixir library for twitch API. It makes use of an Elixir scrapper for [Twitch API](

## Library configuration

For making use of this library you will need to create a `.env` with the env vars from the `.env_example`. The env vars needed have to be fetched from [twitch developer documentation](

In the [.env](.env) file environment vars needs to be defined for usage. Those need to be loaded when working with this project. To do so, one can manually execute:

source .env

or automate this process using [direnv](

# Install direnv using brew
$ brew install direnv

# From the project folder
$ direnv allow

Continue with the instructions [here](

## Library usage

The library provides dynamically modules for fetching all Twitch API endpoints. The convention is: `TwitchApi.<TwitchCategory>.<Action><Endpoint>`. The convention might not be a rule since Twitch reference do not follow this rule always.

This is an example running iex:

iex(1)> h TwitchApi.Users.GetUsers


⛔ This module is autogenerated please do not modify manually.

## Example request from twitch api docs:

### descriptions:

This gets information about user 141981764.

### requests:

curl -X GET '' -H'Authorization:
Bearer cfabdegwdoklmawdzdo98xt2fo512y' -H'Client-Id:

## Example response from twitch api docs:

### descriptions:

### responses:

third-party developers building Twitch integrations from chatbots to game

iex(2)> h

                                 def call(map)                                  

  @spec call(id() | login()) ::
          {:ok, Finch.Response.t()} | {:error, Exception.t()}

### Description:

Gets information about one or more specified Twitch users. Users are identified
by optional user IDs and/or login name.

### Required authentication:

OAuth or App Access Token required.

### Required authorization:

OAuth token with user:read:email scope required to include the user’s verified
email address in response.

iex(4)>{login: "hiimkamiyuzu"})
   body: "{\"data\":[{\"id\":\"61425548\",\"login\":\"hiimkamiyuzu\",\"display_name\":\"hiimkamiyuzu\",\"type\":\"\",\"broadcaster_type\":\"\",\"description\":\"\",\"profile_image_url\":\"\",\"offline_image_url\":\"\",\"view_count\":56,\"created_at\":\"2014-04-22T20:21:11Z\"}]}",
   headers: [
     {"connection", "keep-alive"},
     {"content-length", "344"},
     {"content-type", "application/json; charset=utf-8"},
     {"access-control-allow-origin", "*"},
     {"ratelimit-limit", "800"},
     {"ratelimit-remaining", "799"},
     {"ratelimit-reset", "1635433387"},
     {"timing-allow-origin", ""},
     {"twitch-trace-id", "a3b64ecc00d7eeb6e4907178aed26f75"},
     {"x-ctxlog-logid", "1-617abbaa-3c3a10aa517d7b763d900346"},
     {"date", "Thu, 28 Oct 2021 15:03:07 GMT"},
     {"x-served-by", "cache-sea4446-SEA, cache-bma1646-BMA"},
     {"x-cache", "MISS, MISS"},
     {"x-cache-hits", "0, 0"},
     {"x-timer", "S1635433387.877013,VS0,VS0,VE170"},
     {"vary", "Accept-Encoding"},
     {"strict-transport-security", "max-age=300"}
   status: 200
iex(3)> t TwitchApi.Users.GetUsers.                            
id/0       login/0    
iex(4)> t
@type id() :: %{id: String.t()}

User ID. Multiple user IDs can be specified. Limit: 100.

iex(5)> t TwitchApi.Users.GetUsers.login
@type login() :: %{login: String.t()}

User login name. Multiple login names can be specified. Limit: 100.

## Installation

If [available in Hex](, the package can be installed
by adding `scrapped_twitch_api` to your list of dependencies in `mix.exs`:

def deps do
    {:scrapped_twitch_api, "~> 0.1.1"}

Docs can be found at [](