Using Search Channels Twitch API Endpoint not returning values

EDIT: I didn’t see the "Returns a list of channels (users who have streamed within the past 6 months) and I didn’t stream in the last 6 months haha topic closed"

My Twitch username is VersifiXion, and I want to get on my website if I’m in live or not,
So I want to use the Search Channels endpoint that returns at “is_live” property in the JSON returned,

But when I put my username “VersifiXion” in the query parameter I get an empty array of objects, but it works for other usernames, is it normal ?
Maybe I’m not using it right, or it’s not the right endpoint I should use ?

Docs : https://dev.twitch.tv/docs/api/reference#search-channels

You’re using the wrong endpoint. Search is for when you want to search for channels that match in part or whole your query, but you already know the specific channel so don’t need to search.

If you want to see if a channel is online you should use the Get Streams endpoint https://dev.twitch.tv/docs/api/reference#get-streams which will return an empty array if you’re offline, or the stream object for the channel if you are online.

Ok but about this endpoint what is the difference in the JSON between a channel in live or not ?

Channel that is live:

{
  "data": [
    {
      "id": "41375541868",
      "user_id": "459331509",
      "user_login": "auronplay",
      "user_name": "auronplay",
      "game_id": "494131",
      "game_name": "Little Nightmares",
      "type": "live",
      "title": "hablamos y le damos a Little Nightmares 1",
      "viewer_count": 78365,
      "started_at": "2021-03-10T15:04:21Z",
      "language": "es",
      "thumbnail_url": "https://static-cdn.jtvnw.net/previews-ttv/live_user_auronplay-{width}x{height}.jpg",
      "tag_ids": [
        "d4bb9c58-2141-4881-bcdc-3fe0505457d1"
      ]
    },
    ...
  ],
  "pagination": {
    "cursor": "eyJiIjp7IkN1cnNvciI6ImV5SnpJam8zT0RNMk5TNDBORFF4TlRjMU1UY3hOU3dpWkNJNlptRnNjMlVzSW5RaU9uUnlkV1Y5In0sImEiOnsiQ3Vyc29yIjoiZXlKeklqb3hOVGs0TkM0MU56RXhNekExTVRZNU1ESXNJbVFpT21aaGJITmxMQ0owSWpwMGNuVmxmUT09In19"
  }
}```

Channel that is offline:

{
  "data": [],
  "pagination": {}
}

Thank you so much it’s OK

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.