Skip to main content
This endpoint checks if the Twitch channel is currently live. If online, it returns the live stream data from Twitch. If offline, it returns the most recent VOD from the database.

Endpoint

id
string
required
The Twitch user ID to check stream status for
GET /api/twitch/stream/[id]

Response

The response varies depending on whether the stream is live or offline.

Live stream response

id
string
Stream ID
user_id
string
Twitch user ID
user_login
string
Twitch username (lowercase)
user_name
string
Twitch display name
game_id
string
ID of the game being played
game_name
string
Name of the game being played
type
string
Stream type, always “live” when online
title
string
Stream title
viewer_count
number
Current number of viewers
started_at
string
ISO 8601 timestamp of when the stream started
language
string
Stream language code
thumbnail_url
string
Template URL for stream thumbnail
tag_ids
string[]
Array of tag IDs applied to the stream
tags
string[]
Array of tag names applied to the stream
is_mature
boolean
Whether the stream is marked as mature content

Offline stream response

type
string
Always “offline” when the stream is not live
lastVod
object
The most recent VOD from the database
vodid
string
VOD ID (primary key)
title
string
VOD title
date
timestamp
Date when the VOD was created
url
string
URL to the VOD
thumbnail
string
URL to the VOD thumbnail
viewCount
number
Number of views on the VOD
onlineIntendDate
string
Predicted date for next stream
duration
number
VOD duration in seconds
transcript
object
VOD transcript data

Examples

Request

curl https://kommtkevinonline.de/api/twitch/stream/123456789

Response (live)

{
  "id": "41234567890",
  "user_id": "123456789",
  "user_login": "kommtkev1n",
  "user_name": "KommtKev1n",
  "game_id": "509658",
  "game_name": "Just Chatting",
  "type": "live",
  "title": "Streaming now!",
  "viewer_count": 1337,
  "started_at": "2026-03-03T14:30:00Z",
  "language": "de",
  "thumbnail_url": "https://static-cdn.jtvnw.net/previews-ttv/live_user_kommtkev1n-{width}x{height}.jpg",
  "tag_ids": [],
  "tags": ["German", "English"],
  "is_mature": false
}

Response (offline)

{
  "type": "offline",
  "lastVod": {
    "vodid": "2345678901",
    "title": "Previous stream VOD",
    "date": "2026-03-01T18:00:00.000Z",
    "url": "https://www.twitch.tv/videos/2345678901",
    "thumbnail": "https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/thumbnail.jpg",
    "viewCount": 500,
    "onlineIntendDate": "2026-03-05",
    "duration": 7200,
    "transcript": {}
  }
}

Build docs developers (and LLMs) love