{"id":20345192,"url":"https://github.com/kamiyuzu/scrapped_twitch_api","last_synced_at":"2026-06-08T10:31:56.037Z","repository":{"id":57546231,"uuid":"418487930","full_name":"kamiyuzu/scrapped_twitch_api","owner":"kamiyuzu","description":"The project provides Elixir API library requests from Twitch API reference","archived":false,"fork":false,"pushed_at":"2022-11-28T09:14:46.000Z","size":255,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-04T15:47:32.875Z","etag":null,"topics":["elixir","hacktoberfest","twitch"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kamiyuzu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-18T12:19:32.000Z","updated_at":"2022-10-22T14:29:08.000Z","dependencies_parsed_at":"2023-01-23T17:45:10.567Z","dependency_job_id":null,"html_url":"https://github.com/kamiyuzu/scrapped_twitch_api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kamiyuzu/scrapped_twitch_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamiyuzu%2Fscrapped_twitch_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamiyuzu%2Fscrapped_twitch_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamiyuzu%2Fscrapped_twitch_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamiyuzu%2Fscrapped_twitch_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kamiyuzu","download_url":"https://codeload.github.com/kamiyuzu/scrapped_twitch_api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamiyuzu%2Fscrapped_twitch_api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34059154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","hacktoberfest","twitch"],"created_at":"2024-11-14T22:07:13.776Z","updated_at":"2026-06-08T10:31:56.018Z","avatar_url":"https://github.com/kamiyuzu.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TwitchApi\n\n[![CI](https://github.com/kamiyuzu/scrapped_twitch_api/actions/workflows/elixir_cd.yml/badge.svg)](https://github.com/kamiyuzu/twitch_api_scraper/actions/workflows/elixir_cd.yml/badge.svg)\n[![CI](https://github.com/kamiyuzu/scrapped_twitch_api/actions/workflows/elixir_ci.yml/badge.svg)](https://github.com/kamiyuzu/twitch_api_scraper/actions/workflows/elixir_ci.yml/badge.svg)\n![GitHub](https://img.shields.io/github/license/kamiyuzu/twitch_api_scraper)\n[![Hexdocs.pm](https://img.shields.io/badge/hexdocs-online-blue)](https://hexdocs.pm/scrapped_twitch_api/)\n[![Hex.pm](https://img.shields.io/hexpm/v/scrapped_twitch_api.svg)](https://hex.pm/packages/scrapped_twitch_api)\n\u003c!--- [![Hex.pm Downloads](https://img.shields.io/hexpm/dt/scrapped_twitch_api)](https://hex.pm/packages/scrapped_twitch_api) --\u003e\n\nThis library provides an Elixir library for twitch API. It makes use of an Elixir scrapper for [Twitch API](https://github.com/kamiyuzu/twitch_api_scraper).\n\n## Library configuration\n\nFor making use of this library you will need to create a `.env` with the env vars from the [`.env_example`](.env_example). The env vars needed have to be fetched from [twitch developer documentation](https://dev.twitch.tv/docs/api).\n\nIn 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:\n\n```bash\nsource .env\n```\n\nor automate this process using [direnv](https://direnv.net/).\n\n```bash\n# Install direnv using brew\n$ brew install direnv\n\n# From the project folder\n$ direnv allow\n```\n\nContinue with the instructions [here](https://github.com/direnv/direnv#setup)\n\n## Library usage\n\nThe library provides dynamically modules for fetching all Twitch API endpoints. The convention is: `TwitchApi.\u003cTwitchCategory\u003e.\u003cAction\u003e\u003cEndpoint\u003e`. The convention might not be a rule since Twitch reference do not follow this rule always.\n\nWe have two supported ways for dealing with Twitch API requests. In one hand we can deal through App access token requests. On the other hand we can go through OAuth access token requests.\n\n### App access token flow:\n\nFor working with this flow you can change your application twitch scopes in the [`config/config.exs`](config/config.exs) file.\nTo add the scopes you seems appropriate for your application just add them into the existing list of scopes.\n\nThe scope added into the application is the default one twitch will ask for the basic actions. For more information about working with Twitch scopes please read further in: [scopes_documentation](https://dev.twitch.tv/docs/authentication/#scopes).\n\nThis is an example running iex:\n\n```elixir\niex(1)\u003e h TwitchApi.Users.GetUsers\n\n                            TwitchApi.Users.GetUsers                            \n\n⛔ This module is autogenerated please do not modify manually.\n\n## Example request from twitch api docs:\n\n### descriptions:\n\nThis gets information about user 141981764.\n\n### requests:\n\ncurl -X GET 'https://api.twitch.tv/helix/users?id=141981764' -H'Authorization:\nBearer cfabdegwdoklmawdzdo98xt2fo512y' -H'Client-Id:\nuo6dggojyb8d6soh92zknwmi5ej1q2'\n\n## Example response from twitch api docs:\n\n### descriptions:\n\n### responses:\n\n{\"data\":[{\"id\":\"141981764\",\"login\":\"twitchdev\",\"display_name\":\"TwitchDev\",\"type\":\"\",\"broadcaster_type\":\"partner\",\"description\":\"Supporting\nthird-party developers building Twitch integrations from chatbots to game\nintegrations.\",\"profile_image_url\":\"https://static-cdn.jtvnw.net/jtv_user_pictures/8a6381c7-d0c0-4576-b179-38bd5ce1d6af-profile_image-300x300.png\",\"offline_image_url\":\"https://static-cdn.jtvnw.net/jtv_user_pictures/3f13ab61-ec78-4fe6-8481-8682cb3b0ac2-channel_offline_image-1920x1080.png\",\"view_count\":5980557,\"email\":\"not-real@email.com\",\"created_at\":\"2016-12-14T20:32:28Z\"}]}\n\niex(2)\u003e h TwitchApi.Users.GetUsers.call\n\n                                 def call(map)                                  \n\n  @spec call(id() | login()) ::\n          {:ok, Finch.Response.t()} | {:error, Exception.t()}\n\n### Description:\n\nGets information about one or more specified Twitch users. Users are identified\nby optional user IDs and/or login name.\n\n### Required authentication:\n\nOAuth or App Access Token required.\n\n### Required authorization:\n\nOAuth token with user:read:email scope required to include the user’s verified\nemail address in response.\n\niex(4)\u003e TwitchApi.Users.GetUsers.call(%{login: \"hiimkamiyuzu\"})\n{:ok,\n %Finch.Response{\n   body: \"{\\\"data\\\":[{\\\"id\\\":\\\"61425548\\\",\\\"login\\\":\\\"hiimkamiyuzu\\\",\\\"display_name\\\":\\\"hiimkamiyuzu\\\",\\\"type\\\":\\\"\\\",\\\"broadcaster_type\\\":\\\"\\\",\\\"description\\\":\\\"\\\",\\\"profile_image_url\\\":\\\"https://static-cdn.jtvnw.net/user-default-pictures-uv/294c98b5-e34d-42cd-a8f0-140b72fba9b0-profile_image-300x300.png\\\",\\\"offline_image_url\\\":\\\"\\\",\\\"view_count\\\":56,\\\"created_at\\\":\\\"2014-04-22T20:21:11Z\\\"}]}\",\n   headers: [\n     {\"connection\", \"keep-alive\"},\n     {\"content-length\", \"344\"},\n     {\"content-type\", \"application/json; charset=utf-8\"},\n     {\"access-control-allow-origin\", \"*\"},\n     {\"ratelimit-limit\", \"800\"},\n     {\"ratelimit-remaining\", \"799\"},\n     {\"ratelimit-reset\", \"1635433387\"},\n     {\"timing-allow-origin\", \"https://www.twitch.tv\"},\n     {\"twitch-trace-id\", \"a3b64ecc00d7eeb6e4907178aed26f75\"},\n     {\"x-ctxlog-logid\", \"1-617abbaa-3c3a10aa517d7b763d900346\"},\n     {\"date\", \"Thu, 28 Oct 2021 15:03:07 GMT\"},\n     {\"x-served-by\", \"cache-sea4446-SEA, cache-bma1646-BMA\"},\n     {\"x-cache\", \"MISS, MISS\"},\n     {\"x-cache-hits\", \"0, 0\"},\n     {\"x-timer\", \"S1635433387.877013,VS0,VS0,VE170\"},\n     {\"vary\", \"Accept-Encoding\"},\n     {\"strict-transport-security\", \"max-age=300\"}\n   ],\n   status: 200\n }}\niex(3)\u003e t TwitchApi.Users.GetUsers.                            \nid/0       login/0    \niex(4)\u003e t TwitchApi.Users.GetUsers.id\n@type id() :: %{id: String.t()}\n\nUser ID. Multiple user IDs can be specified. Limit: 100.\n\niex(5)\u003e t TwitchApi.Users.GetUsers.login\n@type login() :: %{login: String.t()}\n\nUser login name. Multiple login names can be specified. Limit: 100.\n```\n\n### OAuth access token flow:\n\nWe will need to configure in our application [`config/config.exs`](config/config.exs) file the callback url registered in our [twitch_dev_console](https://dev.twitch.tv/console).\n\nFirst things first you will need the user to authorize your application. For this purpose you will need to make the user go through [oauth_url](http://localhost:8090/oauth?scopes[]=). You will have to specify the scopes required for that user access token as query param array values. Example: `http://localhost:8090/oauth?scopes[]=channel:read:stream_key`. For more information about working with Twitch scopes please read further in: [scopes_documentation](https://dev.twitch.tv/docs/authentication/#scopes).\n\nFor dealing with the OAuth flow we will have to specify in the `user_info` from the Twitch API requests needing OAuth. The user previously authenticated in our application ID or username is the only information needed.\n\n```elixir\niex(1)\u003e TwitchApi.Streams.GetStreamKey.call(%{broadcaster_id: \"61425548\"}, %{user_name: \"hiimkamiyuzu\"}) \n{:ok,\n %Finch.Response{\n   body: \"{\\\"data\\\":[{\\\"stream_key\\\":\\\"live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\\\"}]}\",\n   headers: [\n     {\"connection\", \"keep-alive\"}, \n     {\"content-length\", \"72\"},\n     {\"content-type\", \"application/json; charset=utf-8\"},\n     {\"access-control-allow-origin\", \"*\"},\n     {\"ratelimit-limit\", \"800\"},\n     {\"ratelimit-remaining\", \"799\"},\n     {\"ratelimit-reset\", \"1635445341\"},\n     {\"timing-allow-origin\", \"https://www.twitch.tv\"},\n     {\"twitch-trace-id\", \"dfd9e95dd1ebf728feac2ee4b3f1cdab\"},\n     {\"x-ctxlog-logid\", \"1-617aea5c-2c76b5bc24bee60022f8e95b\"},\n     {\"date\", \"Thu, 28 Oct 2021 18:22:20 GMT\"},\n     {\"x-served-by\", \"cache-sea4427-SEA, cache-hel1410028-HEL\"},\n     {\"x-cache\", \"MISS, MISS\"},\n     {\"x-cache-hits\", \"0, 0\"},\n     {\"x-timer\", \"S1635445340.130363,VS0,VS0,VE237\"},\n     {\"vary\", \"Accept-Encoding\"},\n     {\"strict-transport-security\", \"max-age=300\"}\n   ],\n   status: 200\n }}\n```\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed\nby adding `scrapped_twitch_api` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:scrapped_twitch_api, \"~\u003e 0.1.2\"}\n  ]\nend\n```\n\nDocs can be found at [https://hexdocs.pm/scrapped_twitch_api](https://hexdocs.pm/scrapped_twitch_api).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamiyuzu%2Fscrapped_twitch_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkamiyuzu%2Fscrapped_twitch_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamiyuzu%2Fscrapped_twitch_api/lists"}