# Twitch

> Look up Twitch profiles, find live streams, and list channel followers.

App · Video & Audio · 3 actions · 1 trigger. Web page: https://docs.lodol.com/docs/integrations/twitch

## Triggers

Start a workflow when something happens in Twitch. See [how triggers work](https://docs.lodol.com/docs/concepts/triggers.md).

### Twitch channel goes live

Starts the workflow when a channel you specify starts streaming.

**Filters**: Narrow which events start a run.

- `channel` (required)

**Event fields**: What a run starts with. Later steps read each field with an @ reference.

- `stream_id` (text)
- `user_id` (text)
- `user_login` (text)
- `user_name` (text)
- `game_id` (text)
- `game_name` (text)
- `title` (text)
- `viewer_count` (number)
- `started_at` (text)

## Actions

### Get user profile

Look up a Twitch user's profile by their username.

**Inputs**

- Username (`user_login`, text, required): The Twitch username to look up, for example 'ninja'.

**Outputs**

- `user` (object): The user's profile details.

**Example output**

```json
{
  "user": {
    "description": "mock_value",
    "display_name": "mock_value",
    "id": "mock_value",
    "login": "mock_value"
  }
}
```

### List channel followers

List the people who follow a channel, along with when they followed and the total follower count. You can only list followers for your own channel or a channel you moderate.

**Inputs**

- Channel username (`channel`, text, required): The channel's Twitch username, for example 'ninja'. This must be your own channel or one you moderate.
- Number of followers (`first`, number): Maximum number of followers to return, from 1 to 100. Defaults to 20. Default: `20`.

**Outputs**

- `followers` (list): The people who follow the channel.
- `total` (number): The total number of people who follow the channel.

**Example output**

```json
{
  "followers": [
    {
      "followed_at": "mock_value",
      "user_id": "mock_value",
      "user_name": "mock_value"
    }
  ],
  "total": 1024
}
```

### List live streams

List live streams by channel name or game.

**Inputs**

- Channel username (`user_login`, text): Only show the live stream for this channel's username, for example 'ninja'.
- Game or category ID (`game_id`, text): Only show streams playing this game or category. Use the numeric ID Twitch assigns to the game or category.
- Number of streams (`first`, number): Maximum number of streams to return, from 1 to 100. Defaults to 20. Default: `20`.

**Outputs**

- `streams` (list): The live streams that matched your search.

**Example output**

```json
{
  "streams": [
    {
      "id": "mock_value",
      "title": "mock_value",
      "user_id": "mock_value",
      "user_name": "mock_value",
      "viewer_count": 123
    }
  ]
}
```
