# Verify if Channel is Live w/ VB.NET

**URL:** <https://discuss.dev.twitch.com/t/verify-if-channel-is-live-w-vb-net/28555>\
**Category:** API\
**Created:** [October 10, 2020, 4:31pm UTC](https://discuss.dev.twitch.com/t/verify-if-channel-is-live-w-vb-net/28555 "2020-10-10T16:31:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CXA001](https://avatars.discourse-cdn.com/v4/letter/c/74df32/32.png) [@CXA001](https://discuss.dev.twitch.com/u/CXA001)\
**Post date:** [October 10, 2020, 4:31pm UTC](https://discuss.dev.twitch.com/t/verify-if-channel-is-live-w-vb-net/28555/1 "2020-10-10T16:31:37Z")

</div>

I have a web site that has [VB.NET](http://VB.NET) as the code behind where I want to verify if a particular channel is live.

According to the Twitch API documentation:

```auto
curl --location --request
GET 'https://api.twitch.tv/helix/search/channels?query=a_seagull' \
--header 'client-id: wbmytr93xzw8zbg0p1izqyzzc5mbiz' \
--header 'Authorization: Bearer 2gbdx6oar67tqtcmt49t3wpcgycthx'

```

header 'client-id: Is this my client ID?  
header 'Authorization: Does Bearer need to be in there?

I used to have this working, but with the expiration of the old APIs it no longer works:  
Dim stringGetInfo As String = New WebClient().DownloadString(“[https://api.twitch.tv/helix/search/channels?query=](https://api.twitch.tv/helix/search/channels?query=)” & stringTwitchID & “&client\_id=”)

Could someone be so kind as to provide a [VB.NET](http://VB.NET) example for this?

I have tried every which way and Googled, my fingers off but I have not been able to find any good examples and those I have tried always result in 401 errors.

I appreciate any assistance.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [October 10, 2020, 4:35pm UTC](https://discuss.dev.twitch.com/t/verify-if-channel-is-live-w-vb-net/28555/2 "2020-10-10T16:35:06Z")

</div>

> [@CXA001](#):
>
> header 'client-id: Is this my client ID?

Yes

> [@CXA001](#):
>
> header 'Authorization: Does Bearer need to be in there?

Yes

The header is

```
Authorization: Bearer YOURTOKEN

```

They also both have to be Headers

> [@CXA001](#):
>
> Dim stringGetInfo As String = New WebClient().DownloadString(“[https://api.twitch.tv/helix/search/channels?query=”](https://api.twitch.tv/helix/search/channels?query=%E2%80%9D) & stringTwitchID & “&client\_id=”)

Also probably not a good use of a the search endpoint, you want the “Get Streams” endpoint.

> **[Reference](https://dev.twitch.tv/docs/api/reference/)**
>
> Twitch Developer tools and services to integrate Twitch into your development or create interactive experience on twitch.tv.

WebClient headers is covered here

> **[WebClient.Headers Property (System.Net)](https://learn.microsoft.com/en-us/dotnet/api/system.net.webclient.headers?view=netcore-3.1)**
>
> Gets or sets a collection of header name/value pairs associated with the request.

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [November 9, 2020, 4:35pm UTC](https://discuss.dev.twitch.com/t/verify-if-channel-is-live-w-vb-net/28555/3 "2020-11-09T16:35:14Z")

</div>

Closed on November 9, 2020, 4:35pm UTC

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