Twitch API console logging the Data

I am stuck obtaining the data of the twitch using the pass-through of FCC . here is the code I tried:

 type: 'GET',
 url: '',
 success: function(data) {
   error: function(){

I tried changing dataType to ‘json’, async to false. but with no luck

I also tried doing

$.get("" , function(data){

I tried this using POSTMAN and it works just fine, it returned me the strings needed but I can’t seem to do it in Here is my code

When I run your code, I get the following error in the browser console:

Failed to load Redirect from ‘’ to ‘’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘’ is therefore not allowed access.

Learn to read your browser console. It is the most valuable tool a web dev has, only second to coffee.

CORS is an issue all to itself. I’m not sure why it is an issue here, but a little research shows that the url string has changed. When I try:

 url: '',

I get a good response in codepen.

Let us know if it still isn’t working.

Yes, APIs are confusing, especially when you are learning. Your struggles are typical.

1 Like

@kevinSmith Thanks, I thought that codepen’s console is the same as my browser’s console so I ignore my browser’s console and hoping some explanation would appear in codepen console. Now that I see the issue . I have resolve it by changing the URL. Thank you for the explanation .

Yeah, I made that same mistake when I was learning. The codepen version leaves out a lot of the errors, unfortunately.

1 Like