# Twitch API using Javascript

**URL:** <https://discuss.dev.twitch.com/t/twitch-api-using-javascript/27860>\
**Category:** API\
**Created:** [August 23, 2020, 4:36pm UTC](https://discuss.dev.twitch.com/t/twitch-api-using-javascript/27860 "2020-08-23T16:36:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Die\_Pauls\_Zocken](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/die_pauls_zocken/32/10050_2.png) [@Die\_Pauls\_Zocken](https://discuss.dev.twitch.com/u/Die_Pauls_Zocken)\
**Post date:** [August 23, 2020, 4:36pm UTC](https://discuss.dev.twitch.com/t/twitch-api-using-javascript/27860/1 "2020-08-23T16:36:26Z")

</div>

Hello!  
I tried to use the Twitch API with Javascript. I tried this:

```
const header = {
    headers: {
        'Client-ID': client_id
    }
}
fetch("https://api.twitch.tv/helix/users?login=revedtv", header).then(response => console.log(response))

```

but I only get this error  
 ![image](https://d2opxh93rbxzdn.cloudfront.net/original/2X/5/51294da50fb65f690bd10ba0bd6b6b130ca6a3c6.png)  
Can someone please help me?

PS: Sorry for my bad English.

---

<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:** [August 23, 2020, 4:53pm UTC](https://discuss.dev.twitch.com/t/twitch-api-using-javascript/27860/2 "2020-08-23T16:53:14Z")

</div>

All of Helix requires an oAuth token, you didn’t specify one

> **[Requiring OAuth for Helix Twitch API Endpoints](https://discuss.dev.twitch.com/t/requiring-oauth-for-helix-twitch-api-endpoints/23916)**
>
> In an effort to standardize authentication and provide security improvements for the Twitch community, OAuth will soon be required for all Twitch API endpoints in the new Twitch API, also known as “Helix.” The goal of this announcement is to...

Authentication is documented here

> **[Authentication](https://dev.twitch.tv/docs/authentication/)**
>
> Authentication

---

<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:** [September 22, 2020, 4:53pm UTC](https://discuss.dev.twitch.com/t/twitch-api-using-javascript/27860/3 "2020-09-22T16:53:15Z")

</div>

Closed on September 22, 2020, 4:53pm UTC

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